bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def writearray(filename,a): file = open(filename, 'w') if len(a.shape) == 1: a = a[:, Numeric.NewAxis] for line in a: for element in line: file.write('%le ' % element) file.write('\n') file.close()
def writearray(filename,a): file = open(filename, 'w') if len(a.shape) == 1: a = a[:, Numeric.NewAxis] for line in a: for element in line: file.write('%le ' % element) file.write('\n') file.close()
6,400
def convertUnit(param,unitin,unitout,paramname=''): if unitout == unitin: return (param,unitin) if unitout == "Radian": if unitin == "Degree": return ((math.pi/180.0) * float(param),'Radian') elif unitin == "DMS": # space separated dms = map(float, param.split()) return ((math.pi/180.0) * (dms[0] + dms[1]/60.0 + dms[...
def convertUnit(param,unitin,unitout,paramname=''): if unitout == unitin: return (param,unitin) if unitout == "Radian": if unitin == "Degree": return ((math.pi/180.0) * float(param),'Radian') elif unitin == "DMS": # space separated dms = map(float, param.split()) return ((math.pi/180.0) * (dms[0] + dms[1]/60.0 + dms[...
6,401
def convertUnit(param,unitin,unitout,paramname=''): if unitout == unitin: return (param,unitin) if unitout == "Radian": if unitin == "Degree": return ((math.pi/180.0) * float(param),'Radian') elif unitin == "DMS": # space separated dms = map(float, param.split()) return ((math.pi/180.0) * (dms[0] + dms[1]/60.0 + dms[...
def convertUnit(param,unitin,unitout,paramname=''): if unitout == unitin: return (param,unitin) if unitout == "Radian": if unitin == "Degree": return ((math.pi/180.0) * float(param),'Radian') elif unitin == "DMS": # space separated dms = map(float, param.split()) return ((math.pi/180.0) * (dms[0] + dms[1]/60.0 + dms[...
6,402
def ex2ipr(e,x,s): eta = float(e) xi = float(x) sw = float(s) if sw > 0: raise NotImplementedError, "convertParameters(): LISA eta/xi configuration with sw > 0 not compatible with PseudoLISA" initpos = eta initrot = xi + initpos - 1.5*math.pi return ( (str(initpos),'Radian'), (str(initrot),'Radian') )
def ex2ipr(e,x,s): eta = float(e) xi = float(x) sw = float(s) if sw > 0: raise NotImplementedError, "convertParameters(): LISA eta/xi configuration with sw > 0 not compatible with PseudoLISA" initpos = eta initrot = xi + initpos - 1.5*math.pi return ( (str(initpos),'Radian'), (str(initrot),'Radian') )
6,403
def ex2ipr(e,x,s): eta = float(e) xi = float(x) sw = float(s) if sw > 0: raise NotImplementedError, "convertParameters(): LISA eta/xi configuration with sw > 0 not compatible with PseudoLISA" initpos = eta initrot = xi + initpos - 1.5*math.pi return ( (str(initpos),'Radian'), (str(initrot),'Radian') )
def ex2ipr(e,x,s): eta = float(e) xi = float(x) sw = float(s) if sw > 0: raise NotImplementedError, "convertParameters(): LISA eta/xi configuration with sw > 0 not compatible with PseudoLISA" initpos = eta initrot = xi + initpos - 1.5*math.pi return ( (str(initpos),'Radian'), (str(initrot),'Radian') )
6,404
def makeoptional(parlist): return map(lambda p: lambda s: p[0] in s or p,parlist)
def makeoptional(parlist): return map(lambda p: lambda s: p[0] in s or p,parlist)
6,405
def writeTimeSeries(self,TimeSeries): # write out the TimeSeries defined in TimeSeries self.opentag('XSIL',{'Type': 'TimeSeries', 'Name': TimeSeries.description})
def writeTimeSeries(self,TimeSeries): # write out the TimeSeries defined in TimeSeries self.opentag('XSIL',{'Type': 'TimeSeries', 'Name': TimeSeries.description})
6,406
def writeTimeSeries(self,TimeSeries): # write out the TimeSeries defined in TimeSeries self.opentag('XSIL',{'Type': 'TimeSeries', 'Name': TimeSeries.description})
def writeTimeSeries(self,TimeSeries): # write out the TimeSeries defined in TimeSeries self.opentag('XSIL',{'Type': 'TimeSeries', 'Name': TimeSeries.description})
6,407
def writeTimeSeries(self,TimeSeries): # write out the TimeSeries defined in TimeSeries self.opentag('XSIL',{'Type': 'TimeSeries', 'Name': TimeSeries.description})
def writeTimeSeries(self,TimeSeries): # write out the TimeSeries defined in TimeSeries self.opentag('XSIL',{'Type': 'TimeSeries', 'Name': TimeSeries.description})
6,408
def __init__(self,filename): p = pyRXP.Parser()
def __init__(self,filename): p = pyRXP.Parser()
6,409
def sn(signal,noise,stime,npatches): """Compute the optimal S/N for signal, sampled at intervals of stime, and for the total duration represented in the array, against noise represented by the time series noise; npatches overlapping periods are used to estimate the PSD of the noise.""" # compute signal spectrum withou...
def sn(signal,noise,stime,npatches): """Compute the optimal S/N for signal, sampled at intervals of stime, and for the total duration represented in the array, against noise represented by the time series noise; npatches overlapping periods are used to estimate the PSD of the noise.""" # compute signal spectrum withou...
6,410
def runswig(source,cppfile,pyfile,deps): if not os.path.isfile(cppfile) or not os.path.isfile(pyfile) \ or newer_group(deps,cppfile) or newer_group(deps,pyfile): try: spawn([swig_bin,'-w402','-c++','-python','-o',cppfile,source]) except: print 'Sorry, I am unable to swig the modified ' + lisasim_isource sys.exit(cmd)
def runswig(source,cppfile,pyfile,deps): if not os.path.isfile(cppfile) or not os.path.isfile(pyfile) \ or newer_group(deps,cppfile) or newer_group(deps,pyfile): try: spawn([swig_bin,'-w402','-c++','-python','-o',cppfile,source]) except: print 'Sorry, I am unable to swig the modified ' + lisasim_isource sys.exit(cmd)
6,411
def runswig(source,cppfile,pyfile,deps): if not os.path.isfile(cppfile) or not os.path.isfile(pyfile) \ or newer_group(deps,cppfile) or newer_group(deps,pyfile): try: spawn([swig_bin,'-w402','-c++','-python','-o',cppfile,source]) except: print 'Sorry, I am unable to swig the modified ' + lisasim_isource sys.exit(cmd)
def runswig(source,cppfile,pyfile,deps): if not os.path.isfile(cppfile) or not os.path.isfile(pyfile) \ or newer_group(deps,cppfile) or newer_group(deps,pyfile): try: spawn([swig_bin,'-w402','-c++','-python','-o',cppfile,source]) except: print 'Sorry, I am unable to swig the modified ' + lisasim_isource sys.exit(cmd)
6,412
def runswig(source,cppfile,pyfile,deps): if not os.path.isfile(cppfile) or not os.path.isfile(pyfile) \ or newer_group(deps,cppfile) or newer_group(deps,pyfile): try: spawn([swig_bin,'-w402','-c++','-python','-o',cppfile,source]) except: print 'Sorry, I am unable to swig the modified ' + lisasim_isource sys.exit(cmd)
def runswig(source,cppfile,pyfile,deps): if not os.path.isfile(cppfile) or not os.path.isfile(pyfile) \ or newer_group(deps,cppfile) or newer_group(deps,pyfile): try: spawn([swig_bin,'-w402','-c++','-python','-o',cppfile,source]) except: print 'Sorry, I am unable to swig the modified ' + lisasim_isource sys.exit(cmd)
6,413
def __getitem__(self, ip): offset = 0 fp = self.fp for part in ip.split('.'): start = offset+int(part)*4 fp.seek(start) value = fp.read(4) assert len(value)==4 if value[:2]=='\xFF\xFF': if value[2:]=='\x00\x00': raise KeyError(ip) else: return value[2:] offset = struct.unpack('!I', value)[0] raise RuntimeError('ip2cc d...
def __getitem__(self, ip): offset = 0 fp = self.fp for part in ip.split('.'): start = offset+int(part)*4 fp.seek(start) value = fp.read(4) assert len(value)==4 if value[:2]=='\xFF\xFF': if value[2:]=='\x00\x00': raise KeyError(ip) else: return value[2:] offset = struct.unpack('!I', value)[0] raise RuntimeError('ip2cc d...
6,414
def run_tlsmd(webtlsmdd, jdict): job_id = jdict["job_id"] tlsmd = jdict["tlsmd"] ## write the tlsmd execution command out to a file open("tlsmdcmd.txt", "w").write(" ".join(tlsmd) + '\n') pobj = subprocess.Popen(tlsmd, stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = subprocess.STDOUT, close_fds = True, b...
def run_tlsmd(webtlsmdd, jdict): job_id = jdict["job_id"] tlsmd = jdict["tlsmd"] ## write the tlsmd execution command out to a file open("tlsmdcmd.txt", "w").write(" ".join(tlsmd) + '\n') pobj = subprocess.Popen(tlsmd, stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = subprocess.STDOUT, close_fds = True, b...
6,415
def html_globals(self): """Output a HTML table displaying global TLSMD settings. """ if conf.globalconf.tls_model in ["ISOT", "NLISOT"]: tls_model = "Isotropic" elif conf.globalconf.tls_model in ["ANISO", "NLANISO"]: tls_model = "Anisotropic"
def html_globals(self): """Output a HTML table displaying global TLSMD settings. """ if conf.globalconf.tls_model in ["ISOT", "NLISOT"]: tls_model = "Isotropic" elif conf.globalconf.tls_model in ["ANISO", "NLANISO"]: tls_model = "Anisotropic"
6,416
def calc_itls_center_of_reaction(iT, iL, iS, origin): """iT is a single float; iL[3,3]; iS[3] """ ## construct TLS tensors from isotropic TLS description T0 = numpy.array([[iT, 0.0, 0.0], [0.0, iT, 0.0], [0.0, 0.0, iT]], float) L0 = iL.copy() S0 = numpy.array([ [ 0.0, 0.0, iS[1]], [iS[0], 0.0, 0.0], [ 0.0, ...
def calc_itls_center_of_reaction(iT, iL, iS, origin): """iT is a single float; iL[3,3]; iS[3] """ ## construct TLS tensors from isotropic TLS description T0 = numpy.array([[iT, 0.0, 0.0], [0.0, iT, 0.0], [0.0, 0.0, iT]], float) L0 = iL.copy() S0 = numpy.array([ [ 0.0, 0.0, iS[1]], [iS[0], 0.0, 0.0], [ 0.0, ...
6,417
def calc_itls_center_of_reaction(iT, iL, iS, origin): """iT is a single float; iL[3,3]; iS[3] """ ## construct TLS tensors from isotropic TLS description T0 = numpy.array([[iT, 0.0, 0.0], [0.0, iT, 0.0], [0.0, 0.0, iT]], float) L0 = iL.copy() S0 = numpy.array([ [ 0.0, 0.0, iS[1]], [iS[0], 0.0, 0.0], [ 0.0, ...
def calc_itls_center_of_reaction(iT, iL, iS, origin): """iT is a single float; iL[3,3]; iS[3] """ ## construct TLS tensors from isotropic TLS description T0 = numpy.array([[iT, 0.0, 0.0], [0.0, iT, 0.0], [0.0, 0.0, iT]], float) L0 = iL.copy() S0 = numpy.array([ [ 0.0, 0.0, iS[1]], [iS[0], 0.0, 0.0], [ 0.0, ...
6,418
def calc_itls_center_of_reaction(iT, iL, iS, origin): """iT is a single float; iL[3,3]; iS[3] """ ## construct TLS tensors from isotropic TLS description T0 = numpy.array([[iT, 0.0, 0.0], [0.0, iT, 0.0], [0.0, 0.0, iT]], float) L0 = iL.copy() S0 = numpy.array([ [ 0.0, 0.0, iS[1]], [iS[0], 0.0, 0.0], [ 0.0, ...
def calc_itls_center_of_reaction(iT, iL, iS, origin): """iT is a single float; iL[3,3]; iS[3] """ ## construct TLS tensors from isotropic TLS description T0 = numpy.array([[iT, 0.0, 0.0], [0.0, iT, 0.0], [0.0, 0.0, iT]], float) L0 = iL.copy() S0 = numpy.array([ [ 0.0, 0.0, iS[1]], [iS[0], 0.0, 0.0], [ 0.0, ...
6,419
def calc_itls_center_of_reaction(iT, iL, iS, origin): """iT is a single float; iL[3,3]; iS[3] """ ## construct TLS tensors from isotropic TLS description T0 = numpy.array([[iT, 0.0, 0.0], [0.0, iT, 0.0], [0.0, 0.0, iT]], float) L0 = iL.copy() S0 = numpy.array([ [ 0.0, 0.0, iS[1]], [iS[0], 0.0, 0.0], [ 0.0, ...
def calc_itls_center_of_reaction(iT, iL, iS, origin): """iT is a single float; iL[3,3]; iS[3] """ ## construct TLS tensors from isotropic TLS description T0 = numpy.array([[iT, 0.0, 0.0], [0.0, iT, 0.0], [0.0, 0.0, iT]], float) L0 = iL.copy() S0 = numpy.array([ [ 0.0, 0.0, iS[1]], [iS[0], 0.0, 0.0], [ 0.0, ...
6,420
def calc_itls_center_of_reaction(iT, iL, iS, origin): """iT is a single float; iL[3,3]; iS[3] """ ## construct TLS tensors from isotropic TLS description T0 = numpy.array([[iT, 0.0, 0.0], [0.0, iT, 0.0], [0.0, 0.0, iT]], float) L0 = iL.copy() S0 = numpy.array([ [ 0.0, 0.0, iS[1]], [iS[0], 0.0, 0.0], [ 0.0, ...
def calc_itls_center_of_reaction(iT, iL, iS, origin): """iT is a single float; iL[3,3]; iS[3] """ ## construct TLS tensors from isotropic TLS description T0 = numpy.array([[iT, 0.0, 0.0], [0.0, iT, 0.0], [0.0, 0.0, iT]], float) L0 = iL.copy() S0 = numpy.array([ [ 0.0, 0.0, iS[1]], [iS[0], 0.0, 0.0], [ 0.0, ...
6,421
def calc_itls_center_of_reaction(iT, iL, iS, origin): """iT is a single float; iL[3,3]; iS[3] """ ## construct TLS tensors from isotropic TLS description T0 = numpy.array([[iT, 0.0, 0.0], [0.0, iT, 0.0], [0.0, 0.0, iT]], float) L0 = iL.copy() S0 = numpy.array([ [ 0.0, 0.0, iS[1]], [iS[0], 0.0, 0.0], [ 0.0, ...
def calc_itls_center_of_reaction(iT, iL, iS, origin): """iT is a single float; iL[3,3]; iS[3] """ ## construct TLS tensors from isotropic TLS description T0 = numpy.array([[iT, 0.0, 0.0], [0.0, iT, 0.0], [0.0, 0.0, iT]], float) L0 = iL.copy() S0 = numpy.array([ [ 0.0, 0.0, iS[1]], [iS[0], 0.0, 0.0], [ 0.0, ...
6,422
def calc_TLS_center_of_reaction(T0, L0, S0, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center of Reaction...
def calc_TLS_center_of_reaction(T0, L0, S0, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center of Reaction...
6,423
def calc_TLS_center_of_reaction(T0, L0, S0, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center of Reaction...
def calc_TLS_center_of_reaction(T0, L0, S0, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center of Reaction...
6,424
def calc_TLS_center_of_reaction(T0, L0, S0, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center of Reaction...
def calc_TLS_center_of_reaction(T0, L0, S0, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center of Reaction...
6,425
def calc_TLS_center_of_reaction(T0, L0, S0, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center of Reaction...
def calc_TLS_center_of_reaction(T0, L0, S0, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center of Reaction...
6,426
def calc_TLS_center_of_reaction(T0, L0, S0, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center of Reaction...
def calc_TLS_center_of_reaction(T0, L0, S0, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center of Reaction...
6,427
def calc_TLS_center_of_reaction(T0, L0, S0, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center of Reaction...
def calc_TLS_center_of_reaction(T0, L0, S0, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center of Reaction...
6,428
def refmac5_prep(xyzin, tlsin_list, xyzout, tlsout): """Use TLS model + Uiso for each atom. Output xyzout with the residual Uiso only. """ os.umask(022) ## load structure struct = LoadStructure(fil = xyzin) ## load and construct TLS groups tls_group_list = [] for tlsin in tlsin_list: tls_file = TLSFile() tls_file.s...
def refmac5_prep(xyzin, tlsin_list, xyzout, tlsout): """Use TLS model + Uiso for each atom. Output xyzout with the residual Uiso only. """ os.umask(022) ## load structure struct = LoadStructure(fil = xyzin) ## load and construct TLS groups tls_group_list = [] for tlsin in tlsin_list: tls_desc_list = tls_file_format...
6,429
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
def calc_TLS_center_of_reaction(T0, L0, S0, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center of Reaction...
6,430
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
6,431
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
6,432
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
6,433
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
6,434
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
6,435
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
6,436
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
6,437
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
6,438
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
6,439
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
6,440
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
6,441
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
6,442
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
6,443
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
6,444
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
def calc_TLS_center_of_reaction(T_orig, L_orig, S_orig, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center...
6,445
def get_chain(self, chain_id): """Returns the Chain object matching the chain_id charactor. """ if not self.default_model: return None if self.default_model.chain_dict.has_key(chain_id): return self.default_model.chain_dict[chain_id] return None
def get_chain(self, chain_id): """Returns the Chain object matching the chain_id charactor. """ if self.default_model==None: return None if self.default_model.chain_dict.has_key(chain_id): return self.default_model.chain_dict[chain_id] return None
6,446
def add_bonds_from_covalent_distance(self): """Builds a Structure's bonds by atomic distance distance using the covalent radii in element.cif. A bond is built if the the distance between them is less than or equal to the sum of their covalent radii + 0.54A. """ for model in self.iter_models(): xyzdict = XYZDict(2.0) ...
def add_bonds_from_covalent_distance(self): """Builds a Structure's bonds by atomic distance distance using the covalent radii in element.cif. A bond is built if the the distance between them is less than or equal to the sum of their covalent radii + 0.54A. """ for model in self.iter_models(): xyzdict = XYZDict(2.0) ...
6,447
def add_chain(self, chain, delay_sort=False): """Adds a Chain to the Model. """ assert isinstance(chain, Chain)
def add_chain(self, chain, delay_sort=False): """Adds a Chain to the Model. """ assert isinstance(chain, Chain)
6,448
def iter_non_standard_residues(self): for frag in self.iter_fragments(): if not frag.is_standard_residue(): yield frag
def iter_non_standard_residues(self): for frag in self.iter_fragments(): if frag.is_standard_residue()==False: yield frag
6,449
def set_model_id(self, model_id): """Sets the model_id of all contained objects. """ assert type(model_id)==IntType
def set_model_id(self, model_id): """Sets the model_id of all contained objects. """ assert type(model_id)==IntType
6,450
def has_non_standard_residues(self): for frag in self.fragment_list: if not frag.is_standard_residue(): return True return False
def has_non_standard_residues(self): for frag in self.fragment_list: if frag.is_standard_residue()==False: return True return False
6,451
def count_non_standard_residues(self): n = 0 for frag in self.fragment_list: if not frag.is_standard_residue(): n += 1 return n
def count_non_standard_residues(self): n = 0 for frag in self.fragment_list: if frag.is_standard_residue()==False: n += 1 return n
6,452
def iter_non_standard_residues(self): for frag in self.fragment_list: if not frag.is_standard_residue(): yield frag
def iter_non_standard_residues(self): for frag in self.fragment_list: if frag.is_standard_residue()==False: yield frag
6,453
def add_atom(self, atom, delay_sort=False): """Adds a Atom. """ assert isinstance(atom, Atom) assert atom.model_id==self.model_id assert atom.chain_id==self.chain_id
def add_atom(self, atom, delay_sort=False): """Adds a Atom. """ assert isinstance(atom, Atom) assert atom.model_id==self.model_id assert atom.chain_id==self.chain_id
6,454
def add_atom(self, atom, delay_sort=False): """Adds a Atom. """ assert isinstance(atom, Atom) assert atom.model_id==self.model_id assert atom.chain_id==self.chain_id
def add_atom(self, atom, delay_sort=False): """Adds a Atom. """ assert isinstance(atom, Atom) assert atom.model_id==self.model_id assert atom.chain_id==self.chain_id
6,455
def remove_fragment(self, fragment): """Remove the Fragment from the Chain. """ Segment.remove_fragment(self, fragment) fragment.chain = None
def remove_fragment(self, fragment): """Remove the Fragment from the Chain. """ Segment.remove_fragment(self, fragment) fragment.chain = None
6,456
def set_chain_id(self, chain_id): """Sets a new ID for the Chain, updating the chain_id for all objects in the Structure hierarchy. """ ## check for conflicting chain_id in the structure if self.model!=None: chk_chain = self.model.get_chain(chain_id) if chk_chain!=None or chk_chain!=self: raise ChainOverwrite()
def set_chain_id(self, chain_id): """Sets a new ID for the Chain, updating the chain_id for all objects in the Structure hierarchy. """ ## check for conflicting chain_id in the structure if self.model!=None: chk_chain = self.model.get_chain(chain_id) if chk_chain!=None or chk_chain!=self: raise ChainOverwrite()
6,457
def __deepcopy__(self, memo): atom_cpy = Atom( name = copy.deepcopy(self.name), alt_loc = copy.deepcopy(self.alt_loc), res_name = copy.deepcopy(self.res_name), fragment_id = copy.deepcopy(self.fragment_id), chain_id = copy.deepcopy(self.chain_id), model_id = copy.deepcopy(sel...
def __deepcopy__(self, memo): atom_cpy = Atom( name = self.name, alt_loc = self.alt_loc, res_name = self.res_name, fragment_id = self.fragment_id, chain_id = self.chain_id, model_id = copy.copy(self.model_id), element = self.element, position = copy.deepcopy(se...
6,458
def __deepcopy__(self, memo): atom_cpy = Atom( name = copy.deepcopy(self.name), alt_loc = copy.deepcopy(self.alt_loc), res_name = copy.deepcopy(self.res_name), fragment_id = copy.deepcopy(self.fragment_id), chain_id = copy.deepcopy(self.chain_id), model_id = copy.deepcopy(sel...
def __deepcopy__(self, memo): atom_cpy = Atom( name = copy.deepcopy(self.name), alt_loc = copy.deepcopy(self.alt_loc), res_name = copy.deepcopy(self.res_name), fragment_id = copy.deepcopy(self.fragment_id), chain_id = copy.deepcopy(self.chain_id), model_id = copy.deepcopy(sel...
6,459
def __iter__(self): """Iterates over all Altloc representations of this Atom. """ if not self.altloc: yield self
def __iter__(self): """Iterates over all Altloc representations of this Atom. """ if self.altloc==None: yield self
6,460
def add_model(self, model, delay_sort=True): """Adds a Model to a Structure. Raises the ModelOverwrite exception if the model_id of the Model matches the model_id of a Model already in the Structure. If there are no Models in the Structure, the Model is used as the default Model. """ assert isinstance(model, Model)
def add_model(self, model, delay_sort=True): """Adds a Model to a Structure. Raises the ModelOverwrite exception if the model_id of the Model matches the model_id of a Model already in the Structure. If there are no Models in the Structure, the Model is used as the default Model. """ assert isinstance(model, Model)
6,461
def iter_alpha_helicies(self): """Iterates over all child AlphaHelix objects in the default Model. """ return self.default_model.iter_alpha_helicies()
def iter_alpha_helicies(self): """Iterates over all child AlphaHelix objects in the default Model. """ return self.default_model.iter_alpha_helicies()
6,462
def add_beta_sheet(self, beta_sheet): """ """ self.default_model.add_beta_sheet(beta_sheet)
def add_beta_sheet(self, beta_sheet): """Adds a BetaSheet to the default Model object. """ assert self.default_model!=None self.default_model.add_beta_sheet(beta_sheet)
6,463
def iter_beta_sheets(self): """Iterate over all beta sheets in the Structure. """ return self.default_model.iter_beta_sheets()
def iter_beta_sheets(self): """Iterate over all beta sheets in the Structure. """ return self.default_model.iter_beta_sheets()
6,464
def add_site(self, site): """ """ self.default_model.add_site(site)
def add_site(self, site): """Adds a Site object to the default Model. """ assert self.default_model!=None self.default_model.add_site(site)
6,465
def iter_sites(self): """Iterate over all active/important sites defined in the Structure. """ return self.default_model.iter_sites()
def iter_sites(self): """Iterate over all active/important sites defined in the Structure. """ return self.default_model.iter_sites()
6,466
def on_mouse_motion(self, event): if event.Dragging()==False: return
def on_mouse_motion(self, event): if event.Dragging()==False: return
6,467
def glv_redraw(self): self.Refresh(False)
def glv_redraw(self): self.Refresh(False)
6,468
def __init__(self, parent=None, id=-1, title='Title', pos=wx.DefaultPosition, size=(400, 200)): """Create a Frame instance. """ wx.Frame.__init__(self, parent, id, title, pos, size)
def __init__( self, parent = None, id = -1, title = 'Title', pos = wx.DefaultPosition, size = (400, 200)): wx.Frame.__init__(self, parent, id, title, pos, size)
6,469
def __init__(self, parent=None, id=-1, title='Title', pos=wx.DefaultPosition, size=(400, 200)): """Create a Frame instance. """ wx.Frame.__init__(self, parent, id, title, pos, size)
def __init__(self, parent=None, id=-1, title='Title', pos=wx.DefaultPosition, size=(400, 200)): """Create a Frame instance. """ wx.Frame.__init__(self, parent, id, title, pos, size)
6,470
def add_struct(self, struct): """Adds a structure to this viewer, and returns the GLStructure object so it can be manipulated. """ gl_struct = self.glviewer.glv.glv_add_struct(struct)
def add_struct(self, struct): """Adds a structure to this viewer, and returns the GLStructure object so it can be manipulated. """ gl_struct = self.glviewer.glv.glv_add_struct(struct)
6,471
def OnInit(self): self.frame = AppFrame() self.frame.Show() self.SetTopWindow(self.frame) return True
def OnInit(self): self.frame = ViewerFrame() self.frame.Show() self.SetTopWindow(self.frame) return True
6,472
def main(): app = App() app.MainLoop()
def main(files): app = ViewerApp() for file in files: app.frame.load_structure(file) app.MainLoop()
6,473
def main(): app = App() app.MainLoop()
def main(): app = App() app.MainLoop()
6,474
def gl_compile_list(self, execute = 0): if self.name != None: gl_delete_lists(self.name, 1) self.name = glGenLists(1)
def gl_compile_list(self, execute = 0): if self.name != None: self.gl_delete_list() self.name = glGenLists(1)
6,475
def gl_delete_list(self): if self.name != None: gl_delete_lists(self.name, 1) self.name = None
def gl_delete_list(self): if self.name != None: glDeleteLists(self.name, 1) self.name = None
6,476
def gl_call_list(self): #print "gl_call_list = ",self.name
def gl_call_list(self): #print "gl_call_list = ",self.name
6,477
def set_origin(self, origin): """Reset the origin of the draw list. """ self.origin = origin
def set_origin(self, origin): """Reset the origin of the draw list. """ self.origin = origin
6,478
def glr_construct_header(self): """Creates the header for the render program. """ tsz_width = 16 tsz_height = 16 xtiles = int(round(self.width / float(tsz_width))) ytiles = int(round(self.height / float(tsz_height)))
def glr_construct_header(self): """Creates the header for the render program. """ tsz_width = 16 tsz_height = 16 xtiles = int(round(self.width / float(tsz_width))) ytiles = int(round(self.height / float(tsz_height)))
6,479
def redirect_page(self, pdbid): # check to see if this job is still running try: os.chdir(conf.WEBTLSMDD_PDB_DIR + '/' + pdbid) except OSError: title = "This structure is currently being analyzed, please check back later." page = [self.html_head(title), html_title(title), self.html_foot()] return "".join(page)
def redirect_page(self, pdbid): # check to see if this job is still running try: os.chdir(conf.WEBTLSMDD_PDB_DIR + '/' + pdbid) except OSError: title = "This structure is currently being analyzed, please check back later." page = [self.html_head(title), html_title(title), self.html_foot()] return "".join(page)
6,480
def refmac5_prep(pdbin, tlsins, pdbout, tlsout): os.umask(022) ## load input structure struct = LoadStructure(fil = pdbin) ## load input TLS description tls_file = TLSFile() tls_file.set_file_format(TLSFileFormatTLSOUT()) for tlsin in tlsins: fil = open(tlsin, "r") listx = tls_file.file_format.load(fil) tls_file.tls_...
def refmac5_prep(xyzin, tlsin, xyzout, tlsout): """Use TLS model + Uiso for each atom. Output xyzout with the residual Uiso only. """ os.umask(022) ## load input structure struct = LoadStructure(fil = pdbin) ## load input TLS description tls_file = TLSFile() tls_file.set_file_format(TLSFileFormatTLSOUT()) for tlsin ...
6,481
def refmac5_prep(pdbin, tlsins, pdbout, tlsout): os.umask(022) ## load input structure struct = LoadStructure(fil = pdbin) ## load input TLS description tls_file = TLSFile() tls_file.set_file_format(TLSFileFormatTLSOUT()) for tlsin in tlsins: fil = open(tlsin, "r") listx = tls_file.file_format.load(fil) tls_file.tls_...
def refmac5_prep(pdbin, tlsins, pdbout, tlsout): os.umask(022) ## load input structure struct = LoadStructure(fil = pdbin) ## load input TLS description tls_file = TLSFile() tls_file.set_file_format(TLSFileFormatTLSOUT()) for tlsin in tlsins: fil = open(tlsin, "r") listx = tls_file.file_format.load(fil) tls_file.tls_...
6,482
def refmac5_prep(pdbin, tlsins, pdbout, tlsout): os.umask(022) ## load input structure struct = LoadStructure(fil = pdbin) ## load input TLS description tls_file = TLSFile() tls_file.set_file_format(TLSFileFormatTLSOUT()) for tlsin in tlsins: fil = open(tlsin, "r") listx = tls_file.file_format.load(fil) tls_file.tls_...
def refmac5_prep(pdbin, tlsins, pdbout, tlsout): os.umask(022) ## load input structure struct = LoadStructure(fil = pdbin) ## load input TLS description tls_file = TLSFile() tls_file.set_file_format(TLSFileFormatTLSOUT()) for tlsin in tlsins: fil = open(tlsin, "r") listx = tls_file.file_format.load(fil) tls_file.tls_...
6,483
def refmac5_prep(pdbin, tlsins, pdbout, tlsout): os.umask(022) ## load input structure struct = LoadStructure(fil = pdbin) ## load input TLS description tls_file = TLSFile() tls_file.set_file_format(TLSFileFormatTLSOUT()) for tlsin in tlsins: fil = open(tlsin, "r") listx = tls_file.file_format.load(fil) tls_file.tls_...
def refmac5_prep(pdbin, tlsins, pdbout, tlsout): os.umask(022) ## load input structure struct = LoadStructure(fil = pdbin) ## load input TLS description tls_file = TLSFile() tls_file.set_file_format(TLSFileFormatTLSOUT()) for tlsin in tlsins: fil = open(tlsin, "r") listx = tls_file.file_format.load(fil) tls_file.tls_de...
6,484
def refmac5_prep(pdbin, tlsins, pdbout, tlsout): os.umask(022) ## load input structure struct = LoadStructure(fil = pdbin) ## load input TLS description tls_file = TLSFile() tls_file.set_file_format(TLSFileFormatTLSOUT()) for tlsin in tlsins: fil = open(tlsin, "r") listx = tls_file.file_format.load(fil) tls_file.tls_...
def refmac5_prep(pdbin, tlsins, pdbout, tlsout): os.umask(022) ## load input structure struct = LoadStructure(fil = pdbin) ## load input TLS description tls_file = TLSFile() tls_file.set_file_format(TLSFileFormatTLSOUT()) for tlsin in tlsins: fil = open(tlsin, "r") listx = tls_file.file_format.load(fil) tls_file.tls_...
6,485
def html_chain_alignment_plot(self, chain): """generate a plot comparing all segmentations """ plot = sequence_plot.TLSSegmentAlignmentPlot() for ntls, cpartition in chain.partition_collection.iter_ntls_chain_partitions(): plot.add_tls_segmentation(cpartition)
def html_chain_alignment_plot(self, chain): """generate a plot comparing all segmentations """ plot = sequence_plot.TLSSegmentAlignmentPlot() for ntls, cpartition in chain.partition_collection.iter_ntls_chain_partitions(): plot.add_tls_segmentation(cpartition)
6,486
def dmatrix(alpha, beta, gamma): """Returns the displacment matrix based on rotation about Euler angles alpha, beta, and gamma. """ return rmatrix(alpha, beta, gamma) - identity(3, Float)
def dmatrix(alpha, beta, gamma): """Returns the displacement matrix based on rotation about Euler angles alpha, beta, and gamma. """ return rmatrix(alpha, beta, gamma) - identity(3, Float)
6,487
def __init__(self): self.visible = True self.width = 0 self.height = 0 self.zplane = 500.0
def __init__(self): self.visible = True self.width = 0 self.height = 0 self.zplane = 500.0
6,488
def __init__(self): self.visible = True self.width = 0 self.height = 0 self.zplane = 500.0
def __init__(self): self.visible = True self.width = 0 self.height = 0 self.zplane = 500.0
6,489
def keypress(self, key): if key=='\r': self.lines.insert(0, "# ") else: self.lines[0] += key
def keypress(self, key): if key=='\r': self.lines.insert(0, "# ") else: self.lines[0] += key
6,490
def opengl_render(self): ## setup perspective matrix
defopengl_render(self):##setupperspectivematrix
6,491
def opengl_render(self): ## setup perspective matrix
def opengl_render(self): ## setup perspective matrix
6,492
def opengl_render(self): ## setup perspective matrix
def opengl_render(self): ## setup perspective matrix
6,493
def opengl_render(self): ## setup perspective matrix
def opengl_render(self): ## setup perspective matrix
6,494
def opengl_set_material_rgba(self, r, g, b, a): """Creates a stock rendering material colored according to the given RGB values. """ glColor3f(r, g, b)
def opengl_set_material_rgba(self, r, g, b, a): """Creates a stock rendering material colored according to the given RGB values. """ glColor3f(r, g, b)
6,495
def load_struct(self, path): """Loads the requested structure. """ info("loading: %s" % (path)) try: struct = LoadStructure( fil = path, build_properties = ("library_bonds","distance_bonds")) except IOError: error("file not found: %s" % (path)) return
def load_struct(self, path): """Loads the requested structure. """ info("loading: %s" % (path)) try: struct = LoadStructure( fil = path, build_properties = ("library_bonds","distance_bonds")) except IOError: error("file not found: %s" % (path)) return
6,496
def calc_CA_pivot_TLS_least_squares_fit(segment, weight_dict=None): """Perform a LSQ-TLS fit on the given Segment object using the TLS model with amino acid side chains which can pivot about the CA atom. This model uses 20 TLS parameters and 6 libration parameters per side chain. """ ## calculate the number of paramet...
def calc_CA_pivot_TLS_least_squares_fit(segment, weight_dict=None): """Perform a LSQ-TLS fit on the given Segment object using the TLS model with amino acid side chains which can pivot about the CA atom. This model uses 20 TLS parameters and 6 libration parameters per side chain. """ ## calculate the number of paramet...
6,497
def calc_CA_pivot_TLS_least_squares_fit(segment, weight_dict=None): """Perform a LSQ-TLS fit on the given Segment object using the TLS model with amino acid side chains which can pivot about the CA atom. This model uses 20 TLS parameters and 6 libration parameters per side chain. """ ## calculate the number of paramet...
def calc_CA_pivot_TLS_least_squares_fit(segment, weight_dict=None): """Perform a LSQ-TLS fit on the given Segment object using the TLS model with amino acid side chains which can pivot about the CA atom. This model uses 20 TLS parameters and 6 libration parameters per side chain. """ ## calculate the number of paramet...
6,498
def draw_fan(self): """Draws a fan from the TLS group center of reaction to the TLS group backbone atoms. """ COR = self.properties["COR"] r, g, b = self.gldl_property_color_rgbf("tls_color") a = self.properties["fan_opacity"]
def self.driver.glr_lighting_enable() draw_fan(self): self.driver.glr_lighting_enable() """Draws self.driver.glr_lighting_enable() a self.driver.glr_lighting_enable() fan self.driver.glr_lighting_enable() from self.driver.glr_lighting_enable() the self.driver.glr_lighting_enable() TLS self.driver.glr_lighting_enable() ...
6,499