rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
except:
else:
def setNodeData( self, nodeid, data ): try: self.nodes[ nodeid ].setData( data ) except: print "DataNode: nodeid ", nodeid, "not in nodes", self.nodes
try:
if nodeid in self.nodes:
def setSlotData( self, nodeid, slotid, data ): try: self.nodes[ nodeid ].setDataSlot( slotid, data ) except: print "SlotData: nodeid ", nodeid, "not in nodes", self.nodes
except:
else:
def setSlotData( self, nodeid, slotid, data ): try: self.nodes[ nodeid ].setDataSlot( slotid, data ) except: print "SlotData: nodeid ", nodeid, "not in nodes", self.nodes
datanetwork = DataNetwork( "127.0.0.1", 57000, "pydon", 1, 20 )
datanetwork = DataNetwork( "127.0.0.1", 57000, "pydon", 0, 20 ) while not datanetwork.osc.registered: print "waiting to be registered" myTime.sleep( 1.0 ) datanetwork.osc.subscribeNode( 1, setDataAction )
def sendLabel( self, nodeid, data ): self.osc.setLabel( nodeid, data )
Closes the device. """ forensic1394_close_device(self)
Closes the device. If the device is stale this is a no-op """ if not self._stale: forensic1394_close_device(self)
def close(self): """ Closes the device. """ forensic1394_close_device(self)
""" return bool(forensic1394_is_device_open(self))
In the case of a stale handle False is returned. """ if self._stale: return False else: return bool(forensic1394_is_device_open(self))
def isopen(self): """ Checks to see if the device is open or not, returning a boolean value. """ return bool(forensic1394_is_device_open(self))
self._devices = []
self._wrefdev = []
def __init__(self): # Allocate a new bus handle; _as_parameter_ allows passing of self self._as_parameter_ = forensic1394_alloc()
for d in self._devices: d._stale = True
for wdev in self._wrefdev: if wdev(): wdev()._stale = True
def devices(self): # Mark any active device handles as being stale, preventing further use for d in self._devices: d._stale = True
self._devices = []
self._wrefdev = []
def devices(self): # Mark any active device handles as being stale, preventing further use for d in self._devices: d._stale = True
self._devices.append(Device(self, devlist[i]))
d = Device(self, devlist[i]) dev.append(d) self._wrefdev.append(weakref.ref(d))
def devices(self): # Mark any active device handles as being stale, preventing further use for d in self._devices: d._stale = True
return self._devices[:]
return dev
def devices(self): # Mark any active device handles as being stale, preventing further use for d in self._devices: d._stale = True
except socket.error, ex: if ex.errno in [errno.ECONNRESET]: pass else: raise
except socket.error, (err_no, err_str): if err_no in [errno.ECONNRESET]: pass else: raise
def h(self, data, **kwargs): self.send_response(kwargs.get('status', 200)) self.send_header('Content-Type', kwargs.get('type', 'application/x-dmap-tagged')) self.send_header('DAAP-Server', 'Simple') self.send_header('Expires', '-1') self.send_header('Cache-Control', 'no-cache') self.send_header('Accept-Ranges', 'bytes'...
data = struct.pack('!4sI%s' % packing, self.code, length, value)
data = struct.pack('!4sI%s' % (packing), self.code, length, value)
def encode(self): # generate DMAP tagged data format # step 1 - find out what type of object we are if self.type == 'c': # our object is a container, # this means we're going to have to # check contains[] value = '' for item in self.contains: # get the data stream from each of the sub elements if type(item) == str: #...
value = self.value.split('.') self.value = struct.pack('!HH', int(value[0]), int(value[1]))
value = value.split('.') value = struct.pack('!HH', int(value[0]), int(value[1]))
def encode(self): # generate DMAP tagged data format # step 1 - find out what type of object we are if self.type == 'c': # our object is a container, # this means we're going to have to # check contains[] value = '' for item in self.contains: # get the data stream from each of the sub elements if type(item) == str: #...
if (type(self.value) == str and len(self.value) <= 4):
if (type(value) == str and len(value) <= 4):
def encode(self): # generate DMAP tagged data format # step 1 - find out what type of object we are if self.type == 'c': # our object is a container, # this means we're going to have to # check contains[] value = '' for item in self.contains: # get the data stream from each of the sub elements if type(item) == str: #...
packing = '%ss' % len(self.value)
if type(value) == unicode: value = value.encode('utf-8') packing = '%ss' % len(value)
def encode(self): # generate DMAP tagged data format # step 1 - find out what type of object we are if self.type == 'c': # our object is a container, # this means we're going to have to # check contains[] value = '' for item in self.contains: # get the data stream from each of the sub elements if type(item) == str: #...
value = self.value if type(value) == float: value = int(value) if type(value) == unicode: value = value.encode('utf-8')
def encode(self): # generate DMAP tagged data format # step 1 - find out what type of object we are if self.type == 'c': # our object is a container, # this means we're going to have to # check contains[] value = '' for item in self.contains: # get the data stream from each of the sub elements if type(item) == str: #...
digest = md5.md5(ffn).hexdigest()
digest = md5(ffn).hexdigest()
def build(self, dir, marked={}, link=False): for path, dirs, files in os.walk(dir): for d in dirs: if os.path.islink(os.path.join(path, d)): self.build(os.path.join(path,d), marked, True) for fn in files: ffn = os.path.join(path, fn) digest = md5.md5(ffn).hexdigest() marked[digest] = True md = self.get_item_by_pid(dige...
cachefn = os.path.join(dir, md5.md5(fn).hexdigest())
cachefn = os.path.join(dir, md5(fn).hexdigest())
def write_entry(self, dir, name, fn, daap): if type(name) == unicode: name = name.encode('utf-8') data = "".join([ d.encode() for d in daap]) data = struct.pack('!i%ss' % len(name), len(name), name) + data data = struct.pack('!i%ss' % len(fn), len(fn), fn) + data cachefn = os.path.join(dir, md5.md5(fn).hexdigest()) f =...
feedItem = FeedItem(); feedItem.guid = self.readText(itemNode,"guid"); feedItem.title = self.readText(itemNode,"title"); feedItem.subTitle = self.readText(itemNode,"itunes:subtitle"); dateString = self.readText(itemNode,"pubDate"); feedItem.date = self.parseDate(dateString); if(not self.checkArticleAge(feedItem.date)...
try: feedItem = FeedItem(); feedItem.guid = self.readText(itemNode,"guid"); feedItem.title = self.readText(itemNode,"title"); feedItem.subTitle = self.readText(itemNode,"itunes:subtitle"); dateString = self.readText(itemNode,"pubDate"); feedItem.date = self.parseDate(dateString); if(not self.checkArticleAge(feedItem....
def updateFeed(self): self.gui.log("Load: "+self.feedUrl); xmlPage = self.loadPage(self.feedUrl); xmlDocument = minidom.parseString(xmlPage); counter = 0; for itemNode in xmlDocument.getElementsByTagName("item"): feedItem = FeedItem(); feedItem.guid = self.readText(itemNode,"guid"); feedItem.title = self.readText(itemN...
if(eject == True): break; feedItem.author = self.readText(itemNode,"itunes:author"); feedItem.duration = self.readText(itemNode,"itunes:duration").replace("00:",""); enclosures = itemNode.getElementsByTagName("enclosure") if(len(enclosures) > 0): enclosureNode = itemNode.getElementsByTagName("enclosure")[0]; feedIte...
eject = False; for i in range(counter,len(self.feedItems)): storedItem = self.feedItems[i]; if(not storedItem.date < feedItem.date): eject =True; break; if(eject == True): break; feedItem.author = self.readText(itemNode,"itunes:author"); feedItem.duration = self.readText(itemNode,"itunes:duration").replace("00:","");...
def updateFeed(self): self.gui.log("Load: "+self.feedUrl); xmlPage = self.loadPage(self.feedUrl); xmlDocument = minidom.parseString(xmlPage); counter = 0; for itemNode in xmlDocument.getElementsByTagName("item"): feedItem = FeedItem(); feedItem.guid = self.readText(itemNode,"guid"); feedItem.title = self.readText(itemN...
feedItem.readed = False; self.insertFeedItem(feedItem); counter += 1; if(counter>self.maxArticleNumber): break; self.shrinkFeedItems();
feedItem.readed = False; self.insertFeedItem(feedItem); counter += 1; if(counter>self.maxArticleNumber): break; except: pass; self.shrinkFeedItems();
def updateFeed(self): self.gui.log("Load: "+self.feedUrl); xmlPage = self.loadPage(self.feedUrl); xmlDocument = minidom.parseString(xmlPage); counter = 0; for itemNode in xmlDocument.getElementsByTagName("item"): feedItem = FeedItem(); feedItem.guid = self.readText(itemNode,"guid"); feedItem.title = self.readText(itemN...
{'user_id': 'foobar', 'description': None, 'localperms': {}, 'location': '', 'filters': {}, 'fullname': None, '_getMappings': [], 'email': None}
{'user_id': 'foobar', 'description': None, 'location': '', 'filters': {}, 'fullname': None, '_getMappings': [], 'email': None}
... def __init__(self, environ={}):
Plone treats recognizes him, assigns local permissions if ShibbolethPermissions is installed and passes control to the next
Plone recognizes him and passes control to the next
def safe_int(s, default=0): try: return int(s) except (ValueError, TypeError): return default
js += 'function initCharts() { for (var i=0;i<4;++i) { MouseOutL(i); MouseOutFS(i); MouseOutO(i); if (i<3) { MouseOutFL(i); MouseOutJ(i); } } MouseOutFS(4); MouseOutO(4); }\n'
js += 'function initCharts() { for (var i=0;i<7;++i) { if (i<4) { MouseOutL(i); MouseOutFS(i); } MouseOutO(i); if (i<3) { MouseOutFL(i); MouseOutJ(i); } } }\n'
def MakeStatsPage(): """ Generate Statistics Page """ if metaInfo.indexPage['stat'] == '': # statistics disabled return printProgress(_('Creating statistics page')) outfile = fopen(metaInfo.htmlDir + metaInfo.indexPage['stat'], 'w', metaInfo.encoding) outfile.write(MakeHTMLHeader('stat',True,'initCharts();')) try: c...
makeUsagePage('where','tab',view_info)
makeUsagePage('where','tab',tab_info)
def makeUsagePage(page,otype,obj): """ Write the where/what used page @param string page 'where' or 'what' @param string otype object type ('view','pkg','func','proc') @param object obj object info (object of type ElemInfo, see hypercore.py) """ unum = obj.uniqueNumber if page=='where': used_keys = obj.whereUsed.keys()...
if outer_file_info.fileName not in package_info.whereUsed.keys(): package_info.whereUsed[outer_file_info.fileName] = [] package_info.whereUsed[outer_file_info.fileName].append((outer_file_info, lineNumber)) else: package_info.whereUsed[outer_file_info.fileName].append((outer_file_info, lineNumber)) if package_info.un...
def ScanFilesForWhereViewsAndPackagesAreUsed(): """ Scans files collected in metaInfo.fileInfoList and checks them line by line with metaInfo.<object>list for calls to those objects. If it finds any, it updates <object>list where_used property accordingly. """ printProgress("Scanning source files for where views and pa...
and (fileLines[lineNumber].upper().find(" " + function_info.name.upper(),0,epos) == -1 \
and (fileLines[lineNumber].upper().find(" " + function_info.name.upper(),0,epos) != -1 \
def ScanFilesForWhereViewsAndPackagesAreUsed(): """ Scans files collected in metaInfo.fileInfoList and checks them line by line with metaInfo.<object>list for calls to those objects. If it finds any, it updates <object>list where_used property accordingly. """ printProgress("Scanning source files for where views and pa...
if len(package_info.whereUsed.keys()) == 0: continue
if len(package_info.whereUsed.keys()) != 0:
def CreateWhereUsedPages(): """Generate a where-used-page for each object""" printProgress("Creating 'where used' pages") html_dir = metaInfo.htmlDir fileInfoList = metaInfo.fileInfoList # loop through files dot_count = 1 for file_info in fileInfoList: # skip all non-sql files if file_info.fileType != "sql": continu...
minBytes = maxint maxBytes = 0
if len(self.fileInfoList) > 0: minBytes = self.fileInfoList[0].bytes maxBytes = self.fileInfoList[0].bytes else: minBytes = 0 maxBytes = 0
def getFileStat(self,what): """ Return some file statistics @param self @param string type ('files','avg lines','min lines','max lines', 'sum bytes','avg bytes','min bytes','max bytes') @return number stat_value value for the requested stat. Depending on its type, this may be either an integer or a float """ if what no...
minLines = maxint maxLines = 0
if len(self.fileInfoList) > 0: minLines = self.fileInfoList[0].lines maxLines = self.fileInfoList[0].lines else: minLines = 0 maxLines = 0
def getFileStat(self,what): """ Return some file statistics @param self @param string type ('files','avg lines','min lines','max lines', 'sum bytes','avg bytes','min bytes','max bytes') @return number stat_value value for the requested stat. Depending on its type, this may be either an integer or a float """ if what no...
functioninfolist.append((functionInfo.name.upper(), functionInfo, file_info))
functiontuplelist.append((functionInfo.name.upper(), functionInfo, file_info))
def appendStandAloneItems(xtuple,headname): if taskType == 'bug': task = xtuple[1].bugs elif taskType == 'todo': task = xtuple[1].todo else: task = xtuple[1].verification if task.allItemCount() < 1: return HTMLref,HTMLjref,HTMLpref,HTMLpjref = getDualCodeLink(xtuple) if type(xtuple[1]).__name__ == 'FormInfo': codesize ...
pie = PieChart('O',pieposx,pieposy,pie_offset,pie_rad,colors) pie.addPiece((float(views)/totalObj) * 100) pie.addPiece((float(funcs)/totalObj) * 100) pie.addPiece((float(procs)/totalObj) * 100) js += pie.generate(); bar = ChartLegend('O',barposx,barposy,bar_wid,bar_hei,pie_offset,colors,tcols) bar.addBar(_('Views')) ba...
if totalObj > 0: pie = PieChart('O',pieposx,pieposy,pie_offset,pie_rad,colors) pie.addPiece((float(views)/totalObj) * 100) pie.addPiece((float(funcs)/totalObj) * 100) pie.addPiece((float(procs)/totalObj) * 100) js += pie.generate(); bar = ChartLegend('O',barposx,barposy,bar_wid,bar_hei,pie_offset,colors,tcols) bar.addB...
def MakeStatsPage(): """ Generate Statistics Page """ if metaInfo.indexPage['stat'] == '': # statistics disabled return printProgress(_('Creating statistics page')) outfile = fopen(metaInfo.htmlDir + metaInfo.indexPage['stat'], 'w', metaInfo.encoding) outfile.write(MakeHTMLHeader('stat',True,'initCharts();')) try: c...
outfile.write(' <TR><TH CLASS="sub">'+_('Views')+'</TH><TD ALIGN="right">'+num_format(views)+'</TD><TD ALIGN="right">'+num_format((float(views)/totalObj) * 100, 2)+'%</TD></TR>\n') outfile.write(' <TR><TH CLASS="sub">'+_('Functions')+'</TH><TD ALIGN="right">'+num_format(funcs)+'</TD><TD ALIGN="right">'+num_format((fl...
outfile.write(' <TR><TH CLASS="sub">'+_('Views')+'</TH><TD ALIGN="right">'+num_format(views)+'</TD><TD ALIGN="right">'+viewPct+'%</TD></TR>\n') outfile.write(' <TR><TH CLASS="sub">'+_('Functions')+'</TH><TD ALIGN="right">'+num_format(funcs)+'</TD><TD ALIGN="right">'+funcPct+'%</TD></TR>\n') outfile.write(' <TR><TH C...
def MakeStatsPage(): """ Generate Statistics Page """ if metaInfo.indexPage['stat'] == '': # statistics disabled return printProgress(_('Creating statistics page')) outfile = fopen(metaInfo.htmlDir + metaInfo.indexPage['stat'], 'w', metaInfo.encoding) outfile.write(MakeHTMLHeader('stat',True,'initCharts();')) try: c...
pieposy = 0 pie = PieChart('J',pieposx,pieposy,pie_offset,pie_rad,colors) sum = (float(jwarns)/totalObj) * 100 sum2 = (float(jbugs)/totalObj) * 100 pie.addPiece(sum) pie.addPiece(sum2) pie.addPiece(100-(sum+sum2)) js += pie.generate(); barposy = pieposy - 2*pie_rad/3 - pie_offset bar = ChartLegend('J',barposx,barposy,...
if totalObj > 0: pieposy = 0 pie = PieChart('J',pieposx,pieposy,pie_offset,pie_rad,colors) sum = (float(jwarns)/totalObj) * 100 sum2 = (float(jbugs)/totalObj) * 100 pie.addPiece(sum) pie.addPiece(sum2) pie.addPiece(100-(sum+sum2)) js += pie.generate(); barposy = pieposy - 2*pie_rad/3 - pie_offset bar = ChartLegend('J'...
def MakeStatsPage(): """ Generate Statistics Page """ if metaInfo.indexPage['stat'] == '': # statistics disabled return printProgress(_('Creating statistics page')) outfile = fopen(metaInfo.htmlDir + metaInfo.indexPage['stat'], 'w', metaInfo.encoding) outfile.write(MakeHTMLHeader('stat',True,'initCharts();')) try: c...
outfile.write(' <TR><TH CLASS="sub">'+_('JavaDoc Warnings')+'</TH><TD ALIGN="right">'+num_format(jwarns)+'</TD><TD ALIGN="right">'+num_format((float(jwarns)/totalObj) * 100, 2)+'%</TD></TR>') outfile.write(' <TR><TH CLASS="sub">'+_('Known Bugs')+'</TH><TD ALIGN="right">'+num_format(jbugs)+'</TD><TD ALIGN="right">'+nu...
outfile.write(' <TR><TH CLASS="sub">'+_('JavaDoc Warnings')+'</TH><TD ALIGN="right">'+num_format(jwarns)+'</TD><TD ALIGN="right">'+warnPct+'%</TD></TR>') outfile.write(' <TR><TH CLASS="sub">'+_('Known Bugs')+'</TH><TD ALIGN="right">'+num_format(jbugs)+'</TD><TD ALIGN="right">'+bugPct+'%</TD></TR>') outfile.write(' <...
def MakeStatsPage(): """ Generate Statistics Page """ if metaInfo.indexPage['stat'] == '': # statistics disabled return printProgress(_('Creating statistics page')) outfile = fopen(metaInfo.htmlDir + metaInfo.indexPage['stat'], 'w', metaInfo.encoding) outfile.write(MakeHTMLHeader('stat',True,'initCharts();')) try: c...
if not item.javadoc.isDefault(): if item.javadoc.private: iname = 'private ' else: iname = 'public ' else: iname = ''
iname = item.javadoc.getVisibility()
def CreateHyperlinkedSourceFilePages(): """ Generates pages with the complete source code of each file, including link targets (A NAME=) for each line. This way we can link directly to the line starting the definition of an object, or where it is called (used) from. Very basic syntax highlighting is performed here as w...
ph += ', '+par.sqltype+' '+par.name
ph += ', ' + par.name
def CreateHyperlinkedSourceFilePages(): """ Generates pages with the complete source code of each file, including link targets (A NAME=) for each line. This way we can link directly to the line starting the definition of an object, or where it is called (used) from. Very basic syntax highlighting is performed here as w...
+ makeDualCodeRef(HTMLref,HTMLjref, oTuple[1].name.lower() + '</TD>\n'))
+ makeDualCodeRef(HTMLref,HTMLjref, oTuple[1].name.lower()) + '</TD>\n')
def WriteObjectList(oTupleList, listName, objectName): oTupleList.sort(TupleCompareFirstElements) if len(oTupleList) != 0: outfile.write(" <TR><TH class='sub' COLSPAN='3'>" + listName + "</TH></TR>\n <TR><TD COLSPAN='3'>") outfile.write("<TABLE ALIGN='center'>\n") outfile.write(" <TR><TD ALIGN='center'><B>" + obje...
if (debug): print "\n".join(lines) result.extend(lines)
if (len(lines) != 0): if (debug): print "\n".join(lines) result.extend(lines)
def callback(line): if (len(result) == 0): prev_line = None else: prev_line = result[-1] lines = break_lines(cpp_text=[line+"\n"], prev_line=prev_line) if (debug): print "\n".join(lines) result.extend(lines)
label_w = gc.GetTextExtent("X"*8)[0]
label_w = char_w * 8
def paint_sequence (self, gc) : gc.SetBrush(wx.TRANSPARENT_BRUSH) gc_txt_font = gc.CreateFont(self.txt_font, (0,0,0)) gc.SetFont(gc_txt_font) i = 0 ypos = self.line_sep xpos = 16 black_pen = wx.Pen((0,0,0), 1) (char_w, char_h) = self.get_char_size(gc) if self._style & WXTBX_SEQ_SHOW_SELECTIONS : for j, (i_start, i_end)...
char_w, char_h = dc.GetTextExtent("X") char_w = max(10, char_w)
line_w, char_h = dc.GetTextExtent("X" * 50) if wx.Platform == '__WXGTK__' : char_w = max(12, line_w / 50) elif wx.Platform == '__WXMAC__' : char_w = max(10, line_w / 50) else : raise RuntimeError("Platform not supported!")
def get_char_size (self, dc=None) : if dc is None : dc = wx.ClientDC(self) dc.SetFont(self.txt_font) char_w, char_h = dc.GetTextExtent("X") char_w = max(10, char_w) char_h = max(16, char_h) return (char_w, char_h)
x_start += dc.GetTextExtent("X" * 8)[0]
x_start += (char_w * 8)
def build_boxes (self) : #from scitbx.array_family import flex, shared self.char_boxes = [] #shared.stl_set_unsigned() dc = wx.ClientDC(self) dc.SetFont(self.txt_font) char_w, char_h = self.get_char_size(dc) x_start = 16 y_start = self.line_sep if self._style & WXTBX_SEQ_SHOW_LINE_NUMBERS : x_start += dc.GetTextExtent(...
missing_pen = wx.Pen((150, 150, 150), 4, style=wx.SHORT_DASH)
if wx.Platform == '__WXGTK__' : missing_pen = wx.Pen((150, 150, 150), 4) elif wx.Platform == '__WXMAC__' : missing_pen = wx.Pen((150, 150, 150), 4, style=wx.SHORT_DASH)
def draw_strip (strip, brush) : gc.PushState() gc.SetBrush(brush) #wx.Brush(strip_color)) path = gc.CreatePath() path.MoveToPoint(strip[0][0], strip[0][1]) for x, y in strip[1:] : path.AddLineToPoint(x, y) path.CloseSubpath() gc.FillPath(path) gc.StrokePath(path) gc.PopState()
frame.Fit()
if wx.Platform == '__WXMAC__' : frame.Fit()
def run (args) : pdb_file = args[-1] app = wx.App(0) frame = sequence_frame(None, -1, "Sequence display for %s" % os.path.basename(pdb_file)) frame.load_pdb_file(pdb_file) frame.Fit() frame.Show() if "--range" in args : frame.seq_panel.SetStyle(WXTBX_SEQ_DEFAULT_STYLE|WXTBX_SEQ_SELECT_RANGE) app.MainLoop()
cryst1 = pdb_inp.crystal_symmetry_from_cryst1() if(cryst1 is None): raise Sorry("CRYST1 record in input PDB file is incomplete or missing.") else: if([cryst1.unit_cell(), cryst1.space_group_info()].count(None) != 0): raise Sorry("CRYST1 record in input PDB file is incomplete or missing.") xray_structure = pdb_inp.xray_...
def run(args, log = sys.stdout): print >> log, legend # XXX: pre-processing for GUI; duplicates some of mmtbx.utils sources = [] for arg in args : if os.path.isfile(arg) : try : file_phil = iotbx.phil.parse(file_name=arg) except KeyboardInterrupt : raise except RuntimeError : pass else : if len(file_phil.objects) != 0 ...
if(data_sizes.all_eq(data_sizes[0])): ma = miller_arrays[0]
if(data_sizes.all_eq(data_sizes[0])): miller_array = miller_arrays[0]
def run(args, log = sys.stdout): print >> log, legend # XXX: pre-processing for GUI; duplicates some of mmtbx.utils sources = [] for arg in args : if os.path.isfile(arg) : try : file_phil = iotbx.phil.parse(file_name=arg) except KeyboardInterrupt : raise except RuntimeError : pass else : if len(file_phil.objects) != 0 ...
start_chain_id=line[18:20].strip(),
start_chain_id=parse_chain_id(line[18:20]),
def parse_helix_records (records) : helices = [] for line in records : if not line.startswith("HELIX") : continue try : length = string.atoi(line[71:76]) except ValueError : length = 0 current_helix = pdb_helix( serial=string.atoi(line[7:10]), helix_id=line[11:14].strip(), start_resname=line[15:18], start_chain_id=line...
end_chain_id=line[30:32].strip(),
end_chain_id=parse_chain_id(line[30:32]),
def parse_helix_records (records) : helices = [] for line in records : if not line.startswith("HELIX") : continue try : length = string.atoi(line[71:76]) except ValueError : length = 0 current_helix = pdb_helix( serial=string.atoi(line[7:10]), helix_id=line[11:14].strip(), start_resname=line[15:18], start_chain_id=line...
start_chain_id=line[20:22].strip(),
start_chain_id=parse_chain_id(line[20:22]),
def parse_sheet_records (records) : sheets = [] current_sheet = None current_sheet_id = None for line in records : if not line.startswith("SHEET") : continue line = "%-80s" % line # XXX: flex.split_lines strips each line sheet_id = line[11:14] n_strands = string.atoi(line[14:16]) if sheet_id != current_sheet_id : if cu...
end_chain_id=line[31:33].strip(),
end_chain_id=parse_chain_id(line[31:33]),
def parse_sheet_records (records) : sheets = [] current_sheet = None current_sheet_id = None for line in records : if not line.startswith("SHEET") : continue line = "%-80s" % line # XXX: flex.split_lines strips each line sheet_id = line[11:14] n_strands = string.atoi(line[14:16]) if sheet_id != current_sheet_id : if cu...
cur_chain_id=line[48:50].strip(),
cur_chain_id=parse_chain_id(line[48:50]),
def parse_sheet_records (records) : sheets = [] current_sheet = None current_sheet_id = None for line in records : if not line.startswith("SHEET") : continue line = "%-80s" % line # XXX: flex.split_lines strips each line sheet_id = line[11:14] n_strands = string.atoi(line[14:16]) if sheet_id != current_sheet_id : if cu...
prev_chain_id=line[63:65].strip(),
prev_chain_id=parse_chain_id(line[63:65]),
def parse_sheet_records (records) : sheets = [] current_sheet = None current_sheet_id = None for line in records : if not line.startswith("SHEET") : continue line = "%-80s" % line # XXX: flex.split_lines strips each line sheet_id = line[11:14] n_strands = string.atoi(line[14:16]) if sheet_id != current_sheet_id : if cu...
assume_hydrogens_all_missing=None, return_bonds=True) :
assume_hydrogens_all_missing=None, return_bonds=False) :
def process_structure (params, processed_pdb_file, tmp_dir, log, assume_hydrogens_all_missing=None, return_bonds=True) : acp = processed_pdb_file.all_chain_proxies try : sec_str_from_pdb_file = acp.extract_secondary_structure() except Exception : sec_str_from_pdb_file = None pdb_hierarchy = acp.pdb_hierarchy xray_struc...
if (d < 0 and co.change_of_basis != "to_inverse_hand"):
d = cb_op.c().r().determinant() print " Determinant:", d if (d < 0) and (c_o_b != "to_inverse_hand") :
def __init__ (self, params, input_files=None, log=sys.stderr, accumulation_callback=None, symmetry_callback=None) : adopt_init_args(self, locals()) if len(params.mtz_file.miller_array) == 0 : raise Sorry("No Miller arrays have been selected for the output file.") elif len(params.mtz_file.miller_array) > 25 : raise Sorr...
self._label_font = wx.Font(font_size, wx.SWISS, wx.NORMAL, wx.BOLD)
self._label_font = self.GetFont() self._label_font.SetPointSize(label_size) self._label_font.SetWeight(wx.FONTWEIGHT_BOLD)
def __init__ (self, parent, id_=wx.ID_ANY, label='', label2='', bmp=None, pos=wx.DefaultPosition, size=wx.DefaultSize, style=MB_STYLE_DEFAULT, name=wx.ButtonNameStr, start_color=(218,218,218), gradient_percent=15.0, highlight_color=(230,230,230), label_size=13, caption_size=11, button_margin=2, disable_after_click=0): ...
self._label2_font = wx.Font(caption_size, wx.SWISS, wx.ITALIC, wx.NORMAL)
def __init__ (self, parent, id_=wx.ID_ANY, label='', label2='', bmp=None, pos=wx.DefaultPosition, size=wx.DefaultSize, style=MB_STYLE_DEFAULT, name=wx.ButtonNameStr, start_color=(218,218,218), gradient_percent=15.0, highlight_color=(230,230,230), label_size=13, caption_size=11, button_margin=2, disable_after_click=0): ...
width=min_w,
width=txt_w,
def DoGetBestSize(self): """Calculate the best size of the button @return: wx.Size
self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnSelect, self) self.Bind(wx.EVT_LIST_ITEM_DESELECTED, self.OnDeSelect, self) self.Bind(wx.EVT_LEFT_DCLICK, self.OnDoubleClick, self) self.Bind(wx.EVT_CHAR, self.OnChar, self)
self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnSelect) self.Bind(wx.EVT_LIST_ITEM_DESELECTED, self.OnDeSelect) self.Bind(wx.EVT_LEFT_DCLICK, self.OnDoubleClick) self.Bind(wx.EVT_CHAR, self.OnChar)
def __init__ (self, *args, **kwds) : wx.ListCtrl.__init__(self, *args, **kwds) self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnSelect, self) self.Bind(wx.EVT_LIST_ITEM_DESELECTED, self.OnDeSelect, self) self.Bind(wx.EVT_LEFT_DCLICK, self.OnDoubleClick, self) self.Bind(wx.EVT_CHAR, self.OnChar, self) self._checklist = [] il...
y_label = 'P(Z>=z)',
y_label = 'P(Z<=z)',
def __init__(self, miller_array, d_star_sq_low_limit=None, d_star_sq_high_limit=None, d_hkl_for_l_test=None, normalise=True, ## If normalised is true, normalisation is done out=None, out_plots = None, verbose = 1, miller_calc=None, additional_parameters=None):
graph_labels=[("Z", "P(Z>=z)")],
graph_labels=[("Z", "P(Z<=z)")],
def __init__(self, miller_array, d_star_sq_low_limit=None, d_star_sq_high_limit=None, d_hkl_for_l_test=None, normalise=True, ## If normalised is true, normalisation is done out=None, out_plots = None, verbose = 1, miller_calc=None, additional_parameters=None):
self.process_range_selection(deselect=True)
return self.process_range_selection(deselect=True)
def process_range_deselection (self) : self.process_range_selection(deselect=True)
key = temp[1]+temp[2].upper()+temp[3]+temp[4].rstrip()
key = temp[1].upper()+temp[2].upper()+temp[3]+temp[4].rstrip()
def build_cbetadev_hash(pdb_hierarchy): cb = cbetadev() cbetadev_hash = dict() cbeta_out = cb.analyze_pdb(hierarchy=pdb_hierarchy) for line in cbeta_out[0].splitlines(): temp = line.split(':') dev = temp[5] if dev == "dev": continue #key = temp[3].lstrip()+temp[4].rstrip()+temp[1]+temp[2].upper() key = temp[1]+temp[2]....
best_info = None
def show_completeness(annotation): print "Completeness of %s map coefficients:" % annotation map_coeffs.setup_binner(auto_binning=True) if (map_coeffs.binner().n_bins_used() > 12): map_coeffs.setup_binner(n_bins=12) map_coeffs.completeness(use_binning=True).show(prefix=" ") print sys.stdout.flush()
return best_info.refined.f_final
if (best_info is not None): return best_info.refined.f_final return None
def show_completeness(annotation): print "Completeness of %s map coefficients:" % annotation map_coeffs.setup_binner(auto_binning=True) if (map_coeffs.binner().n_bins_used() > 12): map_coeffs.setup_binner(n_bins=12) map_coeffs.completeness(use_binning=True).show(prefix=" ") print sys.stdout.flush()
if 0: print self.gly .size() print self.pro .size() print self.prepro .size() print self.general .size() assert 0 def helper(self, phi, psi, val, sel): vmax = flex.max_default(val.select(sel),0) if(vmax==0): return None,None else: for x,y,z, s in zip(phi,psi,val,sel): if(s and abs(z-vmax)< 0.0001): return x,y...
def norm_to_max(self, data, val, sel, threshold=0.5):
def __init__(self): self.gly = None self.pro = None self.prepro = None self.general = None files = [ ["gly", "rama500-gly-sym.data"], ["pro", "rama500-pro.data"], ["prepro", "rama500-prepro.data"], ["general", "rama500-general.data"]] for rtf in files: rt,f = rtf file_name = libtbx.env.find_in_repositories( re...
return data.select(sel1) def thin_data(self, x, step = 5):
return data.select((sel1&sel)) def thin_data(self, x, step = 1):
def norm_to_max(self, data, val, sel, threshold=0.99): vmax = flex.max(val.select(sel)) sel1 = val > vmax*threshold return data.select(sel1)
s1=(phi>40)&(phi<80)& (psi>-5)&(psi<65) s2=(phi<-70)&(phi>-170)& (psi<-170)&(psi>-180) s3=(phi<-50)&(phi>-130)& (psi>-60)&(psi<40) s4=(phi<-50)&(phi>-180)& (psi>50)&(psi<180)
s0=(phi>0)&(phi< 180) & (psi< -5)&(psi>-180) s1=(phi>0)&(phi< 180) & (psi> -5)&(psi< 65) s2=(phi<0)&(phi>-180) & (psi<-100)&(psi>-180) s3=(phi<0)&(phi>-180) & (psi> -65)&(psi< 50) s4=(phi<0)&(phi>-180) & (psi> 50)&(psi< 180) s5=(phi<0)&(phi>-180) & (psi<-65)&(psi>-100) s6=(phi>0)&(phi< 180) & (psi>65)&(psi< 180) d0...
def normalize_general(self, data): phi, psi, val = self.split_array(data=data) s1=(phi>40)&(phi<80)& (psi>-5)&(psi<65) s2=(phi<-70)&(phi>-170)& (psi<-170)&(psi>-180) s3=(phi<-50)&(phi>-130)& (psi>-60)&(psi<40) s4=(phi<-50)&(phi>-180)& (psi>50)&(psi<180) d1 = self.norm_to_max(data=data, val=val, sel=s1) d2 = self.norm_t...
def normalize_prepro(self, data): phi, psi, val = self.split_array(data=data) s1=(phi<-50)&(phi>-70)& (psi<-20)&(psi>-65) s2=(phi<-40)&(phi>-180)& (psi> 50)&(psi<180) s3=(phi>40)&(phi<60)& (psi> 40)&(psi< 70) s6 =(phi<-60)&(phi>-180)& (psi<-170)&(psi>-180) d1 = self.norm_to_max(data=data, val=val, sel=s1) d2 = self.nor...
def normalize_prepro(self, data): phi, psi, val = self.split_array(data=data) s1=(phi<-50)&(phi>-70)& (psi<-20)&(psi>-65) s2=(phi<-40)&(phi>-180)& (psi> 50)&(psi<180) s3=(phi>40)&(phi<60)& (psi> 40)&(psi< 70) s6 =(phi<-60)&(phi>-180)& (psi<-170)&(psi>-180) d1 = self.norm_to_max(data=data, val=val, sel=s1) d2 = self.nor...
s1=(phi<-55)&(phi>-180)& (psi<-90)&(psi>-180) s2=(phi>40)&(phi<180)& (psi<-100)&(psi>-180) s3=(phi<-30)&(phi>-90)& (psi>-100)&(psi<60) s4=(phi>30)&(phi<90)& (psi>-100)&(psi<60) s5=(phi<-30)&(phi>-180)& (psi>90)&(psi<180) s6=(phi>55)&(phi<180)& (psi>90)&(psi<180)
s1=(phi<0)&(phi>-180)& (psi<-90)&(psi>-180) s2=(phi>0)&(phi<180) & (psi<-90)&(psi>-180) s3=(phi<0)&(phi>-180)& (psi>-90)&(psi<70) s4=(phi>0)&(phi<180) & (psi>-90)&(psi<70) s5=(phi<0)&(phi>-180)& (psi>70)&(psi<180) s6=(phi>0)&(phi<180) & (psi>70)&(psi<180)
def normalize_gly(self, data): phi, psi, val = self.split_array(data=data) s1=(phi<-55)&(phi>-180)& (psi<-90)&(psi>-180) s2=(phi>40)&(phi<180)& (psi<-100)&(psi>-180) s3=(phi<-30)&(phi>-90)& (psi>-100)&(psi<60) s4=(phi>30)&(phi<90)& (psi>-100)&(psi<60) s5=(phi<-30)&(phi>-180)& (psi>90)&(psi<180) s6=(phi>55)&(phi<180)& (...
weight = r[2],
weight = weight,
def restraints_residual_sum (self, sites_cart, proxies, gradient_array=None, unit_cell=None) : from scitbx.array_family import flex ramachandran_proxies = [] for proxy in proxies : if (proxy.restraint_type == "ramachandran") : ramachandran_proxies.append(proxy) if(self.params.type == "oldfield"): if(gradient_array is N...
"is too low. As twinning is however suspected, it is not immediuatly clear if this"
"is too low. As twinning is however suspected, it is not immediately clear if this"
def analyse_intensity_stats(self): if self.twin_results.maha_l >= self.maha_l_cut: if self.twin_results.l_mean < 0.5 : print >> self.twinning_verdict, \ "The results of the L-test indicate that the intensity statistics" print >> self.twinning_verdict, \ "are significantly different than is expected from good to reasona...
if str(e.__class__) == "<class 'Boost.Python.ArgumentError'>":
if str(e.__class__).find('Boost.Python.ArgumentError') >= 0:
def __call__(self, distribution, engine=mt19937): exceptions = [] for variate in self.variate_functions(): try: return variate(engine, distribution) except Exception, e: if str(e.__class__) == "<class 'Boost.Python.ArgumentError'>": exceptions.append(e) continue else: raise else: raise RuntimeError('\n'.join([ str(e) f...
mc_veclist += kin_vec(key_hash[atom_1], xyz_hash[atom_1], key_hash[atom_2], xyz_hash[atom_2])
if atom_1 == "C" and atom_2 == "N": pass elif atom_1 == "O3'" and atom_2 == "P": pass else: mc_veclist += kin_vec(key_hash[atom_1], xyz_hash[atom_1], key_hash[atom_2], xyz_hash[atom_2])
def get_kin_lots(chain, bond_hash, i_seq_name_hash, pdbID=None, index=0, show_hydrogen=True): mc_atoms = ["N", "CA", "C", "O", "OXT", "P", "OP1", "OP2", "OP3", "O5'", "C5'", "C4'", "O4'", "C1'", "C3'", "O3'", "C2'", "O2'"] mc_veclist = "" sc_veclist = "" mc_h_veclist = "" sc_h_veclist = "" ca_trace = "" virtual_bb = ""...
if hasattr(ijsco,"icy_shells"): self.icy_shells = getattr(ijsco, "icy_shells")
self.icy_shells = getattr(ijsco, "icy_shells", None)
def __init__ (self, params, xtriage_results) : self.file_name = params.scaling.input.xray_data.file_name self.log_file = params.scaling.input.parameters.reporting.log self.file_labels = params.scaling.input.xray_data.obs_labels self.nresidues = params.scaling.input.asu_contents.n_residues self.nbases = params.scaling.i...
if hasattr(ijsco,"message"): self.ice_comments = getattr(ijsco, "message")
self.ice_comments = getattr(ijsco, "message", "")
def __init__ (self, params, xtriage_results) : self.file_name = params.scaling.input.xray_data.file_name self.log_file = params.scaling.input.parameters.reporting.log self.file_labels = params.scaling.input.xray_data.obs_labels self.nresidues = params.scaling.input.asu_contents.n_residues self.nbases = params.scaling.i...
if self.log_p_obs_given_gamma(min_gamma) - max_log_p_obs < -10: break
def __init__(self, fo2, fc, scale_factor=None, outlier_cuttoff_factor=2): assert fo2.is_xray_intensity_array() assert fc.is_complex_array() assert not fo2.space_group().is_centric() if scale_factor is None: scale_factor = fo2.scale_factor(fc) fc2 = fc.as_intensity_array() self.delta_fc2 = fc2.anomalous_differences() se...
if self.log_p_obs_given_gamma(max_gamma) - max_log_p_obs < -10: break
def __init__(self, fo2, fc, scale_factor=None, outlier_cuttoff_factor=2): assert fo2.is_xray_intensity_array() assert fc.is_complex_array() assert not fo2.space_group().is_centric() if scale_factor is None: scale_factor = fo2.scale_factor(fc) fc2 = fc.as_intensity_array() self.delta_fc2 = fc2.anomalous_differences() se...
p_u_gamma_d_gamma = 0.5 * (p_u_gammas[-2] + p_u_gammas[-1]) * d_gamma G_numerator += gamma * p_u_gamma_d_gamma G_denominator += p_u_gamma_d_gamma
G_numerator += 0.5 * d_gamma * ( (gamma-d_gamma) * p_u_gammas[-2] + gamma * p_u_gammas[-1]) G_denominator += 0.5 * (p_u_gammas[-2] + p_u_gammas[-1]) * d_gamma
def __init__(self, fo2, fc, scale_factor=None, outlier_cuttoff_factor=2): assert fo2.is_xray_intensity_array() assert fc.is_complex_array() assert not fo2.space_group().is_centric() if scale_factor is None: scale_factor = fo2.scale_factor(fc) fc2 = fc.as_intensity_array() self.delta_fc2 = fc2.anomalous_differences() se...
p_u_gamma_d_gamma = 0.5 * (p_u_gammas[i-1] + p_u_gammas[i]) * d_gamma sigma_squared_G_numerator \ += math.pow((gamma - self.G), 2) * p_u_gamma_d_gamma
sigma_squared_G_numerator += 0.5 * (previous + next)
def __init__(self, fo2, fc, scale_factor=None, outlier_cuttoff_factor=2): assert fo2.is_xray_intensity_array() assert fc.is_complex_array() assert not fo2.space_group().is_centric() if scale_factor is None: scale_factor = fo2.scale_factor(fc) fc2 = fc.as_intensity_array() self.delta_fc2 = fc2.anomalous_differences() se...
print >> out, self.fit.show_summary() print >> out, "coefficient: %f" %self.correlation.coefficient()
print >> out, "y_intercept: %.3f" %self.fit.y_intercept() print >> out, "slope: %.3f" %self.fit.slope() print >> out, "coefficient: %.4f" %self.correlation.coefficient()
def show(self, out=None): if out is None: out=sys.stdout print >> out, self.fit.show_summary() print >> out, "coefficient: %f" %self.correlation.coefficient()
assert i_end < len(self.sequence) and i_start != i_end
assert i_end < len(self.sequence) and i_start <= i_end
def select_chars (self, i_start, i_end, box=True) : assert i_end < len(self.sequence) and i_start != i_end for i_seq in range(i_start, i_end + 1) : self.selected_residues[i_seq] = box self.update_frame()
if (x > x1 and x < x2) and (y > (y1 + 4) and y < (y2 - 4)) :
if (x > x1 and x < x2) and (y > y1 and y < y2) :
def is_on_region (self, x, y, regions) : for k, (i_start, i_end) in enumerate(regions) : bounds = self.get_region_bounds(i_start, i_end) for (x1, y1, x2, y2) in bounds : if (x > x1 and x < x2) and (y > (y1 + 4) and y < (y2 - 4)) : return k return None
self.deselect_chars(linker_start, linker_end)
self.deselect_chars(region_start, region_end)
def select_missing (self, x, y) : if not self.flag_allow_select_missing : return False idx = self.is_on_missing(x, y) if idx is not None : (region_start, region_end) = self.get_region_by_id('X', idx) if not idx in self.selected_missing : print "missing segment %d" % idx self.selected_missing.append(idx) self.select_cha...
def bind_events (self, view) :
def bind_events (self, frame, view) :
def bind_events (self, view) : self.Bind(wx.EVT_BUTTON, view.OnClear, self.clear_btn) self.Bind(wx.EVT_CHECKBOX, view.OnSetMode, self.multi_select_box) self.Bind(wx.EVT_BUTTON, view.OnHelp, self.help_btn)
cp.bind_events(self.panel)
cp.bind_events(self, self.panel)
def create_control_panel (self) : cp = control_panel(self, -1, style=wx.SIMPLE_BORDER) cp.bind_events(self.panel) self.sizer.Add(cp, 0, wx.EXPAND) self.control_panel = cp
self.SetSize((w+50, h+50))
self.SetSize((w+50, h+h2+50))
def set_sequence (self, seq) : self.panel.set_sequence(seq) self.panel.Layout() self.outer_panel.Layout() (w, h) = self.panel.DoGetBestSize() if w <= 750 and h <= 550 : self.outer_panel.SetMinSize((w,h)) self.SetSize((w+50, h+50)) else : self.SetSize((800,600))
chain_conf = hierarchy.models()[0].chains()[0].conformers()[0] helix_sele = sec_str.alpha_selection() sheet_sele = sec_str.beta_selection() seq = chain_conf.as_padded_sequence() ss = chain_conf.as_sec_str_sequence(helix_sele, sheet_sele) app = wx.App(0) frame = sequence_frame(None, -1, "Sequence display for %s" % os.pa...
frame.set_pdb_data(hierarchy, sec_str, auto_select=True)
def run (args) : from iotbx import file_reader from mmtbx import secondary_structure pdb_file = args[0] pdb_in = file_reader.any_file(pdb_file, force_type="pdb").file_object hierarchy = pdb_in.construct_hierarchy() hierarchy.atoms().reset_i_seq() xray_structure = pdb_in.xray_structure_simple() sec_str = secondary_struc...
assert not show_diff(lines, expected)
return show_diff(lines, expected)
def raise_not_found(): print "block_show_diff() lines:" print "-"*80 print "\n".join(lines) print "-"*80 raise AssertionError('Expected line not found: "%s"' % eline)
assert (db.get_atoms("AU", "WWT", True) == [('H61', 'O4'), ('N1', 'H3')]) assert (db.get_atoms("GC", "WWT", False) == [('O6', 'N4'), ('N1', 'N3'), ('N2', 'O2')]) assert db.get_pair_type("AU", [('H61', 'O4'), ('N1', 'H3')], True) == "WWT" assert db.get_pair_type("AU", [('N1', 'H3'), ('H61', 'O4')], True) == "WWT" assert...
import libtbx.load_env if libtbx.env.has_module("probe") and libtbx.env.has_module("reduce"): assert (db.get_atoms("AU", "WWT", True) == [('H61', 'O4'), ('N1', 'H3')]) assert (db.get_atoms("GC", "WWT", False) == [('O6', 'N4'), ('N1', 'N3'), ('N2', 'O2')]) assert db.get_pair_type("AU", [('H61', 'O4'), ('N1', 'H3')], Tru...
def exercise () : assert (db.get_atoms("AU", "WWT", True) == [('H61', 'O4'), ('N1', 'H3')]) assert (db.get_atoms("GC", "WWT", False) == [('O6', 'N4'), ('N1', 'N3'), ('N2', 'O2')]) assert db.get_pair_type("AU", [('H61', 'O4'), ('N1', 'H3')], True) == "WWT" assert db.get_pair_type("AU", [('N1', 'H3'), ('H61', 'O4')], Tru...
prof_scitbx = easy_profile(scitbx.math.svd.real,
prof_scitbx = easy_profile(scitbx.linalg.svd.real,
def time(self): from libtbx.easy_profile import easy_profile self.scitbx_report = [] self.tntbx_report = [] prof_scitbx = easy_profile(scitbx.math.svd.real, file_name='svd.py', func_name='__init__', line=None) if tntbx is not None: prof_tntbx = easy_profile(lambda m: tntbx.svd_m_ge_n_double(m), file_name='tst_svd.py', ...
reference_list.append(at.strip().upper())
atom = at.replace("*", "'") if atom.upper() == "O1P": atom = "OP1" elif atom.upper() == "O2P": atom = "OP2" reference_list.append(atom.strip().upper())
def eval_sidechain_completeness(pdb_hierarchy, mon_lib_srv=None, ignore_hydrogens=True, report_whole_res=False, return_ca_pos=False): missing_atom_list=[] if mon_lib_srv is None: mon_lib_srv = monomer_library.server.server() for model in pdb_hierarchy.models(): for chain in model.chains(): for residue_group in chain.re...
reference_list.append(non.atom_id.strip().upper())
atom = non.atom_id.replace("*", "'") if atom.upper() == "O1P": atom = "OP1" elif atom.upper() == "O2P": atom = "OP2" reference_list.append(atom.strip().upper())
def eval_sidechain_completeness(pdb_hierarchy, mon_lib_srv=None, ignore_hydrogens=True, report_whole_res=False, return_ca_pos=False): missing_atom_list=[] if mon_lib_srv is None: mon_lib_srv = monomer_library.server.server() for model in pdb_hierarchy.models(): for chain in model.chains(): for residue_group in chain.re...
d_max=array_params.d_max).resolution_filter(
d_max=array_params.d_max) if DEBUG : print " after array-specific filter: %.2f - %.2f" % ( new_array.d_max_min()) new_array = new_array.resolution_filter(
def __init__ (self, params, input_files=None, log=sys.stderr, accumulation_callback=None, symmetry_callback=None) : adopt_init_args(self, locals()) if len(params.mtz_file.miller_array) == 0 : raise Sorry("No Miller arrays have been selected for the output file.") elif len(params.mtz_file.miller_array) > 25 : raise Sorr...
assert map_type in ("Fo-Fc", "Fobs-Fmodel",
supported_types = ("Fo-Fc", "Fobs-Fmodel",
def map_coefficients(self, map_type = None, k = None, n = None, w1 = None, w2 = None, ): assert map_type in ("Fo-Fc", "Fobs-Fmodel", "2mFo-DFc", "2mFobs-DFmodel", "mFo-DFc", "mFobs-DFmodel", "gradient", "m_gradient" ) # this is to modify default behavoir of phenix.refine if (map_type == "mFo-D...
def map_coefficients(self, map_type=None):
def map_coefficients(self, map_type=None, acentrics_scale=None, centrics_pre_scale=None):
def map_coefficients(self, map_type=None): map_name_manager = mmtbx.map_names(map_name_string = map_type) k = map_name_manager.k n = map_name_manager.n map_coefficients = self.fmodel.map_coefficients( map_type = map_type, k = k, n = n, w1 = w1, w2 =...
if (file_name is None) : assert (file_param_name is not None)
if (file_name is None) and (file_param_name is not None) :
def get_file (self, file_name=None, file_param_name=None) : from iotbx import file_reader if (file_name is None) : assert (file_param_name is not None) file_name = self._param_files.get(file_param_name) if (isinstance(file_name, list)) : return file_name assert os.path.isfile(file_name) if (file_name in self._cached_in...
def unset_param_file (self, file_param_name) : self.set_param_file(file_name=None, file_param_name=file_param_name)
def unset_param_file (self, file_name, file_param_name, run_callback=True) : if (self.allow_multiple(file_param_name) and (file_param_name in self._param_files)) : param_files = self._param_files.get(file_param_name) if (file_name in param_files) : param_files.remove(file_name) if (len(param_files) == 0) : self._param_...
def unset_param_file (self, file_param_name) : self.set_param_file(file_name=None, file_param_name=file_param_name)
assert approx_equal(0.0039655104934522168,
assert approx_equal(0.0042632511984529199,
def exercise_geometry(): xs = quartz() uc = xs.unit_cell() flags = xs.scatterer_flags() for f in flags: f.set_grad_site(True) xs.set_scatterer_flags(flags) cov = flex.double((1e-8,1e-9,2e-9,3e-9,4e-9,5e-9, 2e-8,1e-9,2e-9,3e-9,4e-9, 3e-8,1e-9,2e-9,3e-9, 2e-8,1e-9,2e-9, 3e-8,1e-9, 4e-8)) cell_vcv = flex.double((3e-2,3e-2...
if (not self.f_calc_solutions and cc_peak_height < self.min_cc_peak_height): yield self.starting break
if cc_peak_height < self.min_cc_peak_height: break
def _evaluating(self, original_f_obs): while 1: attempts = 0 while attempts < self.max_attempts_to_get_sharp_correlation_map: attempts += 1 self.f_calc_solutions = [] for f_calc, shift, cc_peak_height\ in f_calc_symmetrisations(original_f_obs, self.flipping_iterator.f_calc, self.min_cc_peak_height): if (not self.f_calc...