hexsha
stringlengths
40
40
repo
stringlengths
7
114
path
stringlengths
4
124
license
listlengths
1
9
language
stringclasses
1 value
identifier
stringlengths
1
71
return_type
stringlengths
1
749
⌀
original_string
stringlengths
76
22.7k
original_docstring
stringlengths
16
7.61k
docstring
stringlengths
16
2.47k
docstring_tokens
listlengths
6
477
code
stringlengths
14
10.2k
code_tokens
listlengths
6
996
short_docstring
stringlengths
2
644
short_docstring_tokens
listlengths
1
116
comment
listlengths
1
89
parameters
listlengths
0
64
docstring_params
dict
6a8c35082cc2a132e84b5340e4eba0be3260bf79
shambo001/peat
PEATDB/Ekin/Base.py
[ "MIT" ]
Python
_getlineColor
<not_specific>
def _getlineColor(self, line): """Private method - get a lines' color""" clr = '#cccccc' try: clr = line.get_color() except: i=0 while clr == '#cccccc': clr = tuple(line.get_facecolor()[i][:3]) clr = matplotlib.colors.rg...
Private method - get a lines' color
Private method - get a lines' color
[ "Private", "method", "-", "get", "a", "lines", "'", "color" ]
def _getlineColor(self, line): clr = '#cccccc' try: clr = line.get_color() except: i=0 while clr == '#cccccc': clr = tuple(line.get_facecolor()[i][:3]) clr = matplotlib.colors.rgb2hex(clr) i+=1 return clr
[ "def", "_getlineColor", "(", "self", ",", "line", ")", ":", "clr", "=", "'#cccccc'", "try", ":", "clr", "=", "line", ".", "get_color", "(", ")", "except", ":", "i", "=", "0", "while", "clr", "==", "'#cccccc'", ":", "clr", "=", "tuple", "(", "line",...
Private method - get a lines' color
[ "Private", "method", "-", "get", "a", "lines", "'", "color" ]
[ "\"\"\"Private method - get a lines' color\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "line", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "line", "type": null, "docstring": null, "docstring_tokens": [...
6a8c35082cc2a132e84b5340e4eba0be3260bf79
shambo001/peat
PEATDB/Ekin/Base.py
[ "MIT" ]
Python
showfitResults
<not_specific>
def showfitResults(self, X, ax): """Show fit vars in a plot""" if X==None: return info = X.getResult() text='' bboxprops = {'facecolor':'lightyellow', 'alpha':0.9, 'pad':10, 'lw':1} for i in X.varnames: text += i+'='+str(round(info[i],3))+'\n' ...
Show fit vars in a plot
Show fit vars in a plot
[ "Show", "fit", "vars", "in", "a", "plot" ]
def showfitResults(self, X, ax): if X==None: return info = X.getResult() text='' bboxprops = {'facecolor':'lightyellow', 'alpha':0.9, 'pad':10, 'lw':1} for i in X.varnames: text += i+'='+str(round(info[i],3))+'\n' text += 'sse='+str(round(info['err...
[ "def", "showfitResults", "(", "self", ",", "X", ",", "ax", ")", ":", "if", "X", "==", "None", ":", "return", "info", "=", "X", ".", "getResult", "(", ")", "text", "=", "''", "bboxprops", "=", "{", "'facecolor'", ":", "'lightyellow'", ",", "'alpha'", ...
Show fit vars in a plot
[ "Show", "fit", "vars", "in", "a", "plot" ]
[ "\"\"\"Show fit vars in a plot\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "X", "type": null }, { "param": "ax", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "X", "type": null, "docstring": null, "docstring_tokens": [], ...
6a8c35082cc2a132e84b5340e4eba0be3260bf79
shambo001/peat
PEATDB/Ekin/Base.py
[ "MIT" ]
Python
checkDatasetParam
<not_specific>
def checkDatasetParam(self, datasets): """Check dataset parameter to see if it's a list or not, allows methods to be called with dataset as a string or list""" if datasets=='ALL': return self.datasets else: import types if type(datasets) is types.St...
Check dataset parameter to see if it's a list or not, allows methods to be called with dataset as a string or list
Check dataset parameter to see if it's a list or not, allows methods to be called with dataset as a string or list
[ "Check", "dataset", "parameter", "to", "see", "if", "it", "'", "s", "a", "list", "or", "not", "allows", "methods", "to", "be", "called", "with", "dataset", "as", "a", "string", "or", "list" ]
def checkDatasetParam(self, datasets): if datasets=='ALL': return self.datasets else: import types if type(datasets) is types.StringType: s=datasets datasets=[] datasets.append(s) return datasets ...
[ "def", "checkDatasetParam", "(", "self", ",", "datasets", ")", ":", "if", "datasets", "==", "'ALL'", ":", "return", "self", ".", "datasets", "else", ":", "import", "types", "if", "type", "(", "datasets", ")", "is", "types", ".", "StringType", ":", "s", ...
Check dataset parameter to see if it's a list or not, allows methods to be called with dataset as a string or list
[ "Check", "dataset", "parameter", "to", "see", "if", "it", "'", "s", "a", "list", "or", "not", "allows", "methods", "to", "be", "called", "with", "dataset", "as", "a", "string", "or", "list" ]
[ "\"\"\"Check dataset parameter to see if it's a list or not, allows\n methods to be called with dataset as a string or list\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "datasets", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "datasets", "type": null, "docstring": null, "docstring_tokens...
6a8c35082cc2a132e84b5340e4eba0be3260bf79
shambo001/peat
PEATDB/Ekin/Base.py
[ "MIT" ]
Python
addProject
<not_specific>
def addProject(self, E, overwrite=False, label=''): """Combine another project with the current one, duplicates are renamed""" for d in E.datasets: edata = copy.deepcopy(E.getDataset(d)) fitdata = E.getFitData(d) if label != '': d = str(d)+'_'+str(lab...
Combine another project with the current one, duplicates are renamed
Combine another project with the current one, duplicates are renamed
[ "Combine", "another", "project", "with", "the", "current", "one", "duplicates", "are", "renamed" ]
def addProject(self, E, overwrite=False, label=''): for d in E.datasets: edata = copy.deepcopy(E.getDataset(d)) fitdata = E.getFitData(d) if label != '': d = str(d)+'_'+str(label) if d in self.datasets: name = str(d) + '_a' ...
[ "def", "addProject", "(", "self", ",", "E", ",", "overwrite", "=", "False", ",", "label", "=", "''", ")", ":", "for", "d", "in", "E", ".", "datasets", ":", "edata", "=", "copy", ".", "deepcopy", "(", "E", ".", "getDataset", "(", "d", ")", ")", ...
Combine another project with the current one, duplicates are renamed
[ "Combine", "another", "project", "with", "the", "current", "one", "duplicates", "are", "renamed" ]
[ "\"\"\"Combine another project with the current one, duplicates are renamed\"\"\"", "#if E.__dict__.has_key(field):", "# print field, type(E.__dict__[field]), E.__dict__[field][name]" ]
[ { "param": "self", "type": null }, { "param": "E", "type": null }, { "param": "overwrite", "type": null }, { "param": "label", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "E", "type": null, "docstring": null, "docstring_tokens": [], ...
6a8c35082cc2a132e84b5340e4eba0be3260bf79
shambo001/peat
PEATDB/Ekin/Base.py
[ "MIT" ]
Python
exportDatasets
<not_specific>
def exportDatasets(self, filename=None, format=None, append=False): """Export all datasets as csv formatted as x-y columns per dataset """ if filename == None: return if os.path.splitext(filename) != '.csv': filename = os.path.splitext(filename)[0]+'.csv' if...
Export all datasets as csv formatted as x-y columns per dataset
Export all datasets as csv formatted as x-y columns per dataset
[ "Export", "all", "datasets", "as", "csv", "formatted", "as", "x", "-", "y", "columns", "per", "dataset" ]
def exportDatasets(self, filename=None, format=None, append=False): if filename == None: return if os.path.splitext(filename) != '.csv': filename = os.path.splitext(filename)[0]+'.csv' if append==True: f=open(filename,'a') else: f=open(filename,'wb...
[ "def", "exportDatasets", "(", "self", ",", "filename", "=", "None", ",", "format", "=", "None", ",", "append", "=", "False", ")", ":", "if", "filename", "==", "None", ":", "return", "if", "os", ".", "path", ".", "splitext", "(", "filename", ")", "!="...
Export all datasets as csv formatted as x-y columns per dataset
[ "Export", "all", "datasets", "as", "csv", "formatted", "as", "x", "-", "y", "columns", "per", "dataset" ]
[ "\"\"\"Export all datasets as csv\n formatted as x-y columns per dataset \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "filename", "type": null }, { "param": "format", "type": null }, { "param": "append", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "filename", "type": null, "docstring": null, "docstring_tokens...
6a8c764d63559819be0fa35fb23694c16aa57bd2
shambo001/peat
PEATDB/scripts/multiProjects.py
[ "MIT" ]
Python
PEATSAJobs
<not_specific>
def PEATSAJobs(prjs, resubmit=False): """Submit PEATSA runs for all projects or merge results if done""" for name in prjs: print name DB = PDatabase(local=os.path.join(savepath,name)) pdb = DB['wt'].Structure PS = PEATSAPlugin() PS.main(DB=DB) if hasattr(DB.meta,'...
Submit PEATSA runs for all projects or merge results if done
Submit PEATSA runs for all projects or merge results if done
[ "Submit", "PEATSA", "runs", "for", "all", "projects", "or", "merge", "results", "if", "done" ]
def PEATSAJobs(prjs, resubmit=False): for name in prjs: print name DB = PDatabase(local=os.path.join(savepath,name)) pdb = DB['wt'].Structure PS = PEATSAPlugin() PS.main(DB=DB) if hasattr(DB.meta,'peatsa_jobs') and resubmit == False: if 'mycalc' in DB.meta...
[ "def", "PEATSAJobs", "(", "prjs", ",", "resubmit", "=", "False", ")", ":", "for", "name", "in", "prjs", ":", "print", "name", "DB", "=", "PDatabase", "(", "local", "=", "os", ".", "path", ".", "join", "(", "savepath", ",", "name", ")", ")", "pdb", ...
Submit PEATSA runs for all projects or merge results if done
[ "Submit", "PEATSA", "runs", "for", "all", "projects", "or", "merge", "results", "if", "done" ]
[ "\"\"\"Submit PEATSA runs for all projects or merge results if done\"\"\"", "#try to merge results", "#print mutlist", "#we add source project data so exp data can be read from summary", "#required to end process" ]
[ { "param": "prjs", "type": null }, { "param": "resubmit", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "prjs", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "resubmit", "type": null, "docstring": null, "docstring_tokens...
6a8c764d63559819be0fa35fb23694c16aa57bd2
shambo001/peat
PEATDB/scripts/multiProjects.py
[ "MIT" ]
Python
createProjects
<not_specific>
def createProjects(files): """Create multiple projects at once from csv files""" for filename in files: print filename name = os.path.splitext(filename)[0] #create/open db DB = PDatabase(local=os.path.join(savepath,name)) DB.add('wt') #add wt pdb stream =...
Create multiple projects at once from csv files
Create multiple projects at once from csv files
[ "Create", "multiple", "projects", "at", "once", "from", "csv", "files" ]
def createProjects(files): for filename in files: print filename name = os.path.splitext(filename)[0] DB = PDatabase(local=os.path.join(savepath,name)) DB.add('wt') stream = DBActions.fetchPDB(name) DBActions.addPDBFile(DB, 'wt', pdbdata=stream, pdbname=name, gui=Fals...
[ "def", "createProjects", "(", "files", ")", ":", "for", "filename", "in", "files", ":", "print", "filename", "name", "=", "os", ".", "path", ".", "splitext", "(", "filename", ")", "[", "0", "]", "DB", "=", "PDatabase", "(", "local", "=", "os", ".", ...
Create multiple projects at once from csv files
[ "Create", "multiple", "projects", "at", "once", "from", "csv", "files" ]
[ "\"\"\"Create multiple projects at once from csv files\"\"\"", "#create/open db", "#add wt pdb", "#import data from csv" ]
[ { "param": "files", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "files", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
6a8c764d63559819be0fa35fb23694c16aa57bd2
shambo001/peat
PEATDB/scripts/multiProjects.py
[ "MIT" ]
Python
info
<not_specific>
def info(projects): """Just return info in current projects""" total=0 summDB = PDatabase(local='summary.fs') for p in projects: DB = PDatabase(local=os.path.join(savepath,p)) l = DB.length() total += l print '%s has %s records' %(p,l) if p not in summ...
Just return info in current projects
Just return info in current projects
[ "Just", "return", "info", "in", "current", "projects" ]
def info(projects): total=0 summDB = PDatabase(local='summary.fs') for p in projects: DB = PDatabase(local=os.path.join(savepath,p)) l = DB.length() total += l print '%s has %s records' %(p,l) if p not in summDB.getRecs(): print 'not present in sum...
[ "def", "info", "(", "projects", ")", ":", "total", "=", "0", "summDB", "=", "PDatabase", "(", "local", "=", "'summary.fs'", ")", "for", "p", "in", "projects", ":", "DB", "=", "PDatabase", "(", "local", "=", "os", ".", "path", ".", "join", "(", "sav...
Just return info in current projects
[ "Just", "return", "info", "in", "current", "projects" ]
[ "\"\"\"Just return info in current projects\"\"\"" ]
[ { "param": "projects", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "projects", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
6a8c764d63559819be0fa35fb23694c16aa57bd2
shambo001/peat
PEATDB/scripts/multiProjects.py
[ "MIT" ]
Python
send2Server
<not_specific>
def send2Server(projects): """Send all projects to remote versions""" settings={'server':'enzyme.ucd.ie','username':'guest', 'password':'123','port':8080} adminsettings={'host':'enzyme.ucd.ie','user':'peatadmin', 'passwd':'nielsen','port':8080} '''for p in projects: ...
Send all projects to remote versions
Send all projects to remote versions
[ "Send", "all", "projects", "to", "remote", "versions" ]
def send2Server(projects): settings={'server':'enzyme.ucd.ie','username':'guest', 'password':'123','port':8080} adminsettings={'host':'enzyme.ucd.ie','user':'peatadmin', 'passwd':'nielsen','port':8080} DB = PDatabase(local='summary.fs') Utils.copyDBtoServer(DB,'PotapovD...
[ "def", "send2Server", "(", "projects", ")", ":", "settings", "=", "{", "'server'", ":", "'enzyme.ucd.ie'", ",", "'username'", ":", "'guest'", ",", "'password'", ":", "'123'", ",", "'port'", ":", "8080", "}", "adminsettings", "=", "{", "'host'", ":", "'enzy...
Send all projects to remote versions
[ "Send", "all", "projects", "to", "remote", "versions" ]
[ "\"\"\"Send all projects to remote versions\"\"\"", "'''for p in projects:\n print p\n DB = PDatabase(local=os.path.join(savepath,p))\n Utils.createDBonServer(prj=p,settings=adminsettings,\n access='guest')\n Utils.copyDBtoServer(DB,p,settings)'''" ]
[ { "param": "projects", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "projects", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
190978c408b11631c08d72d65557d804714c0a92
shambo001/peat
PEATDB/Ekin/ExpConditions.py
[ "MIT" ]
Python
Load_File
<not_specific>
def Load_File(self): """Load the exp protocol from a file and dump the text in a list to be stored""" import tkFileDialog, os self.protocol = tkFileDialog.askopenfile(mode='r',filetypes= [("all files", "*")], title="Choose A File") if self.protocol == None: return im...
Load the exp protocol from a file and dump the text in a list to be stored
Load the exp protocol from a file and dump the text in a list to be stored
[ "Load", "the", "exp", "protocol", "from", "a", "file", "and", "dump", "the", "text", "in", "a", "list", "to", "be", "stored" ]
def Load_File(self): import tkFileDialog, os self.protocol = tkFileDialog.askopenfile(mode='r',filetypes= [("all files", "*")], title="Choose A File") if self.protocol == None: return import fileinput self.protocol_textdump=[] self.fileShow.delete(0, END) ...
[ "def", "Load_File", "(", "self", ")", ":", "import", "tkFileDialog", ",", "os", "self", ".", "protocol", "=", "tkFileDialog", ".", "askopenfile", "(", "mode", "=", "'r'", ",", "filetypes", "=", "[", "(", "\"all files\"", ",", "\"*\"", ")", "]", ",", "t...
Load the exp protocol from a file and dump the text in a list to be stored
[ "Load", "the", "exp", "protocol", "from", "a", "file", "and", "dump", "the", "text", "in", "a", "list", "to", "be", "stored" ]
[ "\"\"\"Load the exp protocol from a file and dump the text in a list to be stored\"\"\"", "#print 'appending',line" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
190978c408b11631c08d72d65557d804714c0a92
shambo001/peat
PEATDB/Ekin/ExpConditions.py
[ "MIT" ]
Python
Show_File
<not_specific>
def Show_File(self): '''Show contents of the protocol data in text window''' import textFrame self.text_frame=textFrame.textFrame(self) try: #self.text_frame.load_text(self.fileShow.get()) self.text_frame.load_text(self.protocol_textdump) except: ...
Show contents of the protocol data in text window
Show contents of the protocol data in text window
[ "Show", "contents", "of", "the", "protocol", "data", "in", "text", "window" ]
def Show_File(self): import textFrame self.text_frame=textFrame.textFrame(self) try: self.text_frame.load_text(self.protocol_textdump) except: import tkMessageBox tkMessageBox.showwarning('No file selected', 'Please...
[ "def", "Show_File", "(", "self", ")", ":", "import", "textFrame", "self", ".", "text_frame", "=", "textFrame", ".", "textFrame", "(", "self", ")", "try", ":", "self", ".", "text_frame", ".", "load_text", "(", "self", ".", "protocol_textdump", ")", "except"...
Show contents of the protocol data in text window
[ "Show", "contents", "of", "the", "protocol", "data", "in", "text", "window" ]
[ "'''Show contents of the protocol data in text window'''", "#self.text_frame.load_text(self.fileShow.get())" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
fde81720862e6ae7090972c20a26ccbbca43559c
shambo001/peat
PEATDB/Ekin/Fitting.py
[ "MIT" ]
Python
loadModelsFile
<not_specific>
def loadModelsFile(modelsfile=None): """Update the current set of available models from a dict""" if modelsfile == None: path = os.path.abspath(os.path.dirname(__file__)) modelsfile = os.path.join(path,'models.dict') if not os.path.exists(modelsfile): path = os.getcwd() model...
Update the current set of available models from a dict
Update the current set of available models from a dict
[ "Update", "the", "current", "set", "of", "available", "models", "from", "a", "dict" ]
def loadModelsFile(modelsfile=None): if modelsfile == None: path = os.path.abspath(os.path.dirname(__file__)) modelsfile = os.path.join(path,'models.dict') if not os.path.exists(modelsfile): path = os.getcwd() modelsfile = os.path.join(path,'models.dict') if not os.path.exist...
[ "def", "loadModelsFile", "(", "modelsfile", "=", "None", ")", ":", "if", "modelsfile", "==", "None", ":", "path", "=", "os", ".", "path", ".", "abspath", "(", "os", ".", "path", ".", "dirname", "(", "__file__", ")", ")", "modelsfile", "=", "os", ".",...
Update the current set of available models from a dict
[ "Update", "the", "current", "set", "of", "available", "models", "from", "a", "dict" ]
[ "\"\"\"Update the current set of available models from a dict\"\"\"", "#write a default file if none available" ]
[ { "param": "modelsfile", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "modelsfile", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
fde81720862e6ae7090972c20a26ccbbca43559c
shambo001/peat
PEATDB/Ekin/Fitting.py
[ "MIT" ]
Python
updateModels
<not_specific>
def updateModels(data): """Reload the current global set of models from a dict""" global currentmodels currentmodels = data createFitters() return
Reload the current global set of models from a dict
Reload the current global set of models from a dict
[ "Reload", "the", "current", "global", "set", "of", "models", "from", "a", "dict" ]
def updateModels(data): global currentmodels currentmodels = data createFitters() return
[ "def", "updateModels", "(", "data", ")", ":", "global", "currentmodels", "currentmodels", "=", "data", "createFitters", "(", ")", "return" ]
Reload the current global set of models from a dict
[ "Reload", "the", "current", "global", "set", "of", "models", "from", "a", "dict" ]
[ "\"\"\"Reload the current global set of models from a dict\"\"\"" ]
[ { "param": "data", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "data", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
fde81720862e6ae7090972c20a26ccbbca43559c
shambo001/peat
PEATDB/Ekin/Fitting.py
[ "MIT" ]
Python
createClass
<not_specific>
def createClass(equation, varnames, guess=None, name=None, labels=['x','y'], **kwargs): """Dynamically create an instance of LM_fitter class using presets this function requires we pass varnames and equation at minimum""" class tempfitter(LM_F...
Dynamically create an instance of LM_fitter class using presets this function requires we pass varnames and equation at minimum
Dynamically create an instance of LM_fitter class using presets this function requires we pass varnames and equation at minimum
[ "Dynamically", "create", "an", "instance", "of", "LM_fitter", "class", "using", "presets", "this", "function", "requires", "we", "pass", "varnames", "and", "equation", "at", "minimum" ]
def createClass(equation, varnames, guess=None, name=None, labels=['x','y'], **kwargs): class tempfitter(LM_Fitter): def __init__(self, variables, exp_data, callback, name=None): LM_Fitter.__init__(self,variables,exp_data,callback, na...
[ "def", "createClass", "(", "equation", ",", "varnames", ",", "guess", "=", "None", ",", "name", "=", "None", ",", "labels", "=", "[", "'x'", ",", "'y'", "]", ",", "**", "kwargs", ")", ":", "class", "tempfitter", "(", "LM_Fitter", ")", ":", "def", "...
Dynamically create an instance of LM_fitter class using presets this function requires we pass varnames and equation at minimum
[ "Dynamically", "create", "an", "instance", "of", "LM_fitter", "class", "using", "presets", "this", "function", "requires", "we", "pass", "varnames", "and", "equation", "at", "minimum" ]
[ "\"\"\"Dynamically create an instance of LM_fitter class using presets\n this function requires we pass varnames and equation at minimum\"\"\"", "\"\"\"Evaluate string equation\"\"\"", "#print i, self.varnames[i],variables[i] ", "\"\"\"Guess start vals using provided strings in guess dict\"\"\"", "#pr...
[ { "param": "equation", "type": null }, { "param": "varnames", "type": null }, { "param": "guess", "type": null }, { "param": "name", "type": null }, { "param": "labels", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "equation", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "varnames", "type": null, "docstring": null, "docstring_to...
fde81720862e6ae7090972c20a26ccbbca43559c
shambo001/peat
PEATDB/Ekin/Fitting.py
[ "MIT" ]
Python
guess_start
<not_specific>
def guess_start(self): """Guess start vals using provided strings in guess dict""" if self.guess==None: return guess = self.guess #print guess if type(guess) is not types.DictType: guess = eval(guess) x=[i[0] for i i...
Guess start vals using provided strings in guess dict
Guess start vals using provided strings in guess dict
[ "Guess", "start", "vals", "using", "provided", "strings", "in", "guess", "dict" ]
def guess_start(self): if self.guess==None: return guess = self.guess if type(guess) is not types.DictType: guess = eval(guess) x=[i[0] for i in self.exp_data] y=[i[1] for i in self.exp_data] for i in...
[ "def", "guess_start", "(", "self", ")", ":", "if", "self", ".", "guess", "==", "None", ":", "return", "guess", "=", "self", ".", "guess", "if", "type", "(", "guess", ")", "is", "not", "types", ".", "DictType", ":", "guess", "=", "eval", "(", "guess...
Guess start vals using provided strings in guess dict
[ "Guess", "start", "vals", "using", "provided", "strings", "in", "guess", "dict" ]
[ "\"\"\"Guess start vals using provided strings in guess dict\"\"\"", "#print guess", "#print i, var, guess[var],self.variables[i]" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
fde81720862e6ae7090972c20a26ccbbca43559c
shambo001/peat
PEATDB/Ekin/Fitting.py
[ "MIT" ]
Python
createFitters
<not_specific>
def createFitters(): """Create pre-defined fitter classes""" for m in currentmodels: data = currentmodels[m] fitterClasses[m] = createClass(**data) #print fitterClasses return
Create pre-defined fitter classes
Create pre-defined fitter classes
[ "Create", "pre", "-", "defined", "fitter", "classes" ]
def createFitters(): for m in currentmodels: data = currentmodels[m] fitterClasses[m] = createClass(**data) return
[ "def", "createFitters", "(", ")", ":", "for", "m", "in", "currentmodels", ":", "data", "=", "currentmodels", "[", "m", "]", "fitterClasses", "[", "m", "]", "=", "createClass", "(", "**", "data", ")", "return" ]
Create pre-defined fitter classes
[ "Create", "pre", "-", "defined", "fitter", "classes" ]
[ "\"\"\"Create pre-defined fitter classes\"\"\"", "#print fitterClasses" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
fde81720862e6ae7090972c20a26ccbbca43559c
shambo001/peat
PEATDB/Ekin/Fitting.py
[ "MIT" ]
Python
makeFitter
<not_specific>
def makeFitter(fitdata, expdata=None, callback=None): """Return a fit object created from the provided ekin fit data""" if fitdata.has_key('model'): model = fitdata['model'] vrs = getFitVars(fitdata) if len(vrs)==0: return None else: print 'no model provided ...
Return a fit object created from the provided ekin fit data
Return a fit object created from the provided ekin fit data
[ "Return", "a", "fit", "object", "created", "from", "the", "provided", "ekin", "fit", "data" ]
def makeFitter(fitdata, expdata=None, callback=None): if fitdata.has_key('model'): model = fitdata['model'] vrs = getFitVars(fitdata) if len(vrs)==0: return None else: print 'no model provided to create fitter' return None return getFitter(model, vrs=vrs, ...
[ "def", "makeFitter", "(", "fitdata", ",", "expdata", "=", "None", ",", "callback", "=", "None", ")", ":", "if", "fitdata", ".", "has_key", "(", "'model'", ")", ":", "model", "=", "fitdata", "[", "'model'", "]", "vrs", "=", "getFitVars", "(", "fitdata",...
Return a fit object created from the provided ekin fit data
[ "Return", "a", "fit", "object", "created", "from", "the", "provided", "ekin", "fit", "data" ]
[ "\"\"\"Return a fit object created from the provided ekin fit data\"\"\"" ]
[ { "param": "fitdata", "type": null }, { "param": "expdata", "type": null }, { "param": "callback", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "fitdata", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "expdata", "type": null, "docstring": null, "docstring_toke...
fde81720862e6ae7090972c20a26ccbbca43559c
shambo001/peat
PEATDB/Ekin/Fitting.py
[ "MIT" ]
Python
makeFitData
<not_specific>
def makeFitData(model, vrs=None, error=None): """Get preset ekin fit data for a model, can also use provided variables and error vals - returns an ekin fitdata item""" fitdata={} fitdata['model'] = model if error == None: fitdata['error']=0.0 else: fitdata['error']=error i...
Get preset ekin fit data for a model, can also use provided variables and error vals - returns an ekin fitdata item
Get preset ekin fit data for a model, can also use provided variables and error vals - returns an ekin fitdata item
[ "Get", "preset", "ekin", "fit", "data", "for", "a", "model", "can", "also", "use", "provided", "variables", "and", "error", "vals", "-", "returns", "an", "ekin", "fitdata", "item" ]
def makeFitData(model, vrs=None, error=None): fitdata={} fitdata['model'] = model if error == None: fitdata['error']=0.0 else: fitdata['error']=error i=0 if vrs == None: X = getFitter(model,None,None) vrs = X.variables for v in vrs: fitdata[i]=v...
[ "def", "makeFitData", "(", "model", ",", "vrs", "=", "None", ",", "error", "=", "None", ")", ":", "fitdata", "=", "{", "}", "fitdata", "[", "'model'", "]", "=", "model", "if", "error", "==", "None", ":", "fitdata", "[", "'error'", "]", "=", "0.0", ...
Get preset ekin fit data for a model, can also use provided variables and error vals - returns an ekin fitdata item
[ "Get", "preset", "ekin", "fit", "data", "for", "a", "model", "can", "also", "use", "provided", "variables", "and", "error", "vals", "-", "returns", "an", "ekin", "fitdata", "item" ]
[ "\"\"\"Get preset ekin fit data for a model, can also use provided\n variables and error vals - returns an ekin fitdata item\"\"\"", "#get default vals for model" ]
[ { "param": "model", "type": null }, { "param": "vrs", "type": null }, { "param": "error", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "model", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "vrs", "type": null, "docstring": null, "docstring_tokens": [...
fde81720862e6ae7090972c20a26ccbbca43559c
shambo001/peat
PEATDB/Ekin/Fitting.py
[ "MIT" ]
Python
doFit
<not_specific>
def doFit(ekindata=None, fitdata=None, model=None, expdata=None, vrs=None, noiter=50, conv=None, grad=None, LM_damper=1.0, guess=True, silent=False, callback=None, changevars=None, startvalues=None): """General class method for doing a fit of provided ekin data and mo...
General class method for doing a fit of provided ekin data and model Returns the ekin fit data and the fitter instance used
General class method for doing a fit of provided ekin data and model Returns the ekin fit data and the fitter instance used
[ "General", "class", "method", "for", "doing", "a", "fit", "of", "provided", "ekin", "data", "and", "model", "Returns", "the", "ekin", "fit", "data", "and", "the", "fitter", "instance", "used" ]
def doFit(ekindata=None, fitdata=None, model=None, expdata=None, vrs=None, noiter=50, conv=None, grad=None, LM_damper=1.0, guess=True, silent=False, callback=None, changevars=None, startvalues=None): if conv == None: conv = conv if grad == None: gr...
[ "def", "doFit", "(", "ekindata", "=", "None", ",", "fitdata", "=", "None", ",", "model", "=", "None", ",", "expdata", "=", "None", ",", "vrs", "=", "None", ",", "noiter", "=", "50", ",", "conv", "=", "None", ",", "grad", "=", "None", ",", "LM_dam...
General class method for doing a fit of provided ekin data and model Returns the ekin fit data and the fitter instance used
[ "General", "class", "method", "for", "doing", "a", "fit", "of", "provided", "ekin", "data", "and", "model", "Returns", "the", "ekin", "fit", "data", "and", "the", "fitter", "instance", "used" ]
[ "\"\"\"General class method for doing a fit of provided ekin data and model\n Returns the ekin fit data and the fitter instance used\"\"\"", "\"\"\"Dummy callback for fit update\"\"\"", "# Set the change vars", "# Now do the fitting" ]
[ { "param": "ekindata", "type": null }, { "param": "fitdata", "type": null }, { "param": "model", "type": null }, { "param": "expdata", "type": null }, { "param": "vrs", "type": null }, { "param": "noiter", "type": null }, { "param": "conv",...
{ "returns": [], "raises": [], "params": [ { "identifier": "ekindata", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "fitdata", "type": null, "docstring": null, "docstring_tok...
fde81720862e6ae7090972c20a26ccbbca43559c
shambo001/peat
PEATDB/Ekin/Fitting.py
[ "MIT" ]
Python
estimateExpUncertainty
<not_specific>
def estimateExpUncertainty(ekindata, fitdata, xuncert=0, yuncert=0, runs=10, doplots=False, callback=None, guess=True, **kwargs): """Chresten's method for estimating the error on each parameter due to the effect of the exp uncertainty, which i...
Chresten's method for estimating the error on each parameter due to the effect of the exp uncertainty, which is user provided. If the datapoints have x or y error values, we use that instead
Chresten's method for estimating the error on each parameter due to the effect of the exp uncertainty, which is user provided. If the datapoints have x or y error values, we use that instead
[ "Chresten", "'", "s", "method", "for", "estimating", "the", "error", "on", "each", "parameter", "due", "to", "the", "effect", "of", "the", "exp", "uncertainty", "which", "is", "user", "provided", ".", "If", "the", "datapoints", "have", "x", "or", "y", "e...
def estimateExpUncertainty(ekindata, fitdata, xuncert=0, yuncert=0, runs=10, doplots=False, callback=None, guess=True, **kwargs): from PEATDB.Ekin.Dataset import EkinDataset grad=1e-6; conv=1e-6 for k in kwargs: if k=='conv': ...
[ "def", "estimateExpUncertainty", "(", "ekindata", ",", "fitdata", ",", "xuncert", "=", "0", ",", "yuncert", "=", "0", ",", "runs", "=", "10", ",", "doplots", "=", "False", ",", "callback", "=", "None", ",", "guess", "=", "True", ",", "**", "kwargs", ...
Chresten's method for estimating the error on each parameter due to the effect of the exp uncertainty, which is user provided.
[ "Chresten", "'", "s", "method", "for", "estimating", "the", "error", "on", "each", "parameter", "due", "to", "the", "effect", "of", "the", "exp", "uncertainty", "which", "is", "user", "provided", "." ]
[ "\"\"\"Chresten's method for estimating the error on each parameter due\n to the effect of the exp uncertainty, which is user provided.\n If the datapoints have x or y error values, we use that instead\"\"\"", "'''we iterate over runs and re-fit the data, each time adjusting x-y points\n then ac...
[ { "param": "ekindata", "type": null }, { "param": "fitdata", "type": null }, { "param": "xuncert", "type": null }, { "param": "yuncert", "type": null }, { "param": "runs", "type": null }, { "param": "doplots", "type": null }, { "param": "ca...
{ "returns": [], "raises": [], "params": [ { "identifier": "ekindata", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "fitdata", "type": null, "docstring": null, "docstring_tok...
fde81720862e6ae7090972c20a26ccbbca43559c
shambo001/peat
PEATDB/Ekin/Fitting.py
[ "MIT" ]
Python
findBestModel
<not_specific>
def findBestModel(ek, models, fitters=None, checkfunc=None, conv=None, grad=None, alpha=0.05, silent=False): """Finds the best fit model using f-testing. We do an f-test here between each successive model we iterate from simplest to last comparing each model to the more complex one...
Finds the best fit model using f-testing. We do an f-test here between each successive model we iterate from simplest to last comparing each model to the more complex ones when it finds a better model, this is the best one and is compared with later ones in turn.
Finds the best fit model using f-testing. We do an f-test here between each successive model we iterate from simplest to last comparing each model to the more complex ones when it finds a better model, this is the best one and is compared with later ones in turn.
[ "Finds", "the", "best", "fit", "model", "using", "f", "-", "testing", ".", "We", "do", "an", "f", "-", "test", "here", "between", "each", "successive", "model", "we", "iterate", "from", "simplest", "to", "last", "comparing", "each", "model", "to", "the",...
def findBestModel(ek, models, fitters=None, checkfunc=None, conv=None, grad=None, alpha=0.05, silent=False): import copy, operator p=None modelfits = {} modelstocompare = [] sortm=[] for m in models: X = getFitter(model=m) n = len(X.variables) sortm.ap...
[ "def", "findBestModel", "(", "ek", ",", "models", ",", "fitters", "=", "None", ",", "checkfunc", "=", "None", ",", "conv", "=", "None", ",", "grad", "=", "None", ",", "alpha", "=", "0.05", ",", "silent", "=", "False", ")", ":", "import", "copy", ",...
Finds the best fit model using f-testing.
[ "Finds", "the", "best", "fit", "model", "using", "f", "-", "testing", "." ]
[ "\"\"\"Finds the best fit model using f-testing.\n We do an f-test here between each successive model\n we iterate from simplest to last comparing each model to the more complex ones\n when it finds a better model, this is the best one and is compared with later ones\n in turn.\n \"\"\"",...
[ { "param": "ek", "type": null }, { "param": "models", "type": null }, { "param": "fitters", "type": null }, { "param": "checkfunc", "type": null }, { "param": "conv", "type": null }, { "param": "grad", "type": null }, { "param": "alpha", ...
{ "returns": [], "raises": [], "params": [ { "identifier": "ek", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "models", "type": null, "docstring": null, "docstring_tokens": [...
fde81720862e6ae7090972c20a26ccbbca43559c
shambo001/peat
PEATDB/Ekin/Fitting.py
[ "MIT" ]
Python
checkforOutliers
<not_specific>
def checkforOutliers(olddata, oldfitdata): """ It may happen that the simpler fit has a lower error than the more complex model because of far outliers, so we check this by removing any outliers. (We get stdev of datapoints and see if each datapoint is within 3 stdevs of fit curve). Then fit aga...
It may happen that the simpler fit has a lower error than the more complex model because of far outliers, so we check this by removing any outliers. (We get stdev of datapoints and see if each datapoint is within 3 stdevs of fit curve). Then fit again and see if error is better. see http://www....
It may happen that the simpler fit has a lower error than the more complex model because of far outliers, so we check this by removing any outliers. (We get stdev of datapoints and see if each datapoint is within 3 stdevs of fit curve). Then fit again and see if error is better.
[ "It", "may", "happen", "that", "the", "simpler", "fit", "has", "a", "lower", "error", "than", "the", "more", "complex", "model", "because", "of", "far", "outliers", "so", "we", "check", "this", "by", "removing", "any", "outliers", ".", "(", "We", "get", ...
def checkforOutliers(olddata, oldfitdata): print 'Checking for outliers' x=[] import copy newdata = copy.deepcopy(olddata) xd,yd = oldata.getxy() expdata = zip(xd,yd) mean,stdev = Utils.meanstdv(yd) print 'meanstdv:',mean,stdev for i in range(0,newdata.length()): y=newdata.y[...
[ "def", "checkforOutliers", "(", "olddata", ",", "oldfitdata", ")", ":", "print", "'Checking for outliers'", "x", "=", "[", "]", "import", "copy", "newdata", "=", "copy", ".", "deepcopy", "(", "olddata", ")", "xd", ",", "yd", "=", "oldata", ".", "getxy", ...
It may happen that the simpler fit has a lower error than the more complex model because of far outliers, so we check this by removing any outliers.
[ "It", "may", "happen", "that", "the", "simpler", "fit", "has", "a", "lower", "error", "than", "the", "more", "complex", "model", "because", "of", "far", "outliers", "so", "we", "check", "this", "by", "removing", "any", "outliers", "." ]
[ "\"\"\"\n It may happen that the simpler fit has a lower error than\n the more complex model because of far outliers, so we check this\n by removing any outliers. (We get stdev of datapoints and see if\n each datapoint is within 3 stdevs of fit curve).\n Then fit again and see if error is better.\n ...
[ { "param": "olddata", "type": null }, { "param": "oldfitdata", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "olddata", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "oldfitdata", "type": null, "docstring": null, "docstring_t...
c8919cb218b7354abf533a80023d61a7af7ccacc
shambo001/peat
pKaTool/pKacalc_interface.py
[ "MIT" ]
Python
load_pdb
<not_specific>
def load_pdb(self): """Open a window to load a PDB file with the aim of calculating pKa values Get the PDB file, and see if a calculation has been carried out""" import os if not self.pdbfile: pdbfilename=tkFileDialog.askopenfilename(defaultextension='.pdb', ...
Open a window to load a PDB file with the aim of calculating pKa values Get the PDB file, and see if a calculation has been carried out
Open a window to load a PDB file with the aim of calculating pKa values Get the PDB file, and see if a calculation has been carried out
[ "Open", "a", "window", "to", "load", "a", "PDB", "file", "with", "the", "aim", "of", "calculating", "pKa", "values", "Get", "the", "PDB", "file", "and", "see", "if", "a", "calculation", "has", "been", "carried", "out" ]
def load_pdb(self): import os if not self.pdbfile: pdbfilename=tkFileDialog.askopenfilename(defaultextension='.pdb', initialdir=os.getcwd(), filetypes=[("PDB file","*.pdb"), ...
[ "def", "load_pdb", "(", "self", ")", ":", "import", "os", "if", "not", "self", ".", "pdbfile", ":", "pdbfilename", "=", "tkFileDialog", ".", "askopenfilename", "(", "defaultextension", "=", "'.pdb'", ",", "initialdir", "=", "os", ".", "getcwd", "(", ")", ...
Open a window to load a PDB file with the aim of calculating pKa values Get the PDB file, and see if a calculation has been carried out
[ "Open", "a", "window", "to", "load", "a", "PDB", "file", "with", "the", "aim", "of", "calculating", "pKa", "values", "Get", "the", "PDB", "file", "and", "see", "if", "a", "calculation", "has", "been", "carried", "out" ]
[ "\"\"\"Open a window to load a PDB file with the aim of calculating pKa values\n\n Get the PDB file, and see if a calculation has been carried out\"\"\"", "#", "#", "#", "#", "# Set the name for it", "#", "#", "# Load the PDB file in Protool", "#", "#", "# Setup the calculation arrays",...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
c8919cb218b7354abf533a80023d61a7af7ccacc
shambo001/peat
pKaTool/pKacalc_interface.py
[ "MIT" ]
Python
pKaTool_pKa
<not_specific>
def pKaTool_pKa(self): """Perform a dirt-cheap pKa calculation using Jens' simple, simple method""" self.pHstart=0.1 self.pHstop=20.0 self.pHstep=0.1 self.chwin.destroy() self.simple_win=Toplevel() self.simple_win.transient(self.master) self.simple_win.tit...
Perform a dirt-cheap pKa calculation using Jens' simple, simple method
Perform a dirt-cheap pKa calculation using Jens' simple, simple method
[ "Perform", "a", "dirt", "-", "cheap", "pKa", "calculation", "using", "Jens", "'", "simple", "simple", "method" ]
def pKaTool_pKa(self): self.pHstart=0.1 self.pHstop=20.0 self.pHstep=0.1 self.chwin.destroy() self.simple_win=Toplevel() self.simple_win.transient(self.master) self.simple_win.title('pKaTool cheap pKa calculation') self.set_geometry(self.master,self.simple...
[ "def", "pKaTool_pKa", "(", "self", ")", ":", "self", ".", "pHstart", "=", "0.1", "self", ".", "pHstop", "=", "20.0", "self", ".", "pHstep", "=", "0.1", "self", ".", "chwin", ".", "destroy", "(", ")", "self", ".", "simple_win", "=", "Toplevel", "(", ...
Perform a dirt-cheap pKa calculation using Jens' simple, simple method
[ "Perform", "a", "dirt", "-", "cheap", "pKa", "calculation", "using", "Jens", "'", "simple", "simple", "method" ]
[ "\"\"\"Perform a dirt-cheap pKa calculation using Jens' simple, simple method\"\"\"", "#", "# Do we have a PDB file?", "#", "#", "# Start the pKa calculation", "#", "#", "#", "# Load the values", "#", "#", "# Write the titration curve file and the PKA.DAT file", "#", "#", "# Load the r...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
c8919cb218b7354abf533a80023d61a7af7ccacc
shambo001/peat
pKaTool/pKacalc_interface.py
[ "MIT" ]
Python
load_frompKD
<not_specific>
def load_frompKD(self,event=None): """Load calculated pKa values from the pKD server""" self.pKD_IFwin=Toplevel() self.set_position(self.pKD_IFwin) self.pKD_IFwin.title('pKD server connection') self.URL='/cgi-bin/pKD/pKaDesign_server.py' self.HOST='enzyme.ucd.ie' ...
Load calculated pKa values from the pKD server
Load calculated pKa values from the pKD server
[ "Load", "calculated", "pKa", "values", "from", "the", "pKD", "server" ]
def load_frompKD(self,event=None): self.pKD_IFwin=Toplevel() self.set_position(self.pKD_IFwin) self.pKD_IFwin.title('pKD server connection') self.URL='/cgi-bin/pKD/pKaDesign_server.py' self.HOST='enzyme.ucd.ie' self.PORT='80' Label(self.pKD_IFwin,text='pKD server ...
[ "def", "load_frompKD", "(", "self", ",", "event", "=", "None", ")", ":", "self", ".", "pKD_IFwin", "=", "Toplevel", "(", ")", "self", ".", "set_position", "(", "self", ".", "pKD_IFwin", ")", "self", ".", "pKD_IFwin", ".", "title", "(", "'pKD server conne...
Load calculated pKa values from the pKD server
[ "Load", "calculated", "pKa", "values", "from", "the", "pKD", "server" ]
[ "\"\"\"Load calculated pKa values from the pKD server\"\"\"", "#", "# Get the list of proteins that are prepared", "#", "#", "# Parse the XML", "#", "#", "# Calculations found", "#", "#", "# Sort the calcs and insert them", "#", "#", "# Box with details", "#", "#", "#", "#", "#...
[ { "param": "self", "type": null }, { "param": "event", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "event", "type": null, "docstring": null, "docstring_tokens": ...
c8919cb218b7354abf533a80023d61a7af7ccacc
shambo001/peat
pKaTool/pKacalc_interface.py
[ "MIT" ]
Python
do_search
<not_specific>
def do_search(self,event=None): """Search for the calcs where a certain text is found""" self.calculations.delete(0,END) self.calcs_displayed=[] text=self.searchtext.get() for calcname,info,setup in self.calculations_ready: if calcname.find(text)!=-1 or info.find(text...
Search for the calcs where a certain text is found
Search for the calcs where a certain text is found
[ "Search", "for", "the", "calcs", "where", "a", "certain", "text", "is", "found" ]
def do_search(self,event=None): self.calculations.delete(0,END) self.calcs_displayed=[] text=self.searchtext.get() for calcname,info,setup in self.calculations_ready: if calcname.find(text)!=-1 or info.find(text)!=-1: self.calcs_displayed.append([calcname,info...
[ "def", "do_search", "(", "self", ",", "event", "=", "None", ")", ":", "self", ".", "calculations", ".", "delete", "(", "0", ",", "END", ")", "self", ".", "calcs_displayed", "=", "[", "]", "text", "=", "self", ".", "searchtext", ".", "get", "(", ")"...
Search for the calcs where a certain text is found
[ "Search", "for", "the", "calcs", "where", "a", "certain", "text", "is", "found" ]
[ "\"\"\"Search for the calcs where a certain text is found\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "event", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "event", "type": null, "docstring": null, "docstring_tokens": ...
c8919cb218b7354abf533a80023d61a7af7ccacc
shambo001/peat
pKaTool/pKacalc_interface.py
[ "MIT" ]
Python
do_load_pKDcalcs
<not_specific>
def do_load_pKDcalcs(self): """Load pKa calculations from the pKD server into pKaTool""" selection=self.calculations.curselection() if len(selection)==0: return self.pKDname=StringVar() self.pKDname.set('Ready') Label(self.pKD_IFwin,textvariable=self.pKDname)....
Load pKa calculations from the pKD server into pKaTool
Load pKa calculations from the pKD server into pKaTool
[ "Load", "pKa", "calculations", "from", "the", "pKD", "server", "into", "pKaTool" ]
def do_load_pKDcalcs(self): selection=self.calculations.curselection() if len(selection)==0: return self.pKDname=StringVar() self.pKDname.set('Ready') Label(self.pKD_IFwin,textvariable=self.pKDname).grid(row=26,column=0) count=0 for sel in selection: ...
[ "def", "do_load_pKDcalcs", "(", "self", ")", ":", "selection", "=", "self", ".", "calculations", ".", "curselection", "(", ")", "if", "len", "(", "selection", ")", "==", "0", ":", "return", "self", ".", "pKDname", "=", "StringVar", "(", ")", "self", "....
Load pKa calculations from the pKD server into pKaTool
[ "Load", "pKa", "calculations", "from", "the", "pKD", "server", "into", "pKaTool" ]
[ "\"\"\"Load pKa calculations from the pKD server into pKaTool\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
c8919cb218b7354abf533a80023d61a7af7ccacc
shambo001/peat
pKaTool/pKacalc_interface.py
[ "MIT" ]
Python
print_included
<not_specific>
def print_included(self): """Print the files that we are considering""" # # Do we have any files? # if len(self.files_included)<1: return Label(self.file_win,text='Files holding structure data').grid(row=0,column=0,columnspan=3) # # Print the f...
Print the files that we are considering
Print the files that we are considering
[ "Print", "the", "files", "that", "we", "are", "considering" ]
def print_included(self): Do we have any files? if len(self.files_included)<1: return Label(self.file_win,text='Files holding structure data').grid(row=0,column=0,columnspan=3) Print the file(s) that we use import os row=1 count=1 for name,de...
[ "def", "print_included", "(", "self", ")", ":", "if", "len", "(", "self", ".", "files_included", ")", "<", "1", ":", "return", "Label", "(", "self", ".", "file_win", ",", "text", "=", "'Files holding structure data'", ")", ".", "grid", "(", "row", "=", ...
Print the files that we are considering
[ "Print", "the", "files", "that", "we", "are", "considering" ]
[ "\"\"\"Print the files that we are considering\"\"\"", "#", "# Do we have any files?", "#", "#", "# Print the file(s) that we use", "#" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
c8919cb218b7354abf533a80023d61a7af7ccacc
shambo001/peat
pKaTool/pKacalc_interface.py
[ "MIT" ]
Python
really_getgroups
<not_specific>
def really_getgroups(self): """Divide the files listed into protein and ligand, and initialise the routines""" proteins=[] ligands=[] for file,ftype in self.files_included: if ftype=='Protein': proteins.append(file) else: ligands.ap...
Divide the files listed into protein and ligand, and initialise the routines
Divide the files listed into protein and ligand, and initialise the routines
[ "Divide", "the", "files", "listed", "into", "protein", "and", "ligand", "and", "initialise", "the", "routines" ]
def really_getgroups(self): proteins=[] ligands=[] for file,ftype in self.files_included: if ftype=='Protein': proteins.append(file) else: ligands.append(file) Right now we can only deal with one file of each type pdbfile=p...
[ "def", "really_getgroups", "(", "self", ")", ":", "proteins", "=", "[", "]", "ligands", "=", "[", "]", "for", "file", ",", "ftype", "in", "self", ".", "files_included", ":", "if", "ftype", "==", "'Protein'", ":", "proteins", ".", "append", "(", "file",...
Divide the files listed into protein and ligand, and initialise the routines
[ "Divide", "the", "files", "listed", "into", "protein", "and", "ligand", "and", "initialise", "the", "routines" ]
[ "\"\"\"Divide the files listed into protein and ligand, and initialise the routines\"\"\"", "#", "# Right now we can only deal with one file of each type", "#", "#", "# Now get the groups", "#" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
c8919cb218b7354abf533a80023d61a7af7ccacc
shambo001/peat
pKaTool/pKacalc_interface.py
[ "MIT" ]
Python
add_file
<not_specific>
def add_file(self,event=None): """Browse for another file to add to self.included_files""" import os newfilename=tkFileDialog.askopenfilename(defaultextension='.mol2', initialdir=os.getcwd(), filety...
Browse for another file to add to self.included_files
Browse for another file to add to self.included_files
[ "Browse", "for", "another", "file", "to", "add", "to", "self", ".", "included_files" ]
def add_file(self,event=None): import os newfilename=tkFileDialog.askopenfilename(defaultextension='.mol2', initialdir=os.getcwd(), filetypes=[("Mol2 file",'*.mol2'), ...
[ "def", "add_file", "(", "self", ",", "event", "=", "None", ")", ":", "import", "os", "newfilename", "=", "tkFileDialog", ".", "askopenfilename", "(", "defaultextension", "=", "'.mol2'", ",", "initialdir", "=", "os", ".", "getcwd", "(", ")", ",", "filetypes...
Browse for another file to add to self.included_files
[ "Browse", "for", "another", "file", "to", "add", "to", "self", ".", "included_files" ]
[ "\"\"\"Browse for another file to add to self.included_files\"\"\"", "#" ]
[ { "param": "self", "type": null }, { "param": "event", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "event", "type": null, "docstring": null, "docstring_tokens": ...
c8919cb218b7354abf533a80023d61a7af7ccacc
shambo001/peat
pKaTool/pKacalc_interface.py
[ "MIT" ]
Python
init_calc
<not_specific>
def init_calc(self): """Initialise a pKa calculation This involves getting the titratable groups""" # # Do we have a PDB file? # #if not self.pdbfilename: # import tkMessageBox # tkMessageBox.showwarning('No PDB file', # ...
Initialise a pKa calculation This involves getting the titratable groups
Initialise a pKa calculation This involves getting the titratable groups
[ "Initialise", "a", "pKa", "calculation", "This", "involves", "getting", "the", "titratable", "groups" ]
def init_calc(self): Do we have a PDB file? if not self.pdbfilename: import tkMessageBox tkMessageBox.showwarning('No PDB file', 'You have to load a PDB file before performing a pKa calculation') return Open the file mana...
[ "def", "init_calc", "(", "self", ")", ":", "self", ".", "file_manager_dialog", "(", ")", "self", ".", "initwin", "=", "Toplevel", "(", ")", "self", ".", "initwin", ".", "transient", "(", "self", ".", "master", ")", "self", ".", "set_geometry", "(", "se...
Initialise a pKa calculation This involves getting the titratable groups
[ "Initialise", "a", "pKa", "calculation", "This", "involves", "getting", "the", "titratable", "groups" ]
[ "\"\"\"Initialise a pKa calculation\n\n This involves getting the titratable groups\"\"\"", "#", "# Do we have a PDB file?", "#", "#if not self.pdbfilename:", "# import tkMessageBox", "# tkMessageBox.showwarning('No PDB file',", "# 'You have to load a PDB file ...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
c8919cb218b7354abf533a80023d61a7af7ccacc
shambo001/peat
pKaTool/pKacalc_interface.py
[ "MIT" ]
Python
calcIF_select_group
<not_specific>
def calcIF_select_group(self): """Add a single or multiple groups to the selected listbox""" for sel in self.all_groups.curselection(): group_num=int(sel) sel_group=self.groups[group_num] if not sel_group in self.calc_selected_list: self.calc_selected_...
Add a single or multiple groups to the selected listbox
Add a single or multiple groups to the selected listbox
[ "Add", "a", "single", "or", "multiple", "groups", "to", "the", "selected", "listbox" ]
def calcIF_select_group(self): for sel in self.all_groups.curselection(): group_num=int(sel) sel_group=self.groups[group_num] if not sel_group in self.calc_selected_list: self.calc_selected_list.append(sel_group) self.update_calcIF_selected_groups() ...
[ "def", "calcIF_select_group", "(", "self", ")", ":", "for", "sel", "in", "self", ".", "all_groups", ".", "curselection", "(", ")", ":", "group_num", "=", "int", "(", "sel", ")", "sel_group", "=", "self", ".", "groups", "[", "group_num", "]", "if", "not...
Add a single or multiple groups to the selected listbox
[ "Add", "a", "single", "or", "multiple", "groups", "to", "the", "selected", "listbox" ]
[ "\"\"\"Add a single or multiple groups to the selected listbox\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
c8919cb218b7354abf533a80023d61a7af7ccacc
shambo001/peat
pKaTool/pKacalc_interface.py
[ "MIT" ]
Python
calcIF_remove_group
<not_specific>
def calcIF_remove_group(self): """Remove a single or multiple groups from the selected listbox""" for sel in self.calcgroups_selected.curselection(): group_num=int(sel) sel_group=self.groups[group_num] if sel_group in self.calc_selected_list: self.calc...
Remove a single or multiple groups from the selected listbox
Remove a single or multiple groups from the selected listbox
[ "Remove", "a", "single", "or", "multiple", "groups", "from", "the", "selected", "listbox" ]
def calcIF_remove_group(self): for sel in self.calcgroups_selected.curselection(): group_num=int(sel) sel_group=self.groups[group_num] if sel_group in self.calc_selected_list: self.calc_selected_list.remove(sel_group) self.update_calcIF_selected_groups...
[ "def", "calcIF_remove_group", "(", "self", ")", ":", "for", "sel", "in", "self", ".", "calcgroups_selected", ".", "curselection", "(", ")", ":", "group_num", "=", "int", "(", "sel", ")", "sel_group", "=", "self", ".", "groups", "[", "group_num", "]", "if...
Remove a single or multiple groups from the selected listbox
[ "Remove", "a", "single", "or", "multiple", "groups", "from", "the", "selected", "listbox" ]
[ "\"\"\"Remove a single or multiple groups from the selected listbox\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
c8919cb218b7354abf533a80023d61a7af7ccacc
shambo001/peat
pKaTool/pKacalc_interface.py
[ "MIT" ]
Python
update_calcIF_selected_groups
<not_specific>
def update_calcIF_selected_groups(self): """Update the groups in the listbox with groups selected for the calculation""" self.calc_selected_list.sort() self.calcgroups_selected.delete(0,END) for group in self.calc_selected_list: self.calcgroups_selected.insert(END,group) ...
Update the groups in the listbox with groups selected for the calculation
Update the groups in the listbox with groups selected for the calculation
[ "Update", "the", "groups", "in", "the", "listbox", "with", "groups", "selected", "for", "the", "calculation" ]
def update_calcIF_selected_groups(self): self.calc_selected_list.sort() self.calcgroups_selected.delete(0,END) for group in self.calc_selected_list: self.calcgroups_selected.insert(END,group) return
[ "def", "update_calcIF_selected_groups", "(", "self", ")", ":", "self", ".", "calc_selected_list", ".", "sort", "(", ")", "self", ".", "calcgroups_selected", ".", "delete", "(", "0", ",", "END", ")", "for", "group", "in", "self", ".", "calc_selected_list", ":...
Update the groups in the listbox with groups selected for the calculation
[ "Update", "the", "groups", "in", "the", "listbox", "with", "groups", "selected", "for", "the", "calculation" ]
[ "\"\"\"Update the groups in the listbox with groups selected for the calculation\"\"\"", "# Code for selecting calculation engine?" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
c8919cb218b7354abf533a80023d61a7af7ccacc
shambo001/peat
pKaTool/pKacalc_interface.py
[ "MIT" ]
Python
IFsetup_calc
<not_specific>
def IFsetup_calc(self): """Set up a new calculation with the present titratable groups Set all energies to zero """ import os pdbfilename_short=os.path.split(self.pdbfilename)[1] label=self.labels[self.label_count] import pKaIO self.calcs[pdbfilename_short...
Set up a new calculation with the present titratable groups Set all energies to zero
Set up a new calculation with the present titratable groups Set all energies to zero
[ "Set", "up", "a", "new", "calculation", "with", "the", "present", "titratable", "groups", "Set", "all", "energies", "to", "zero" ]
def IFsetup_calc(self): import os pdbfilename_short=os.path.split(self.pdbfilename)[1] label=self.labels[self.label_count] import pKaIO self.calcs[pdbfilename_short]={'instance':pKaIO.pKaIO(self.pdbfilename),'selected_groups':[],'label':label} self.label_count=self.label_...
[ "def", "IFsetup_calc", "(", "self", ")", ":", "import", "os", "pdbfilename_short", "=", "os", ".", "path", ".", "split", "(", "self", ".", "pdbfilename", ")", "[", "1", "]", "label", "=", "self", ".", "labels", "[", "self", ".", "label_count", "]", "...
Set up a new calculation with the present titratable groups Set all energies to zero
[ "Set", "up", "a", "new", "calculation", "with", "the", "present", "titratable", "groups", "Set", "all", "energies", "to", "zero" ]
[ "\"\"\"Set up a new calculation with the present titratable groups\n Set all energies to zero\n \"\"\"", "#", "# Matrix", "#", "#self.calcs[pdbfilename_short]['titcurv']=self.X2.readtitcurv()", "#", "# read the pKa values", "#", "#self.calcs[pdbfilename_short]['pkavals']=self.X2.readpk...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
c8919cb218b7354abf533a80023d61a7af7ccacc
shambo001/peat
pKaTool/pKacalc_interface.py
[ "MIT" ]
Python
construct_empty_matrix
<not_specific>
def construct_empty_matrix(self): """Construct an empty matrix and save it""" self.matrix={} for group in self.groups: if not self.matrix.has_key(group): self.matrix[group]={} for group2 in self.groups: self.matrix[group][group2]=[0.0,0.0,0...
Construct an empty matrix and save it
Construct an empty matrix and save it
[ "Construct", "an", "empty", "matrix", "and", "save", "it" ]
def construct_empty_matrix(self): self.matrix={} for group in self.groups: if not self.matrix.has_key(group): self.matrix[group]={} for group2 in self.groups: self.matrix[group][group2]=[0.0,0.0,0.0,0.0] Save it import os p...
[ "def", "construct_empty_matrix", "(", "self", ")", ":", "self", ".", "matrix", "=", "{", "}", "for", "group", "in", "self", ".", "groups", ":", "if", "not", "self", ".", "matrix", ".", "has_key", "(", "group", ")", ":", "self", ".", "matrix", "[", ...
Construct an empty matrix and save it
[ "Construct", "an", "empty", "matrix", "and", "save", "it" ]
[ "\"\"\"Construct an empty matrix and save it\"\"\"", "#", "# Save it", "#" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
c8919cb218b7354abf533a80023d61a7af7ccacc
shambo001/peat
pKaTool/pKacalc_interface.py
[ "MIT" ]
Python
do_pka_calculation
<not_specific>
def do_pka_calculation(self): """Run a full pKa calculation on the selected groups""" self.chwin=Toplevel() self.chwin.transient(self.master) self.set_geometry(self.master,self.chwin) self.chwin.title('Choose calculation type') self.set_enecalc_engine(self.chwin,row=0,col...
Run a full pKa calculation on the selected groups
Run a full pKa calculation on the selected groups
[ "Run", "a", "full", "pKa", "calculation", "on", "the", "selected", "groups" ]
def do_pka_calculation(self): self.chwin=Toplevel() self.chwin.transient(self.master) self.set_geometry(self.master,self.chwin) self.chwin.title('Choose calculation type') self.set_enecalc_engine(self.chwin,row=0,column=0) Button(self.chwin,text='Run calculation',command=...
[ "def", "do_pka_calculation", "(", "self", ")", ":", "self", ".", "chwin", "=", "Toplevel", "(", ")", "self", ".", "chwin", ".", "transient", "(", "self", ".", "master", ")", "self", ".", "set_geometry", "(", "self", ".", "master", ",", "self", ".", "...
Run a full pKa calculation on the selected groups
[ "Run", "a", "full", "pKa", "calculation", "on", "the", "selected", "groups" ]
[ "\"\"\"Run a full pKa calculation on the selected groups\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
c8919cb218b7354abf533a80023d61a7af7ccacc
shambo001/peat
pKaTool/pKacalc_interface.py
[ "MIT" ]
Python
calculate_matrix_dialog
<not_specific>
def calculate_matrix_dialog(self): """Open a dialog for calculating or entering energies for the interaction energy matrix""" if not self.pdbfilename: tkMessageBox.showwarning('No PDB file', 'You must load a PDB file before you can calculate the matrix') ...
Open a dialog for calculating or entering energies for the interaction energy matrix
Open a dialog for calculating or entering energies for the interaction energy matrix
[ "Open", "a", "dialog", "for", "calculating", "or", "entering", "energies", "for", "the", "interaction", "energy", "matrix" ]
def calculate_matrix_dialog(self): if not self.pdbfilename: tkMessageBox.showwarning('No PDB file', 'You must load a PDB file before you can calculate the matrix') return Open the window self.mwin=Toplevel() self.mwin.title('I...
[ "def", "calculate_matrix_dialog", "(", "self", ")", ":", "if", "not", "self", ".", "pdbfilename", ":", "tkMessageBox", ".", "showwarning", "(", "'No PDB file'", ",", "'You must load a PDB file before you can calculate the matrix'", ")", "return", "self", ".", "mwin", ...
Open a dialog for calculating or entering energies for the interaction energy matrix
[ "Open", "a", "dialog", "for", "calculating", "or", "entering", "energies", "for", "the", "interaction", "energy", "matrix" ]
[ "\"\"\"Open a dialog for calculating or entering energies for the interaction energy matrix\"\"\"", "#", "# Open the window", "#", "#", "# Canvas for the matrix", "#", "#", "# Buttons for the calculation engine", "#", "#", "# What do we display?", "#", "#", "# Add action buttons", "#",...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
c8919cb218b7354abf533a80023d61a7af7ccacc
shambo001/peat
pKaTool/pKacalc_interface.py
[ "MIT" ]
Python
update_matrix_display
<not_specific>
def update_matrix_display(self): """Update the matrix on the screen when we choose a new calculation method""" # # Delete all object on the canvas # objects=self.matrix_canvas.find_all() for obj in objects: self.matrix_canvas.delete(obj) # # Pr...
Update the matrix on the screen when we choose a new calculation method
Update the matrix on the screen when we choose a new calculation method
[ "Update", "the", "matrix", "on", "the", "screen", "when", "we", "choose", "a", "new", "calculation", "method" ]
def update_matrix_display(self): Delete all object on the canvas objects=self.matrix_canvas.find_all() for obj in objects: self.matrix_canvas.delete(obj) Precompute the group numbers self.group_numbers={} count=0 for group in self.groups: ...
[ "def", "update_matrix_display", "(", "self", ")", ":", "objects", "=", "self", ".", "matrix_canvas", ".", "find_all", "(", ")", "for", "obj", "in", "objects", ":", "self", ".", "matrix_canvas", ".", "delete", "(", "obj", ")", "self", ".", "group_numbers", ...
Update the matrix on the screen when we choose a new calculation method
[ "Update", "the", "matrix", "on", "the", "screen", "when", "we", "choose", "a", "new", "calculation", "method" ]
[ "\"\"\"Update the matrix on the screen when we choose a new calculation method\"\"\"", "#", "# Delete all object on the canvas", "#", "#", "# Precompute the group numbers", "#", "#", "# Get the titratable groups", "#", "#", "# Labels", "#", "#", "# Insert the energies", "#", "#self.E...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
dc5ec7bd0f8e896e37ad4856dcf6a89cadd5eebe
shambo001/peat
PEATDB/Base.py
[ "MIT" ]
Python
createStorage
<not_specific>
def createStorage(self, server, username, password, project, port, backend): """Create the specified storage from given options""" if backend == 'mysql': #we now use RelStorage by default, mysql backend from relstorage.adapters.mysql import MySQLAdapter ...
Create the specified storage from given options
Create the specified storage from given options
[ "Create", "the", "specified", "storage", "from", "given", "options" ]
def createStorage(self, server, username, password, project, port, backend): if backend == 'mysql': from relstorage.adapters.mysql import MySQLAdapter from relstorage.storage import RelStorage from MySQLdb import OperationalError try: ...
[ "def", "createStorage", "(", "self", ",", "server", ",", "username", ",", "password", ",", "project", ",", "port", ",", "backend", ")", ":", "if", "backend", "==", "'mysql'", ":", "from", "relstorage", ".", "adapters", ".", "mysql", "import", "MySQLAdapter...
Create the specified storage from given options
[ "Create", "the", "specified", "storage", "from", "given", "options" ]
[ "\"\"\"Create the specified storage from given options\"\"\"", "#we now use RelStorage by default, mysql backend", "#shared_blob_dir=False, blob_dir=self.blob_dir)", "#otherwise we try to use clientstorage/ZEO", "#can't raise exception here if connection fails.." ]
[ { "param": "self", "type": null }, { "param": "server", "type": null }, { "param": "username", "type": null }, { "param": "password", "type": null }, { "param": "project", "type": null }, { "param": "port", "type": null }, { "param": "backe...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "server", "type": null, "docstring": null, "docstring_tokens":...
dc5ec7bd0f8e896e37ad4856dcf6a89cadd5eebe
shambo001/peat
PEATDB/Base.py
[ "MIT" ]
Python
createData
<not_specific>
def createData(self): """Create a BTree object for the root Protein data and a seperate object for meta data like userfields. All objects added to dbroot should be persistent aware""" self.data = self.dbroot['data'] = OOBTree() self.meta = self.dbroot['meta'] = Meta('PEAT-D...
Create a BTree object for the root Protein data and a seperate object for meta data like userfields. All objects added to dbroot should be persistent aware
Create a BTree object for the root Protein data and a seperate object for meta data like userfields. All objects added to dbroot should be persistent aware
[ "Create", "a", "BTree", "object", "for", "the", "root", "Protein", "data", "and", "a", "seperate", "object", "for", "meta", "data", "like", "userfields", ".", "All", "objects", "added", "to", "dbroot", "should", "be", "persistent", "aware" ]
def createData(self): self.data = self.dbroot['data'] = OOBTree() self.meta = self.dbroot['meta'] = Meta('PEAT-DB database') self.meta.staticfields = { 'name': 'text', 'Mutations':'text', 'Structure':'PDB'} self.blobs = self.dbroot['blobs'] = OOBTree(...
[ "def", "createData", "(", "self", ")", ":", "self", ".", "data", "=", "self", ".", "dbroot", "[", "'data'", "]", "=", "OOBTree", "(", ")", "self", ".", "meta", "=", "self", ".", "dbroot", "[", "'meta'", "]", "=", "Meta", "(", "'PEAT-DB database'", ...
Create a BTree object for the root Protein data and a seperate object for meta data like userfields.
[ "Create", "a", "BTree", "object", "for", "the", "root", "Protein", "data", "and", "a", "seperate", "object", "for", "meta", "data", "like", "userfields", "." ]
[ "\"\"\"Create a BTree object for the root Protein data and a\n seperate object for meta data like userfields.\n All objects added to dbroot should be persistent aware\"\"\"", "#use meta.info for any misc settings specific to the DB" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
dc5ec7bd0f8e896e37ad4856dcf6a89cadd5eebe
shambo001/peat
PEATDB/Base.py
[ "MIT" ]
Python
commit
<not_specific>
def commit(self, user='anon', note='minor'): """Commit change in the DB to zodb. We treate conflicts as application level errors, so the method returns false if it fails to commit""" t = transaction.get() t.setUser(user) t.note(note) from ZODB import P...
Commit change in the DB to zodb. We treate conflicts as application level errors, so the method returns false if it fails to commit
Commit change in the DB to zodb. We treate conflicts as application level errors, so the method returns false if it fails to commit
[ "Commit", "change", "in", "the", "DB", "to", "zodb", ".", "We", "treate", "conflicts", "as", "application", "level", "errors", "so", "the", "method", "returns", "false", "if", "it", "fails", "to", "commit" ]
def commit(self, user='anon', note='minor'): t = transaction.get() t.setUser(user) t.note(note) from ZODB import POSException try: t.commit() except POSException.ConflictError: print 'there is a conflict' print 'follow...
[ "def", "commit", "(", "self", ",", "user", "=", "'anon'", ",", "note", "=", "'minor'", ")", ":", "t", "=", "transaction", ".", "get", "(", ")", "t", ".", "setUser", "(", "user", ")", "t", ".", "note", "(", "note", ")", "from", "ZODB", "import", ...
Commit change in the DB to zodb.
[ "Commit", "change", "in", "the", "DB", "to", "zodb", "." ]
[ "\"\"\"Commit change in the DB to zodb.\n We treate conflicts as application level errors, so the\n method returns false if it fails to commit\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "user", "type": null }, { "param": "note", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "user", "type": null, "docstring": null, "docstring_tokens": [...
dc5ec7bd0f8e896e37ad4856dcf6a89cadd5eebe
shambo001/peat
PEATDB/Base.py
[ "MIT" ]
Python
deleteField
<not_specific>
def deleteField(self, fname, callback=None): """Remove the field from all records""" if not fname in self.meta.userfields: print 'field name not in userfields..' i=0 for k in self.data.keys(): if fname in self.data[k].keys() and type(self.data[k]) ...
Remove the field from all records
Remove the field from all records
[ "Remove", "the", "field", "from", "all", "records" ]
def deleteField(self, fname, callback=None): if not fname in self.meta.userfields: print 'field name not in userfields..' i=0 for k in self.data.keys(): if fname in self.data[k].keys() and type(self.data[k]) is PEATRecord: s...
[ "def", "deleteField", "(", "self", ",", "fname", ",", "callback", "=", "None", ")", ":", "if", "not", "fname", "in", "self", ".", "meta", ".", "userfields", ":", "print", "'field name not in userfields..'", "i", "=", "0", "for", "k", "in", "self", ".", ...
Remove the field from all records
[ "Remove", "the", "field", "from", "all", "records" ]
[ "\"\"\"Remove the field from all records\"\"\"", "#del self.data[k][fname]" ]
[ { "param": "self", "type": null }, { "param": "fname", "type": null }, { "param": "callback", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "fname", "type": null, "docstring": null, "docstring_tokens": ...
dc5ec7bd0f8e896e37ad4856dcf6a89cadd5eebe
shambo001/peat
PEATDB/Base.py
[ "MIT" ]
Python
addBlob
<not_specific>
def addBlob(self, recname, field, filename): """Adds an external file as a blob to the DB""" f=os.path.split(filename)[1] self.add(recname) blob = self.getBlob(filename) self.data[recname][field] = FileRecord(name=filename, blob=blob) print self.data[recname][field] ...
Adds an external file as a blob to the DB
Adds an external file as a blob to the DB
[ "Adds", "an", "external", "file", "as", "a", "blob", "to", "the", "DB" ]
def addBlob(self, recname, field, filename): f=os.path.split(filename)[1] self.add(recname) blob = self.getBlob(filename) self.data[recname][field] = FileRecord(name=filename, blob=blob) print self.data[recname][field] return
[ "def", "addBlob", "(", "self", ",", "recname", ",", "field", ",", "filename", ")", ":", "f", "=", "os", ".", "path", ".", "split", "(", "filename", ")", "[", "1", "]", "self", ".", "add", "(", "recname", ")", "blob", "=", "self", ".", "getBlob", ...
Adds an external file as a blob to the DB
[ "Adds", "an", "external", "file", "as", "a", "blob", "to", "the", "DB" ]
[ "\"\"\"Adds an external file as a blob to the DB\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "recname", "type": null }, { "param": "field", "type": null }, { "param": "filename", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "recname", "type": null, "docstring": null, "docstring_tokens"...
dc5ec7bd0f8e896e37ad4856dcf6a89cadd5eebe
shambo001/peat
PEATDB/Base.py
[ "MIT" ]
Python
importDict
<not_specific>
def importDict(self, importdata, namefield='name', overwrite=True): """Import a list of dicts, each one is a record""" if len(importdata) == 0: return fields = importdata[0].keys() if not namefield in fields: print 'no such field for keyname field' ...
Import a list of dicts, each one is a record
Import a list of dicts, each one is a record
[ "Import", "a", "list", "of", "dicts", "each", "one", "is", "a", "record" ]
def importDict(self, importdata, namefield='name', overwrite=True): if len(importdata) == 0: return fields = importdata[0].keys() if not namefield in fields: print 'no such field for keyname field' namefield = fields[0] if namefield...
[ "def", "importDict", "(", "self", ",", "importdata", ",", "namefield", "=", "'name'", ",", "overwrite", "=", "True", ")", ":", "if", "len", "(", "importdata", ")", "==", "0", ":", "return", "fields", "=", "importdata", "[", "0", "]", ".", "keys", "("...
Import a list of dicts, each one is a record
[ "Import", "a", "list", "of", "dicts", "each", "one", "is", "a", "record" ]
[ "\"\"\"Import a list of dicts, each one is a record\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "importdata", "type": null }, { "param": "namefield", "type": null }, { "param": "overwrite", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "importdata", "type": null, "docstring": null, "docstring_toke...
dc5ec7bd0f8e896e37ad4856dcf6a89cadd5eebe
shambo001/peat
PEATDB/Base.py
[ "MIT" ]
Python
isChanged
<not_specific>
def isChanged(self): """Check if DB has been changed""" persisted = [self.meta, self.data, self.meta.info] for p in persisted: if p._p_state == 1: return True for k in self.meta.keys(): if not type(self.meta[k]) is PersistentMap...
Check if DB has been changed
Check if DB has been changed
[ "Check", "if", "DB", "has", "been", "changed" ]
def isChanged(self): persisted = [self.meta, self.data, self.meta.info] for p in persisted: if p._p_state == 1: return True for k in self.meta.keys(): if not type(self.meta[k]) is PersistentMapping: continue ...
[ "def", "isChanged", "(", "self", ")", ":", "persisted", "=", "[", "self", ".", "meta", ",", "self", ".", "data", ",", "self", ".", "meta", ".", "info", "]", "for", "p", "in", "persisted", ":", "if", "p", ".", "_p_state", "==", "1", ":", "return",...
Check if DB has been changed
[ "Check", "if", "DB", "has", "been", "changed" ]
[ "\"\"\"Check if DB has been changed\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
dc5ec7bd0f8e896e37ad4856dcf6a89cadd5eebe
shambo001/peat
PEATDB/Base.py
[ "MIT" ]
Python
_checkTransactionSize
<not_specific>
def _checkTransactionSize(self): """To prevent current changes swamping memory we should commit in batches when the cache limit is exceeded. This method should be called from functions likely to be involved in large commits. Each subtransaction commit writes the current changes ...
To prevent current changes swamping memory we should commit in batches when the cache limit is exceeded. This method should be called from functions likely to be involved in large commits. Each subtransaction commit writes the current changes out to disk and frees memory to m...
To prevent current changes swamping memory we should commit in batches when the cache limit is exceeded. This method should be called from functions likely to be involved in large commits. Each subtransaction commit writes the current changes out to disk and frees memory to make room for more changes
[ "To", "prevent", "current", "changes", "swamping", "memory", "we", "should", "commit", "in", "batches", "when", "the", "cache", "limit", "is", "exceeded", ".", "This", "method", "should", "be", "called", "from", "functions", "likely", "to", "be", "involved", ...
def _checkTransactionSize(self): self.changessincelastcommit += 1 if self.changessincelastcommit > self.meta.info['cachesize']: self.commit(note='transaction limit reached commit') self.db.cacheMinimize() self.changessincelastcommit = 0 print 'cache limit ...
[ "def", "_checkTransactionSize", "(", "self", ")", ":", "self", ".", "changessincelastcommit", "+=", "1", "if", "self", ".", "changessincelastcommit", ">", "self", ".", "meta", ".", "info", "[", "'cachesize'", "]", ":", "self", ".", "commit", "(", "note", "...
To prevent current changes swamping memory we should commit in batches when the cache limit is exceeded.
[ "To", "prevent", "current", "changes", "swamping", "memory", "we", "should", "commit", "in", "batches", "when", "the", "cache", "limit", "is", "exceeded", "." ]
[ "\"\"\"To prevent current changes swamping memory we should commit\n in batches when the cache limit is exceeded. This method should be\n called from functions likely to be involved in large commits.\n Each subtransaction commit writes the current changes out to disk\n and fr...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
dc5ec7bd0f8e896e37ad4856dcf6a89cadd5eebe
shambo001/peat
PEATDB/Base.py
[ "MIT" ]
Python
_checkMemCache
<not_specific>
def _checkMemCache(self): """Need to check the memory isn't being overloaded Call this when addressing lots of recs serially, eg. inside getitem not very fine grained""" if self.db.cacheSize() > self.meta.info['cachesize']: self.db.cacheMinimize() return
Need to check the memory isn't being overloaded Call this when addressing lots of recs serially, eg. inside getitem not very fine grained
Need to check the memory isn't being overloaded Call this when addressing lots of recs serially, eg. inside getitem not very fine grained
[ "Need", "to", "check", "the", "memory", "isn", "'", "t", "being", "overloaded", "Call", "this", "when", "addressing", "lots", "of", "recs", "serially", "eg", ".", "inside", "getitem", "not", "very", "fine", "grained" ]
def _checkMemCache(self): if self.db.cacheSize() > self.meta.info['cachesize']: self.db.cacheMinimize() return
[ "def", "_checkMemCache", "(", "self", ")", ":", "if", "self", ".", "db", ".", "cacheSize", "(", ")", ">", "self", ".", "meta", ".", "info", "[", "'cachesize'", "]", ":", "self", ".", "db", ".", "cacheMinimize", "(", ")", "return" ]
Need to check the memory isn't being overloaded Call this when addressing lots of recs serially, eg.
[ "Need", "to", "check", "the", "memory", "isn", "'", "t", "being", "overloaded", "Call", "this", "when", "addressing", "lots", "of", "recs", "serially", "eg", "." ]
[ "\"\"\"Need to check the memory isn't being overloaded\n Call this when addressing lots of recs serially, eg. inside getitem\n not very fine grained\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
dc5ec7bd0f8e896e37ad4856dcf6a89cadd5eebe
shambo001/peat
PEATDB/Base.py
[ "MIT" ]
Python
addLabbook
<not_specific>
def addLabbook(self, name, data=None): """Create an extra labbook We store these in meta.labbooks""" if not hasattr(self.meta, 'labbooks'): self.meta.labbooks = PersistentMapping() self.meta.labbooks[name] = data return
Create an extra labbook We store these in meta.labbooks
Create an extra labbook We store these in meta.labbooks
[ "Create", "an", "extra", "labbook", "We", "store", "these", "in", "meta", ".", "labbooks" ]
def addLabbook(self, name, data=None): if not hasattr(self.meta, 'labbooks'): self.meta.labbooks = PersistentMapping() self.meta.labbooks[name] = data return
[ "def", "addLabbook", "(", "self", ",", "name", ",", "data", "=", "None", ")", ":", "if", "not", "hasattr", "(", "self", ".", "meta", ",", "'labbooks'", ")", ":", "self", ".", "meta", ".", "labbooks", "=", "PersistentMapping", "(", ")", "self", ".", ...
Create an extra labbook We store these in meta.labbooks
[ "Create", "an", "extra", "labbook", "We", "store", "these", "in", "meta", ".", "labbooks" ]
[ "\"\"\"Create an extra labbook\n We store these in meta.labbooks\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "name", "type": null }, { "param": "data", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "name", "type": null, "docstring": null, "docstring_tokens": [...
dc5ec7bd0f8e896e37ad4856dcf6a89cadd5eebe
shambo001/peat
PEATDB/Base.py
[ "MIT" ]
Python
saveLabbook
<not_specific>
def saveLabbook(self, sheet, model): """Save a model instance into the provided sheet""" tmp = self.meta.labbook tmp[sheet] = model.getData() self.meta.labbook = tmp return
Save a model instance into the provided sheet
Save a model instance into the provided sheet
[ "Save", "a", "model", "instance", "into", "the", "provided", "sheet" ]
def saveLabbook(self, sheet, model): tmp = self.meta.labbook tmp[sheet] = model.getData() self.meta.labbook = tmp return
[ "def", "saveLabbook", "(", "self", ",", "sheet", ",", "model", ")", ":", "tmp", "=", "self", ".", "meta", ".", "labbook", "tmp", "[", "sheet", "]", "=", "model", ".", "getData", "(", ")", "self", ".", "meta", ".", "labbook", "=", "tmp", "return" ]
Save a model instance into the provided sheet
[ "Save", "a", "model", "instance", "into", "the", "provided", "sheet" ]
[ "\"\"\"Save a model instance into the provided sheet\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "sheet", "type": null }, { "param": "model", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "sheet", "type": null, "docstring": null, "docstring_tokens": ...
dc5ec7bd0f8e896e37ad4856dcf6a89cadd5eebe
shambo001/peat
PEATDB/Base.py
[ "MIT" ]
Python
addDNAseq
<not_specific>
def addDNAseq(self, protein_name, DNAseq): """Add a DNA sequence to a protein""" if self.isknownProtein(protein_name): # Do we already have a DNA sequence? self.data[protein_name].DNAseq = DNAseq return True return None
Add a DNA sequence to a protein
Add a DNA sequence to a protein
[ "Add", "a", "DNA", "sequence", "to", "a", "protein" ]
def addDNAseq(self, protein_name, DNAseq): if self.isknownProtein(protein_name): self.data[protein_name].DNAseq = DNAseq return True return None
[ "def", "addDNAseq", "(", "self", ",", "protein_name", ",", "DNAseq", ")", ":", "if", "self", ".", "isknownProtein", "(", "protein_name", ")", ":", "self", ".", "data", "[", "protein_name", "]", ".", "DNAseq", "=", "DNAseq", "return", "True", "return", "N...
Add a DNA sequence to a protein
[ "Add", "a", "DNA", "sequence", "to", "a", "protein" ]
[ "\"\"\"Add a DNA sequence to a protein\"\"\"", "# Do we already have a DNA sequence?" ]
[ { "param": "self", "type": null }, { "param": "protein_name", "type": null }, { "param": "DNAseq", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "protein_name", "type": null, "docstring": null, "docstring_to...
dc5ec7bd0f8e896e37ad4856dcf6a89cadd5eebe
shambo001/peat
PEATDB/Base.py
[ "MIT" ]
Python
addProtseq
<not_specific>
def addProtseq(self,protein_name,sequence,start_aanumber=1, seq_format='detect',update=True): """ Add the protein sequence - blind faith for now... We add this protein sequence as currentres. If the protein has a parent, then it must be set elsewhere ""...
Add the protein sequence - blind faith for now... We add this protein sequence as currentres. If the protein has a parent, then it must be set elsewhere
Add the protein sequence - blind faith for now We add this protein sequence as currentres. If the protein has a parent, then it must be set elsewhere
[ "Add", "the", "protein", "sequence", "-", "blind", "faith", "for", "now", "We", "add", "this", "protein", "sequence", "as", "currentres", ".", "If", "the", "protein", "has", "a", "parent", "then", "it", "must", "be", "set", "elsewhere" ]
def addProtseq(self,protein_name,sequence,start_aanumber=1, seq_format='detect',update=True): if seq_format=='detect': import types if type(sequence)==types.ListType: if len(sequence[0])==3: pass elif len(sequenc...
[ "def", "addProtseq", "(", "self", ",", "protein_name", ",", "sequence", ",", "start_aanumber", "=", "1", ",", "seq_format", "=", "'detect'", ",", "update", "=", "True", ")", ":", "if", "seq_format", "==", "'detect'", ":", "import", "types", "if", "type", ...
Add the protein sequence - blind faith for now... We add this protein sequence as currentres.
[ "Add", "the", "protein", "sequence", "-", "blind", "faith", "for", "now", "...", "We", "add", "this", "protein", "sequence", "as", "currentres", "." ]
[ "\"\"\"\n Add the protein sequence - blind faith for now...\n We add this protein sequence as currentres. If the protein has a parent, then it must be set\n elsewhere\n \"\"\"", "# We have the sequence in the right format, so simply insert it", "# Create the sequence and add it to...
[ { "param": "self", "type": null }, { "param": "protein_name", "type": null }, { "param": "sequence", "type": null }, { "param": "start_aanumber", "type": null }, { "param": "seq_format", "type": null }, { "param": "update", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "protein_name", "type": null, "docstring": null, "docstring_to...
dc5ec7bd0f8e896e37ad4856dcf6a89cadd5eebe
shambo001/peat
PEATDB/Base.py
[ "MIT" ]
Python
addProperty
<not_specific>
def addProperty(self,protein_name,category,this_dict): """Add the properties in dict to the information for protein_name. category is the key/name that the info will be associated with""" if self.isknownProtein(protein_name): if type(this_dict) is type({}): self.data...
Add the properties in dict to the information for protein_name. category is the key/name that the info will be associated with
Add the properties in dict to the information for protein_name. category is the key/name that the info will be associated with
[ "Add", "the", "properties", "in", "dict", "to", "the", "information", "for", "protein_name", ".", "category", "is", "the", "key", "/", "name", "that", "the", "info", "will", "be", "associated", "with" ]
def addProperty(self,protein_name,category,this_dict): if self.isknownProtein(protein_name): if type(this_dict) is type({}): self.data[protein_name][category]=this_dict.copy() else: self.data[protein_name][category]=this_dict return 1 r...
[ "def", "addProperty", "(", "self", ",", "protein_name", ",", "category", ",", "this_dict", ")", ":", "if", "self", ".", "isknownProtein", "(", "protein_name", ")", ":", "if", "type", "(", "this_dict", ")", "is", "type", "(", "{", "}", ")", ":", "self",...
Add the properties in dict to the information for protein_name.
[ "Add", "the", "properties", "in", "dict", "to", "the", "information", "for", "protein_name", "." ]
[ "\"\"\"Add the properties in dict to the information for protein_name.\n category is the key/name that the info will be associated with\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "protein_name", "type": null }, { "param": "category", "type": null }, { "param": "this_dict", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "protein_name", "type": null, "docstring": null, "docstring_to...
dc5ec7bd0f8e896e37ad4856dcf6a89cadd5eebe
shambo001/peat
PEATDB/Base.py
[ "MIT" ]
Python
convert_string1_2_list3
<not_specific>
def convert_string1_2_list3(self,sequence): """Convert a string of AA1 to a list of AA3""" newseq=[] import DNAtool.mutation for letter in sequence: newseq.append(DNAtool.mutation.one_to_three[letter]) return newseq
Convert a string of AA1 to a list of AA3
Convert a string of AA1 to a list of AA3
[ "Convert", "a", "string", "of", "AA1", "to", "a", "list", "of", "AA3" ]
def convert_string1_2_list3(self,sequence): newseq=[] import DNAtool.mutation for letter in sequence: newseq.append(DNAtool.mutation.one_to_three[letter]) return newseq
[ "def", "convert_string1_2_list3", "(", "self", ",", "sequence", ")", ":", "newseq", "=", "[", "]", "import", "DNAtool", ".", "mutation", "for", "letter", "in", "sequence", ":", "newseq", ".", "append", "(", "DNAtool", ".", "mutation", ".", "one_to_three", ...
Convert a string of AA1 to a list of AA3
[ "Convert", "a", "string", "of", "AA1", "to", "a", "list", "of", "AA3" ]
[ "\"\"\"Convert a string of AA1 to a list of AA3\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "sequence", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "sequence", "type": null, "docstring": null, "docstring_tokens...
dc5ec7bd0f8e896e37ad4856dcf6a89cadd5eebe
shambo001/peat
PEATDB/Base.py
[ "MIT" ]
Python
convert_string3_2_list3
<not_specific>
def convert_string3_2_list3(self,sequence): """Convert a string of AA3 to a list of AA3""" newseq=[] thisaa='' import DNAtool.mutation for letter in sequence: thisaa=thisaa+letter if len(thisaa)==3: if DNAtool.mutation.three_to_one.has_key(...
Convert a string of AA3 to a list of AA3
Convert a string of AA3 to a list of AA3
[ "Convert", "a", "string", "of", "AA3", "to", "a", "list", "of", "AA3" ]
def convert_string3_2_list3(self,sequence): newseq=[] thisaa='' import DNAtool.mutation for letter in sequence: thisaa=thisaa+letter if len(thisaa)==3: if DNAtool.mutation.three_to_one.has_key(thisaa): newseq.append(thisaa) ...
[ "def", "convert_string3_2_list3", "(", "self", ",", "sequence", ")", ":", "newseq", "=", "[", "]", "thisaa", "=", "''", "import", "DNAtool", ".", "mutation", "for", "letter", "in", "sequence", ":", "thisaa", "=", "thisaa", "+", "letter", "if", "len", "("...
Convert a string of AA3 to a list of AA3
[ "Convert", "a", "string", "of", "AA3", "to", "a", "list", "of", "AA3" ]
[ "\"\"\"Convert a string of AA3 to a list of AA3\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "sequence", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "sequence", "type": null, "docstring": null, "docstring_tokens...
dc5ec7bd0f8e896e37ad4856dcf6a89cadd5eebe
shambo001/peat
PEATDB/Base.py
[ "MIT" ]
Python
newmolecule
<not_specific>
def newmolecule(self,protein_name,update=True): """ This function files a new molecule in the Database protein_name is the name of the molecule (DB identifier) Enter all the data in dict into the database """ if self.isknownProtein(protein_name): return None ...
This function files a new molecule in the Database protein_name is the name of the molecule (DB identifier) Enter all the data in dict into the database
This function files a new molecule in the Database protein_name is the name of the molecule (DB identifier) Enter all the data in dict into the database
[ "This", "function", "files", "a", "new", "molecule", "in", "the", "Database", "protein_name", "is", "the", "name", "of", "the", "molecule", "(", "DB", "identifier", ")", "Enter", "all", "the", "data", "in", "dict", "into", "the", "database" ]
def newmolecule(self,protein_name,update=True): if self.isknownProtein(protein_name): return None else: self.add(protein_name) return True
[ "def", "newmolecule", "(", "self", ",", "protein_name", ",", "update", "=", "True", ")", ":", "if", "self", ".", "isknownProtein", "(", "protein_name", ")", ":", "return", "None", "else", ":", "self", ".", "add", "(", "protein_name", ")", "return", "True...
This function files a new molecule in the Database protein_name is the name of the molecule (DB identifier) Enter all the data in dict into the database
[ "This", "function", "files", "a", "new", "molecule", "in", "the", "Database", "protein_name", "is", "the", "name", "of", "the", "molecule", "(", "DB", "identifier", ")", "Enter", "all", "the", "data", "in", "dict", "into", "the", "database" ]
[ "\"\"\"\n This function files a new molecule in the Database\n protein_name is the name of the molecule (DB identifier)\n Enter all the data in dict into the database\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "protein_name", "type": null }, { "param": "update", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "protein_name", "type": null, "docstring": null, "docstring_to...
dc5ec7bd0f8e896e37ad4856dcf6a89cadd5eebe
shambo001/peat
PEATDB/Base.py
[ "MIT" ]
Python
storePDB
<not_specific>
def storePDB(self, name, X, AlignmentMap=None): """Store the PDB file for the selected protein""" rec = self.data[name] rec.Structure = X.writepdb('dummy',nowrite=1) rec.Structuretype = 'xray' # Store the map between sequences if AlignmentMap != None: rec.Stru...
Store the PDB file for the selected protein
Store the PDB file for the selected protein
[ "Store", "the", "PDB", "file", "for", "the", "selected", "protein" ]
def storePDB(self, name, X, AlignmentMap=None): rec = self.data[name] rec.Structure = X.writepdb('dummy',nowrite=1) rec.Structuretype = 'xray' if AlignmentMap != None: rec.Structure_alnseq_EATrecord = AlignmentMap['OrigAa'] rec.Structure_alnseq_PDBfile = Alignment...
[ "def", "storePDB", "(", "self", ",", "name", ",", "X", ",", "AlignmentMap", "=", "None", ")", ":", "rec", "=", "self", ".", "data", "[", "name", "]", "rec", ".", "Structure", "=", "X", ".", "writepdb", "(", "'dummy'", ",", "nowrite", "=", "1", ")...
Store the PDB file for the selected protein
[ "Store", "the", "PDB", "file", "for", "the", "selected", "protein" ]
[ "\"\"\"Store the PDB file for the selected protein\"\"\"", "# Store the map between sequences" ]
[ { "param": "self", "type": null }, { "param": "name", "type": null }, { "param": "X", "type": null }, { "param": "AlignmentMap", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "name", "type": null, "docstring": null, "docstring_tokens": [...
4552c836c64490fa60df9379ce110bb8cf799263
shambo001/peat
Protool/properties.py
[ "MIT" ]
Python
calculate_mass
<not_specific>
def calculate_mass(PI): """Calculate the mass of all protein atoms in a Protool instance""" weight=0.0 for residue in PI.residues: if PI.isaa(residue): weight=weight+PI.all_attribute[PI.three_to_one[PI.resname(residue)]]['Mw'] return weight-16.0
Calculate the mass of all protein atoms in a Protool instance
Calculate the mass of all protein atoms in a Protool instance
[ "Calculate", "the", "mass", "of", "all", "protein", "atoms", "in", "a", "Protool", "instance" ]
def calculate_mass(PI): weight=0.0 for residue in PI.residues: if PI.isaa(residue): weight=weight+PI.all_attribute[PI.three_to_one[PI.resname(residue)]]['Mw'] return weight-16.0
[ "def", "calculate_mass", "(", "PI", ")", ":", "weight", "=", "0.0", "for", "residue", "in", "PI", ".", "residues", ":", "if", "PI", ".", "isaa", "(", "residue", ")", ":", "weight", "=", "weight", "+", "PI", ".", "all_attribute", "[", "PI", ".", "th...
Calculate the mass of all protein atoms in a Protool instance
[ "Calculate", "the", "mass", "of", "all", "protein", "atoms", "in", "a", "Protool", "instance" ]
[ "\"\"\"Calculate the mass of all protein atoms in a Protool instance\"\"\"" ]
[ { "param": "PI", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "PI", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
4552c836c64490fa60df9379ce110bb8cf799263
shambo001/peat
Protool/properties.py
[ "MIT" ]
Python
calculate_unit_cell_volume
<not_specific>
def calculate_unit_cell_volume(PI): """calculate the volume of the unit cell""" cr=PI.cryst[0].split() a=float(cr[1]) b=float(cr[2]) c=float(cr[3]) from math import * alpha=radians(float(cr[4])) beta=radians(float(cr[5])) gamma=radians(float(cr[6])) Vuc= a*b*c*sqrt(1.0-pow(cos(al...
calculate the volume of the unit cell
calculate the volume of the unit cell
[ "calculate", "the", "volume", "of", "the", "unit", "cell" ]
def calculate_unit_cell_volume(PI): cr=PI.cryst[0].split() a=float(cr[1]) b=float(cr[2]) c=float(cr[3]) from math import * alpha=radians(float(cr[4])) beta=radians(float(cr[5])) gamma=radians(float(cr[6])) Vuc= a*b*c*sqrt(1.0-pow(cos(alpha),2)-pow(cos(beta),2)-pow(cos(gamma),2)+2.0*c...
[ "def", "calculate_unit_cell_volume", "(", "PI", ")", ":", "cr", "=", "PI", ".", "cryst", "[", "0", "]", ".", "split", "(", ")", "a", "=", "float", "(", "cr", "[", "1", "]", ")", "b", "=", "float", "(", "cr", "[", "2", "]", ")", "c", "=", "f...
calculate the volume of the unit cell
[ "calculate", "the", "volume", "of", "the", "unit", "cell" ]
[ "\"\"\"calculate the volume of the unit cell\"\"\"" ]
[ { "param": "PI", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "PI", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
4552c836c64490fa60df9379ce110bb8cf799263
shambo001/peat
Protool/properties.py
[ "MIT" ]
Python
calculate_Vm
<not_specific>
def calculate_Vm(PI): """Calculate Vm, Protein volume, Solvent volume and crystal density""" # Mass Mw=calculate_mass(PI) # Number of assymmetric units in unit cell z=get_asym_units(PI) # Unit cell volume Vuc=calculate_unit_cell_volume(PI) # Calculate Vm Vm=Vuc/(Mw*z) # Calculate...
Calculate Vm, Protein volume, Solvent volume and crystal density
Calculate Vm, Protein volume, Solvent volume and crystal density
[ "Calculate", "Vm", "Protein", "volume", "Solvent", "volume", "and", "crystal", "density" ]
def calculate_Vm(PI): Mw=calculate_mass(PI) z=get_asym_units(PI) Vuc=calculate_unit_cell_volume(PI) Vm=Vuc/(Mw*z) Na=6.02E23 densprot=1.35E-24 protein_vol=100.0*Mw*z/(densprot*Na)/Vuc solvent_vol=100.0-protein_vol cryst_dens=(protein_vol*densprot*1E24+(100.0-protein_vol)*1.00)/100.0...
[ "def", "calculate_Vm", "(", "PI", ")", ":", "Mw", "=", "calculate_mass", "(", "PI", ")", "z", "=", "get_asym_units", "(", "PI", ")", "Vuc", "=", "calculate_unit_cell_volume", "(", "PI", ")", "Vm", "=", "Vuc", "/", "(", "Mw", "*", "z", ")", "Na", "=...
Calculate Vm, Protein volume, Solvent volume and crystal density
[ "Calculate", "Vm", "Protein", "volume", "Solvent", "volume", "and", "crystal", "density" ]
[ "\"\"\"Calculate Vm, Protein volume, Solvent volume and crystal density\"\"\"", "# Mass", "# Number of assymmetric units in unit cell", "# Unit cell volume", "# Calculate Vm", "# Calculate protein volume", "# g / A**3" ]
[ { "param": "PI", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "PI", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
38ae2df02c3ee33c2e70e7d6c4d55def54cddff4
shambo001/peat
PEATDB/PE.py
[ "MIT" ]
Python
alanineScan
<not_specific>
def alanineScan(self): """Perform a full Alanine scan on all the selected proteins Add all mutant proteins to the DB""" if not self.get_selected_proteins(): return # # Open information window # P=GUI_helper.progress_window(self.master,'Alanine ...
Perform a full Alanine scan on all the selected proteins Add all mutant proteins to the DB
Perform a full Alanine scan on all the selected proteins Add all mutant proteins to the DB
[ "Perform", "a", "full", "Alanine", "scan", "on", "all", "the", "selected", "proteins", "Add", "all", "mutant", "proteins", "to", "the", "DB" ]
def alanineScan(self): if not self.get_selected_proteins(): return P=GUI_helper.progress_window(self.master,'Alanine scan') P.update_progress(0.0) DBi=self.data['DBinstance'] DB=DBi.DB count=0 for protein in self.sel_prots: sequence=DB[prot...
[ "def", "alanineScan", "(", "self", ")", ":", "if", "not", "self", ".", "get_selected_proteins", "(", ")", ":", "return", "P", "=", "GUI_helper", ".", "progress_window", "(", "self", ".", "master", ",", "'Alanine scan'", ")", "P", ".", "update_progress", "(...
Perform a full Alanine scan on all the selected proteins Add all mutant proteins to the DB
[ "Perform", "a", "full", "Alanine", "scan", "on", "all", "the", "selected", "proteins", "Add", "all", "mutant", "proteins", "to", "the", "DB" ]
[ "\"\"\"Perform a full Alanine scan on all the selected proteins\r\n Add all mutant proteins to the DB\"\"\"", "#\r", "# Open information window\r", "#\r", "#\r", "# Loop over all proteins\r", "#\r", "#minres=DBi[protein]['ORF_selected']['aastart_number']\r", "#maxres=minres+DBi[protein]['ORF_...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
38ae2df02c3ee33c2e70e7d6c4d55def54cddff4
shambo001/peat
PEATDB/PE.py
[ "MIT" ]
Python
modelontheFly
<not_specific>
def modelontheFly(self, DB, operations): """Produce the PDBlines for the mutant file""" self.MUT = DBActions.initProtool() # Create temporary array holding models if not getattr(DB,'tmp_3Dmodels',None): DB.tmp_3Dmodels={} # Get the structure from the...
Produce the PDBlines for the mutant file
Produce the PDBlines for the mutant file
[ "Produce", "the", "PDBlines", "for", "the", "mutant", "file" ]
def modelontheFly(self, DB, operations): self.MUT = DBActions.initProtool() if not getattr(DB,'tmp_3Dmodels',None): DB.tmp_3Dmodels={} parent = operations['parent'] parentrec = DB.get(parent) if parentrec.hasStructure() == 'available': if DB.tmp_3Dmodels.h...
[ "def", "modelontheFly", "(", "self", ",", "DB", ",", "operations", ")", ":", "self", ".", "MUT", "=", "DBActions", ".", "initProtool", "(", ")", "if", "not", "getattr", "(", "DB", ",", "'tmp_3Dmodels'", ",", "None", ")", ":", "DB", ".", "tmp_3Dmodels",...
Produce the PDBlines for the mutant file
[ "Produce", "the", "PDBlines", "for", "the", "mutant", "file" ]
[ "\"\"\"Produce the PDBlines for the mutant file\"\"\"", "# Create temporary array holding models\r", "# Get the structure from the parent\r", "# Have we already modelled this one?\r", "# Read parent structure\r", "# Perform all the operations\r", "# First do all the deletes\r", "#print operation,uniqu...
[ { "param": "self", "type": null }, { "param": "DB", "type": null }, { "param": "operations", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "DB", "type": null, "docstring": null, "docstring_tokens": [],...
99bec2b9658ab26db0c400e5c781773ea0a4ab6c
shambo001/peat
PEATDB/Ekin/Dataset.py
[ "MIT" ]
Python
checkLists
<not_specific>
def checkLists(self): """Check that our lists are floats or None, if empty""" self.x = self.checkList(self.x) self.y = self.checkList(self.y) return
Check that our lists are floats or None, if empty
Check that our lists are floats or None, if empty
[ "Check", "that", "our", "lists", "are", "floats", "or", "None", "if", "empty" ]
def checkLists(self): self.x = self.checkList(self.x) self.y = self.checkList(self.y) return
[ "def", "checkLists", "(", "self", ")", ":", "self", ".", "x", "=", "self", ".", "checkList", "(", "self", ".", "x", ")", "self", ".", "y", "=", "self", ".", "checkList", "(", "self", ".", "y", ")", "return" ]
Check that our lists are floats or None, if empty
[ "Check", "that", "our", "lists", "are", "floats", "or", "None", "if", "empty" ]
[ "\"\"\"Check that our lists are floats or None, if empty\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
99bec2b9658ab26db0c400e5c781773ea0a4ab6c
shambo001/peat
PEATDB/Ekin/Dataset.py
[ "MIT" ]
Python
add
<not_specific>
def add(self, dp=(None,None), a=1, e=(None,None)): """Add a new datapoint, dp is a tuple""" self.x.append(dp[0]) self.y.append(dp[1]) self.active.append(a) for d in range(self.dims): self.errors[d].append(e[d]) return
Add a new datapoint, dp is a tuple
Add a new datapoint, dp is a tuple
[ "Add", "a", "new", "datapoint", "dp", "is", "a", "tuple" ]
def add(self, dp=(None,None), a=1, e=(None,None)): self.x.append(dp[0]) self.y.append(dp[1]) self.active.append(a) for d in range(self.dims): self.errors[d].append(e[d]) return
[ "def", "add", "(", "self", ",", "dp", "=", "(", "None", ",", "None", ")", ",", "a", "=", "1", ",", "e", "=", "(", "None", ",", "None", ")", ")", ":", "self", ".", "x", ".", "append", "(", "dp", "[", "0", "]", ")", "self", ".", "y", ".",...
Add a new datapoint, dp is a tuple
[ "Add", "a", "new", "datapoint", "dp", "is", "a", "tuple" ]
[ "\"\"\"Add a new datapoint, dp is a tuple\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "dp", "type": null }, { "param": "a", "type": null }, { "param": "e", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "dp", "type": null, "docstring": null, "docstring_tokens": [],...
99bec2b9658ab26db0c400e5c781773ea0a4ab6c
shambo001/peat
PEATDB/Ekin/Dataset.py
[ "MIT" ]
Python
remove
<not_specific>
def remove(self, i=None): """Delete a datapoint at index i""" if i > len(self.x): print 'index out of range' return if i==None: self.x.pop() self.y.pop() else: del self.x[i] del self.y[i] del self.active...
Delete a datapoint at index i
Delete a datapoint at index i
[ "Delete", "a", "datapoint", "at", "index", "i" ]
def remove(self, i=None): if i > len(self.x): print 'index out of range' return if i==None: self.x.pop() self.y.pop() else: del self.x[i] del self.y[i] del self.active[i] for j in range(self.dims): ...
[ "def", "remove", "(", "self", ",", "i", "=", "None", ")", ":", "if", "i", ">", "len", "(", "self", ".", "x", ")", ":", "print", "'index out of range'", "return", "if", "i", "==", "None", ":", "self", ".", "x", ".", "pop", "(", ")", "self", ".",...
Delete a datapoint at index i
[ "Delete", "a", "datapoint", "at", "index", "i" ]
[ "\"\"\"Delete a datapoint at index i\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "i", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "i", "type": null, "docstring": null, "docstring_tokens": [], ...
99bec2b9658ab26db0c400e5c781773ea0a4ab6c
shambo001/peat
PEATDB/Ekin/Dataset.py
[ "MIT" ]
Python
removeMultiple
<not_specific>
def removeMultiple(self, lst): """Remove points using list of elements""" rng = range(0,self.length()) self.x=[self.x[i] for i in rng if i not in lst] self.y=[self.y[i] for i in rng if i not in lst] self.active=[self.active[i] for i in rng if i not in lst] for d in...
Remove points using list of elements
Remove points using list of elements
[ "Remove", "points", "using", "list", "of", "elements" ]
def removeMultiple(self, lst): rng = range(0,self.length()) self.x=[self.x[i] for i in rng if i not in lst] self.y=[self.y[i] for i in rng if i not in lst] self.active=[self.active[i] for i in rng if i not in lst] for d in range(self.dims): self.errors[d] = [self.erro...
[ "def", "removeMultiple", "(", "self", ",", "lst", ")", ":", "rng", "=", "range", "(", "0", ",", "self", ".", "length", "(", ")", ")", "self", ".", "x", "=", "[", "self", ".", "x", "[", "i", "]", "for", "i", "in", "rng", "if", "i", "not", "i...
Remove points using list of elements
[ "Remove", "points", "using", "list", "of", "elements" ]
[ "\"\"\"Remove points using list of elements\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "lst", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "lst", "type": null, "docstring": null, "docstring_tokens": []...
99bec2b9658ab26db0c400e5c781773ea0a4ab6c
shambo001/peat
PEATDB/Ekin/Dataset.py
[ "MIT" ]
Python
removeBounded
<not_specific>
def removeBounded(self, bounds): """Remove points within selected x-y bounds""" if bounds==None or len(bounds)!=4: return x1,y1,x2,y2 = bounds if x1>x2 : temp=x1;x1=x2;x2=temp if y1>y2: temp=y1;y1=y2;y2=temp lst=[] for i in rang...
Remove points within selected x-y bounds
Remove points within selected x-y bounds
[ "Remove", "points", "within", "selected", "x", "-", "y", "bounds" ]
def removeBounded(self, bounds): if bounds==None or len(bounds)!=4: return x1,y1,x2,y2 = bounds if x1>x2 : temp=x1;x1=x2;x2=temp if y1>y2: temp=y1;y1=y2;y2=temp lst=[] for i in range(0,self.length()): x=self.x[i]; y=self.y[i...
[ "def", "removeBounded", "(", "self", ",", "bounds", ")", ":", "if", "bounds", "==", "None", "or", "len", "(", "bounds", ")", "!=", "4", ":", "return", "x1", ",", "y1", ",", "x2", ",", "y2", "=", "bounds", "if", "x1", ">", "x2", ":", "temp", "="...
Remove points within selected x-y bounds
[ "Remove", "points", "within", "selected", "x", "-", "y", "bounds" ]
[ "\"\"\"Remove points within selected x-y bounds\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "bounds", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "bounds", "type": null, "docstring": null, "docstring_tokens":...
7c2be94cbbaa8b0c24ff0825579604c3f9495d6b
shambo001/peat
PEATDB/Ekin/ModelDesign.py
[ "MIT" ]
Python
createMenuBar
<not_specific>
def createMenuBar(self): """Create the menu bar for the application""" self.menu=Menu(self.main) self.file_menu={'01Open models file':{'cmd':self.loadModelsFile}, '02Quit':{'cmd':self.quit}} self.file_menu=self.create_pulldown(self.menu,sel...
Create the menu bar for the application
Create the menu bar for the application
[ "Create", "the", "menu", "bar", "for", "the", "application" ]
def createMenuBar(self): self.menu=Menu(self.main) self.file_menu={'01Open models file':{'cmd':self.loadModelsFile}, '02Quit':{'cmd':self.quit}} self.file_menu=self.create_pulldown(self.menu,self.file_menu) self.menu.add_cascade(label='File...
[ "def", "createMenuBar", "(", "self", ")", ":", "self", ".", "menu", "=", "Menu", "(", "self", ".", "main", ")", "self", ".", "file_menu", "=", "{", "'01Open models file'", ":", "{", "'cmd'", ":", "self", ".", "loadModelsFile", "}", ",", "'02Quit'", ":"...
Create the menu bar for the application
[ "Create", "the", "menu", "bar", "for", "the", "application" ]
[ "\"\"\"Create the menu bar for the application\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
7c2be94cbbaa8b0c24ff0825579604c3f9495d6b
shambo001/peat
PEATDB/Ekin/ModelDesign.py
[ "MIT" ]
Python
updateModelsDict
<not_specific>
def updateModelsDict(self): """Send the current model to the dict""" name = self.currentname self.modelselector.setvalue(name) self.modelsdict[name] = self.currentmodel return
Send the current model to the dict
Send the current model to the dict
[ "Send", "the", "current", "model", "to", "the", "dict" ]
def updateModelsDict(self): name = self.currentname self.modelselector.setvalue(name) self.modelsdict[name] = self.currentmodel return
[ "def", "updateModelsDict", "(", "self", ")", ":", "name", "=", "self", ".", "currentname", "self", ".", "modelselector", ".", "setvalue", "(", "name", ")", "self", ".", "modelsdict", "[", "name", "]", "=", "self", ".", "currentmodel", "return" ]
Send the current model to the dict
[ "Send", "the", "current", "model", "to", "the", "dict" ]
[ "\"\"\"Send the current model to the dict\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
7c2be94cbbaa8b0c24ff0825579604c3f9495d6b
shambo001/peat
PEATDB/Ekin/ModelDesign.py
[ "MIT" ]
Python
saveAs
<not_specific>
def saveAs(self): """Save current models as a new file""" self.filename = None self.save() return
Save current models as a new file
Save current models as a new file
[ "Save", "current", "models", "as", "a", "new", "file" ]
def saveAs(self): self.filename = None self.save() return
[ "def", "saveAs", "(", "self", ")", ":", "self", ".", "filename", "=", "None", "self", ".", "save", "(", ")", "return" ]
Save current models as a new file
[ "Save", "current", "models", "as", "a", "new", "file" ]
[ "\"\"\"Save current models as a new file\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
7c2be94cbbaa8b0c24ff0825579604c3f9495d6b
shambo001/peat
PEATDB/Ekin/ModelDesign.py
[ "MIT" ]
Python
loadModelsFile
<not_specific>
def loadModelsFile(self, filename=None): """Load a dict of models, the pickled format from Ekin""" if filename==None: filename=tkFileDialog.askopenfilename(defaultextension='.dict', initialdir=os.getcwd(), ...
Load a dict of models, the pickled format from Ekin
Load a dict of models, the pickled format from Ekin
[ "Load", "a", "dict", "of", "models", "the", "pickled", "format", "from", "Ekin" ]
def loadModelsFile(self, filename=None): if filename==None: filename=tkFileDialog.askopenfilename(defaultextension='.dict', initialdir=os.getcwd(), filetypes=[("dict files","*.dict"), ...
[ "def", "loadModelsFile", "(", "self", ",", "filename", "=", "None", ")", ":", "if", "filename", "==", "None", ":", "filename", "=", "tkFileDialog", ".", "askopenfilename", "(", "defaultextension", "=", "'.dict'", ",", "initialdir", "=", "os", ".", "getcwd", ...
Load a dict of models, the pickled format from Ekin
[ "Load", "a", "dict", "of", "models", "the", "pickled", "format", "from", "Ekin" ]
[ "\"\"\"Load a dict of models, the pickled format from Ekin\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "filename", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "filename", "type": null, "docstring": null, "docstring_tokens...
7c2be94cbbaa8b0c24ff0825579604c3f9495d6b
shambo001/peat
PEATDB/Ekin/ModelDesign.py
[ "MIT" ]
Python
updateGuessEntryWidgets
<not_specific>
def updateGuessEntryWidgets(self, model): """Update guess entry widget, special case as guess vals are in a dict""" for v in self.guessentrywidgets.keys()[:]: w = self.guessentrywidgets[v] del self.guessentrywidgets[v] w.forget() if not model.has...
Update guess entry widget, special case as guess vals are in a dict
Update guess entry widget, special case as guess vals are in a dict
[ "Update", "guess", "entry", "widget", "special", "case", "as", "guess", "vals", "are", "in", "a", "dict" ]
def updateGuessEntryWidgets(self, model): for v in self.guessentrywidgets.keys()[:]: w = self.guessentrywidgets[v] del self.guessentrywidgets[v] w.forget() if not model.has_key('guess') or not type(model) is types.DictType: model['guess'] = {} fr =...
[ "def", "updateGuessEntryWidgets", "(", "self", ",", "model", ")", ":", "for", "v", "in", "self", ".", "guessentrywidgets", ".", "keys", "(", ")", "[", ":", "]", ":", "w", "=", "self", ".", "guessentrywidgets", "[", "v", "]", "del", "self", ".", "gues...
Update guess entry widget, special case as guess vals are in a dict
[ "Update", "guess", "entry", "widget", "special", "case", "as", "guess", "vals", "are", "in", "a", "dict" ]
[ "\"\"\"Update guess entry widget, special case as guess vals are in\n a dict\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "model", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "model", "type": null, "docstring": null, "docstring_tokens": ...
7c2be94cbbaa8b0c24ff0825579604c3f9495d6b
shambo001/peat
PEATDB/Ekin/ModelDesign.py
[ "MIT" ]
Python
loadModel
<not_specific>
def loadModel(self, sel=None): """Load a model from the current dict""" #add confirmation dialog here if sel == None: self.currentname = sel = self.modelselector.getcurselection()[0] self.currentmodel = model = self.modelsdict[sel] for f in model: if f in...
Load a model from the current dict
Load a model from the current dict
[ "Load", "a", "model", "from", "the", "current", "dict" ]
def loadModel(self, sel=None): if sel == None: self.currentname = sel = self.modelselector.getcurselection()[0] self.currentmodel = model = self.modelsdict[sel] for f in model: if f in self.entrywidgets: self.entrywidgets[f].settext(model[f]) self....
[ "def", "loadModel", "(", "self", ",", "sel", "=", "None", ")", ":", "if", "sel", "==", "None", ":", "self", ".", "currentname", "=", "sel", "=", "self", ".", "modelselector", ".", "getcurselection", "(", ")", "[", "0", "]", "self", ".", "currentmodel...
Load a model from the current dict
[ "Load", "a", "model", "from", "the", "current", "dict" ]
[ "\"\"\"Load a model from the current dict\"\"\"", "#add confirmation dialog here" ]
[ { "param": "self", "type": null }, { "param": "sel", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "sel", "type": null, "docstring": null, "docstring_tokens": []...
7c2be94cbbaa8b0c24ff0825579604c3f9495d6b
shambo001/peat
PEATDB/Ekin/ModelDesign.py
[ "MIT" ]
Python
createFitter
<not_specific>
def createFitter(self, model, name): """Create fitter from the current model entry values""" fitclass = Fitting.createClass(**model) x,y = self.previewer.getCurrentData() X = fitclass(exp_data=zip(x,y),variables=None, callback=self.previewer.updateFit, ...
Create fitter from the current model entry values
Create fitter from the current model entry values
[ "Create", "fitter", "from", "the", "current", "model", "entry", "values" ]
def createFitter(self, model, name): fitclass = Fitting.createClass(**model) x,y = self.previewer.getCurrentData() X = fitclass(exp_data=zip(x,y),variables=None, callback=self.previewer.updateFit, name=name) return X
[ "def", "createFitter", "(", "self", ",", "model", ",", "name", ")", ":", "fitclass", "=", "Fitting", ".", "createClass", "(", "**", "model", ")", "x", ",", "y", "=", "self", ".", "previewer", ".", "getCurrentData", "(", ")", "X", "=", "fitclass", "("...
Create fitter from the current model entry values
[ "Create", "fitter", "from", "the", "current", "model", "entry", "values" ]
[ "\"\"\"Create fitter from the current model entry values\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "model", "type": null }, { "param": "name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "model", "type": null, "docstring": null, "docstring_tokens": ...
7c2be94cbbaa8b0c24ff0825579604c3f9495d6b
shambo001/peat
PEATDB/Ekin/ModelDesign.py
[ "MIT" ]
Python
testFitter
<not_specific>
def testFitter(self): """Parse the entry fields and create the fitter""" self.currentmodel = self.parseValues() X = self.createFitter(self.currentmodel, self.currentname) X.guess_start() if self.previewer.plotfunctionvar.get() == 1: self.previewer.plotframe.clearData(...
Parse the entry fields and create the fitter
Parse the entry fields and create the fitter
[ "Parse", "the", "entry", "fields", "and", "create", "the", "fitter" ]
def testFitter(self): self.currentmodel = self.parseValues() X = self.createFitter(self.currentmodel, self.currentname) X.guess_start() if self.previewer.plotfunctionvar.get() == 1: self.previewer.plotframe.clearData() self.previewer.plotframe.updateFit(X, showfit...
[ "def", "testFitter", "(", "self", ")", ":", "self", ".", "currentmodel", "=", "self", ".", "parseValues", "(", ")", "X", "=", "self", ".", "createFitter", "(", "self", ".", "currentmodel", ",", "self", ".", "currentname", ")", "X", ".", "guess_start", ...
Parse the entry fields and create the fitter
[ "Parse", "the", "entry", "fields", "and", "create", "the", "fitter" ]
[ "\"\"\"Parse the entry fields and create the fitter\"\"\"", "#update the global fitting models since the plotter uses them" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
7c2be94cbbaa8b0c24ff0825579604c3f9495d6b
shambo001/peat
PEATDB/Ekin/ModelDesign.py
[ "MIT" ]
Python
findBestModel
<not_specific>
def findBestModel(self): """Determine best fit model using SS F-test""" models = self.modelselector.getcurselection() if len(models)<2: print 'select 2 or more models' return fitters= [] for m in models: model = self.modelsdict[m] X...
Determine best fit model using SS F-test
Determine best fit model using SS F-test
[ "Determine", "best", "fit", "model", "using", "SS", "F", "-", "test" ]
def findBestModel(self): models = self.modelselector.getcurselection() if len(models)<2: print 'select 2 or more models' return fitters= [] for m in models: model = self.modelsdict[m] X = self.createFitter(model, m) fitters.appe...
[ "def", "findBestModel", "(", "self", ")", ":", "models", "=", "self", ".", "modelselector", ".", "getcurselection", "(", ")", "if", "len", "(", "models", ")", "<", "2", ":", "print", "'select 2 or more models'", "return", "fitters", "=", "[", "]", "for", ...
Determine best fit model using SS F-test
[ "Determine", "best", "fit", "model", "using", "SS", "F", "-", "test" ]
[ "\"\"\"Determine best fit model using SS F-test\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
7c2be94cbbaa8b0c24ff0825579604c3f9495d6b
shambo001/peat
PEATDB/Ekin/ModelDesign.py
[ "MIT" ]
Python
parseValues
<not_specific>
def parseValues(self): """Parse model entry and create a new fitter""" model = {} for f in self.entrywidgets: model[f] = str(self.entrywidgets[f].get().rstrip()) model['guess']={} for v in self.guessentrywidgets: val = str(self.guessentrywidgets[v].get().r...
Parse model entry and create a new fitter
Parse model entry and create a new fitter
[ "Parse", "model", "entry", "and", "create", "a", "new", "fitter" ]
def parseValues(self): model = {} for f in self.entrywidgets: model[f] = str(self.entrywidgets[f].get().rstrip()) model['guess']={} for v in self.guessentrywidgets: val = str(self.guessentrywidgets[v].get().rstrip()) if val != '': model...
[ "def", "parseValues", "(", "self", ")", ":", "model", "=", "{", "}", "for", "f", "in", "self", ".", "entrywidgets", ":", "model", "[", "f", "]", "=", "str", "(", "self", ".", "entrywidgets", "[", "f", "]", ".", "get", "(", ")", ".", "rstrip", "...
Parse model entry and create a new fitter
[ "Parse", "model", "entry", "and", "create", "a", "new", "fitter" ]
[ "\"\"\"Parse model entry and create a new fitter\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
7c2be94cbbaa8b0c24ff0825579604c3f9495d6b
shambo001/peat
PEATDB/Ekin/ModelDesign.py
[ "MIT" ]
Python
findBestModel
<not_specific>
def findBestModel(self, models, callback=None): """Determine best fit model using SS F-test""" dset = self.datasets[self.dsindex] ek = self.E.getDataset(dset) fitdata,p = Fitting.findBestModel(ek, models=models, silent=True) best = fitdata['model'] text = 'Best model is %...
Determine best fit model using SS F-test
Determine best fit model using SS F-test
[ "Determine", "best", "fit", "model", "using", "SS", "F", "-", "test" ]
def findBestModel(self, models, callback=None): dset = self.datasets[self.dsindex] ek = self.E.getDataset(dset) fitdata,p = Fitting.findBestModel(ek, models=models, silent=True) best = fitdata['model'] text = 'Best model is %s with p value=%2.2e' %(best,p) tkMessageBox.sh...
[ "def", "findBestModel", "(", "self", ",", "models", ",", "callback", "=", "None", ")", ":", "dset", "=", "self", ".", "datasets", "[", "self", ".", "dsindex", "]", "ek", "=", "self", ".", "E", ".", "getDataset", "(", "dset", ")", "fitdata", ",", "p...
Determine best fit model using SS F-test
[ "Determine", "best", "fit", "model", "using", "SS", "F", "-", "test" ]
[ "\"\"\"Determine best fit model using SS F-test\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "models", "type": null }, { "param": "callback", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "models", "type": null, "docstring": null, "docstring_tokens":...
74ca0e3b46d1225a4d9fe1f100c70cf2b65e0795
shambo001/peat
FFF/scripts/Correlation_plots.py
[ "MIT" ]
Python
pkavalues
<not_specific>
def pkavalues(self,numpoints,nucleus='N'): """Make a plot of experimental values including their estimated errors""" # # pKa value shifts range from <-4 -> +4 with an error of 0.5 units # import numpy xs=[] ys=[] error={'N':0.5,'C':0.1,'HN':0.5,'H':0.2} ...
Make a plot of experimental values including their estimated errors
Make a plot of experimental values including their estimated errors
[ "Make", "a", "plot", "of", "experimental", "values", "including", "their", "estimated", "errors" ]
def pkavalues(self,numpoints,nucleus='N'): pKa value shifts range from <-4 -> +4 with an error of 0.5 units import numpy xs=[] ys=[] error={'N':0.5,'C':0.1,'HN':0.5,'H':0.2} cols={'N':'b','C':'c','H':'g','HN':'k'} for count in range(numpoints): import...
[ "def", "pkavalues", "(", "self", ",", "numpoints", ",", "nucleus", "=", "'N'", ")", ":", "import", "numpy", "xs", "=", "[", "]", "ys", "=", "[", "]", "error", "=", "{", "'N'", ":", "0.5", ",", "'C'", ":", "0.1", ",", "'HN'", ":", "0.5", ",", ...
Make a plot of experimental values including their estimated errors
[ "Make", "a", "plot", "of", "experimental", "values", "including", "their", "estimated", "errors" ]
[ "\"\"\"Make a plot of experimental values including their estimated errors\"\"\"", "#", "# pKa value shifts range from <-4 -> +4 with an error of 0.5 units", "#" ]
[ { "param": "self", "type": null }, { "param": "numpoints", "type": null }, { "param": "nucleus", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "numpoints", "type": null, "docstring": null, "docstring_token...
74ca0e3b46d1225a4d9fe1f100c70cf2b65e0795
shambo001/peat
FFF/scripts/Correlation_plots.py
[ "MIT" ]
Python
intenes
<not_specific>
def intenes(self,numpoints): """Electrostatic interaction energies from GloFTE fits""" import numpy xs=[] ys=[] for count in range(numpoints): import random intene=random.normalvariate(0.0,1.0) inteney=intene+random.normalvariate(0.0, 0.25) ...
Electrostatic interaction energies from GloFTE fits
Electrostatic interaction energies from GloFTE fits
[ "Electrostatic", "interaction", "energies", "from", "GloFTE", "fits" ]
def intenes(self,numpoints): import numpy xs=[] ys=[] for count in range(numpoints): import random intene=random.normalvariate(0.0,1.0) inteney=intene+random.normalvariate(0.0, 0.25) ys.append(intene*kT) xs.append(inteney*kT) ...
[ "def", "intenes", "(", "self", ",", "numpoints", ")", ":", "import", "numpy", "xs", "=", "[", "]", "ys", "=", "[", "]", "for", "count", "in", "range", "(", "numpoints", ")", ":", "import", "random", "intene", "=", "random", ".", "normalvariate", "(",...
Electrostatic interaction energies from GloFTE fits
[ "Electrostatic", "interaction", "energies", "from", "GloFTE", "fits" ]
[ "\"\"\"Electrostatic interaction energies from GloFTE fits\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "numpoints", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "numpoints", "type": null, "docstring": null, "docstring_token...
74ca0e3b46d1225a4d9fe1f100c70cf2b65e0795
shambo001/peat
FFF/scripts/Correlation_plots.py
[ "MIT" ]
Python
dpkas
<not_specific>
def dpkas(self,numpoints): """Electrostatic interaction energies from GloFTE fits""" import numpy xs=[] ys=[] for count in range(numpoints): import random intene=random.normalvariate(0.0,0.3) inteney=intene+random.normalvariate(0.0, 0.05) ...
Electrostatic interaction energies from GloFTE fits
Electrostatic interaction energies from GloFTE fits
[ "Electrostatic", "interaction", "energies", "from", "GloFTE", "fits" ]
def dpkas(self,numpoints): import numpy xs=[] ys=[] for count in range(numpoints): import random intene=random.normalvariate(0.0,0.3) inteney=intene+random.normalvariate(0.0, 0.05) ys.append(intene*math.log(10)*kT) xs.append(int...
[ "def", "dpkas", "(", "self", ",", "numpoints", ")", ":", "import", "numpy", "xs", "=", "[", "]", "ys", "=", "[", "]", "for", "count", "in", "range", "(", "numpoints", ")", ":", "import", "random", "intene", "=", "random", ".", "normalvariate", "(", ...
Electrostatic interaction energies from GloFTE fits
[ "Electrostatic", "interaction", "energies", "from", "GloFTE", "fits" ]
[ "\"\"\"Electrostatic interaction energies from GloFTE fits\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "numpoints", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "numpoints", "type": null, "docstring": null, "docstring_token...
5709432b40f54af4a03b1786b0d11ce2d8524aa2
shambo001/peat
pKa/pKa_mutscan.py
[ "MIT" ]
Python
local_defaults
<not_specific>
def local_defaults(pdbfile,target_residues,recalc_intpka): """ # Set the parameters that are the same for all mutations """ import pKa.Design_pKa as Design_pKa defaults=Design_pKa.get_defaults() # PDB file defaults['pdb'][0]=pdbfile # # pKa calculation parameters # #defaults[...
# Set the parameters that are the same for all mutations
Set the parameters that are the same for all mutations
[ "Set", "the", "parameters", "that", "are", "the", "same", "for", "all", "mutations" ]
def local_defaults(pdbfile,target_residues,recalc_intpka): import pKa.Design_pKa as Design_pKa defaults=Design_pKa.get_defaults() defaults['pdb'][0]=pdbfile pKa calculation parameters defaults['pHstart'][0]=0.1 defaults['pHstop'][0]=12.0 defaults['pHstep'][0]=0.01 defaults['pKMCsteps'][...
[ "def", "local_defaults", "(", "pdbfile", ",", "target_residues", ",", "recalc_intpka", ")", ":", "import", "pKa", ".", "Design_pKa", "as", "Design_pKa", "defaults", "=", "Design_pKa", ".", "get_defaults", "(", ")", "defaults", "[", "'pdb'", "]", "[", "0", "]...
Set the parameters that are the same for all mutations
[ "Set", "the", "parameters", "that", "are", "the", "same", "for", "all", "mutations" ]
[ "\"\"\"\n # Set the parameters that are the same for all mutations\n \"\"\"", "# PDB file", "#", "# pKa calculation parameters", "#", "#defaults['pHstart'][0]=0.1", "#defaults['pHstop'][0]=12.0", "#", "# Design settings", "#", "# Target", "#", "#target_residues=target_residues.split(',...
[ { "param": "pdbfile", "type": null }, { "param": "target_residues", "type": null }, { "param": "recalc_intpka", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "pdbfile", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "target_residues", "type": null, "docstring": null, "docstr...
5709432b40f54af4a03b1786b0d11ce2d8524aa2
shambo001/peat
pKa/pKa_mutscan.py
[ "MIT" ]
Python
main
null
def main(options,args): """Load the PDB file and the list of mutations""" import sys pdbfile=args[0] target_residues=options.target_groups # # Load the PDB file # import Protool P=Protool.structureIO() P.readpdb(pdbfile) residues=P.residues.keys() residues.sort() if n...
Load the PDB file and the list of mutations
Load the PDB file and the list of mutations
[ "Load", "the", "PDB", "file", "and", "the", "list", "of", "mutations" ]
def main(options,args): import sys pdbfile=args[0] target_residues=options.target_groups Load the PDB file import Protool P=Protool.structureIO() P.readpdb(pdbfile) residues=P.residues.keys() residues.sort() if not options.allmutations: Load the mutations mutfil...
[ "def", "main", "(", "options", ",", "args", ")", ":", "import", "sys", "pdbfile", "=", "args", "[", "0", "]", "target_residues", "=", "options", ".", "target_groups", "import", "Protool", "P", "=", "Protool", ".", "structureIO", "(", ")", "P", ".", "re...
Load the PDB file and the list of mutations
[ "Load", "the", "PDB", "file", "and", "the", "list", "of", "mutations" ]
[ "\"\"\"Load the PDB file and the list of mutations\"\"\"", "#", "# Load the PDB file", "#", "#", "# Load the mutations", "#", "#", "# Make the resultdir", "#", "#", "# which target residues", "#", "#", "#", "# Define result filename", "#", "#print 'Already did',mutation", "#", ...
[ { "param": "options", "type": null }, { "param": "args", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "options", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "args", "type": null, "docstring": null, "docstring_tokens"...
151a8ccd1c9acae0d75e0b779534a291e23b4266
shambo001/peat
pKaTool/activity_fit/fit_pHact_J.py
[ "MIT" ]
Python
activity_diff
<not_specific>
def activity_diff(self): """Get the sum of differences between exp data and fitted data""" act_prof_and_tc = self.get_act_prof() diff = 0.0 for ph,act in self.exp_data: diff = diff + abs(act_prof_and_tc[ph]-act) return diff
Get the sum of differences between exp data and fitted data
Get the sum of differences between exp data and fitted data
[ "Get", "the", "sum", "of", "differences", "between", "exp", "data", "and", "fitted", "data" ]
def activity_diff(self): act_prof_and_tc = self.get_act_prof() diff = 0.0 for ph,act in self.exp_data: diff = diff + abs(act_prof_and_tc[ph]-act) return diff
[ "def", "activity_diff", "(", "self", ")", ":", "act_prof_and_tc", "=", "self", ".", "get_act_prof", "(", ")", "diff", "=", "0.0", "for", "ph", ",", "act", "in", "self", ".", "exp_data", ":", "diff", "=", "diff", "+", "abs", "(", "act_prof_and_tc", "[",...
Get the sum of differences between exp data and fitted data
[ "Get", "the", "sum", "of", "differences", "between", "exp", "data", "and", "fitted", "data" ]
[ "\"\"\"Get the sum of differences between exp data and fitted data\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
151a8ccd1c9acae0d75e0b779534a291e23b4266
shambo001/peat
pKaTool/activity_fit/fit_pHact_J.py
[ "MIT" ]
Python
align_parms
<not_specific>
def align_parms(self,solutions): """Sort the solutions so parameters are shifted around to give optimal overlap This only works well for 3-group systems (and perhaps not even for them)""" solutions.sort() ref_sol=solutions[0][1] aligned_sols=[solutions[0]] for score,varia...
Sort the solutions so parameters are shifted around to give optimal overlap This only works well for 3-group systems (and perhaps not even for them)
Sort the solutions so parameters are shifted around to give optimal overlap This only works well for 3-group systems (and perhaps not even for them)
[ "Sort", "the", "solutions", "so", "parameters", "are", "shifted", "around", "to", "give", "optimal", "overlap", "This", "only", "works", "well", "for", "3", "-", "group", "systems", "(", "and", "perhaps", "not", "even", "for", "them", ")" ]
def align_parms(self,solutions): solutions.sort() ref_sol=solutions[0][1] aligned_sols=[solutions[0]] for score,variables,profile,CCPS_def,groups,start_values,start_scores in solutions[1:]: best_vars=variables[:] diff=self.get_similarity(variables,ref_sol) ...
[ "def", "align_parms", "(", "self", ",", "solutions", ")", ":", "solutions", ".", "sort", "(", ")", "ref_sol", "=", "solutions", "[", "0", "]", "[", "1", "]", "aligned_sols", "=", "[", "solutions", "[", "0", "]", "]", "for", "score", ",", "variables",...
Sort the solutions so parameters are shifted around to give optimal overlap This only works well for 3-group systems (and perhaps not even for them)
[ "Sort", "the", "solutions", "so", "parameters", "are", "shifted", "around", "to", "give", "optimal", "overlap", "This", "only", "works", "well", "for", "3", "-", "group", "systems", "(", "and", "perhaps", "not", "even", "for", "them", ")" ]
[ "\"\"\"Sort the solutions so parameters are shifted around to give optimal overlap\n This only works well for 3-group systems (and perhaps not even for them)\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "solutions", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "solutions", "type": null, "docstring": null, "docstring_token...
151a8ccd1c9acae0d75e0b779534a291e23b4266
shambo001/peat
pKaTool/activity_fit/fit_pHact_J.py
[ "MIT" ]
Python
permute
<not_specific>
def permute(self,variables,numgroups): """Construct a permutation of variables that is consistent with the geometry of the system""" groups=[] intpkas={} matrix={} count=0 for group in range(numgroups): groups.append(group) intpkas[group]=variables...
Construct a permutation of variables that is consistent with the geometry of the system
Construct a permutation of variables that is consistent with the geometry of the system
[ "Construct", "a", "permutation", "of", "variables", "that", "is", "consistent", "with", "the", "geometry", "of", "the", "system" ]
def permute(self,variables,numgroups): groups=[] intpkas={} matrix={} count=0 for group in range(numgroups): groups.append(group) intpkas[group]=variables[count] count=count+1 for group1 in groups: matrix[group1]={} ...
[ "def", "permute", "(", "self", ",", "variables", ",", "numgroups", ")", ":", "groups", "=", "[", "]", "intpkas", "=", "{", "}", "matrix", "=", "{", "}", "count", "=", "0", "for", "group", "in", "range", "(", "numgroups", ")", ":", "groups", ".", ...
Construct a permutation of variables that is consistent with the geometry of the system
[ "Construct", "a", "permutation", "of", "variables", "that", "is", "consistent", "with", "the", "geometry", "of", "the", "system" ]
[ "\"\"\"Construct a permutation of variables that is consistent with the geometry of the system\"\"\"", "# Matrix", "#", "# permute so that group1 becomes last. subtract 1 from all other group numbers", "#", "# Matrix" ]
[ { "param": "self", "type": null }, { "param": "variables", "type": null }, { "param": "numgroups", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "variables", "type": null, "docstring": null, "docstring_token...
ab93463bc387a627ed8c4f2b9eeba00b5c46d1e5
shambo001/peat
PEATDB/DNAtool/mutation.py
[ "MIT" ]
Python
parse_REBASE
<not_specific>
def parse_REBASE(self,lines): """Parse a REBASE restriction enzyme file""" count=1 while 1: while (lines[count][:3]!='<1>' or lines[count][3]=='<') and count+1<len(lines): count=count+1 if not count+1<len(lines): return # ...
Parse a REBASE restriction enzyme file
Parse a REBASE restriction enzyme file
[ "Parse", "a", "REBASE", "restriction", "enzyme", "file" ]
def parse_REBASE(self,lines): count=1 while 1: while (lines[count][:3]!='<1>' or lines[count][3]=='<') and count+1<len(lines): count=count+1 if not count+1<len(lines): return At start of record name=lines[count][3:].strip()...
[ "def", "parse_REBASE", "(", "self", ",", "lines", ")", ":", "count", "=", "1", "while", "1", ":", "while", "(", "lines", "[", "count", "]", "[", ":", "3", "]", "!=", "'<1>'", "or", "lines", "[", "count", "]", "[", "3", "]", "==", "'<'", ")", ...
Parse a REBASE restriction enzyme file
[ "Parse", "a", "REBASE", "restriction", "enzyme", "file" ]
[ "\"\"\"Parse a REBASE restriction enzyme file\"\"\"", "#", "# At start of record", "#" ]
[ { "param": "self", "type": null }, { "param": "lines", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "lines", "type": null, "docstring": null, "docstring_tokens": ...
ab93463bc387a627ed8c4f2b9eeba00b5c46d1e5
shambo001/peat
PEATDB/DNAtool/mutation.py
[ "MIT" ]
Python
check_DNA
<not_specific>
def check_DNA(DNA_sequence): """Check that we have a DNA sequence without junk""" # import string # Remove all spaces DNA_sequence=string.replace(DNA_sequence,' ','') # Upper case DNA_sequence=string.upper(DNA_sequence) # Check that we only have DNA bases in the seq ok=1 garbage=...
Check that we have a DNA sequence without junk
Check that we have a DNA sequence without junk
[ "Check", "that", "we", "have", "a", "DNA", "sequence", "without", "junk" ]
def check_DNA(DNA_sequence): import string Remove all spaces DNA_sequence=string.replace(DNA_sequence,' ','') Upper case DNA_sequence=string.upper(DNA_sequence) Check that we only have DNA bases in the seq ok=1 garbage={} DNA_bases=['A','G','C','T'] for letter in DNA_sequence:...
[ "def", "check_DNA", "(", "DNA_sequence", ")", ":", "import", "string", "DNA_sequence", "=", "string", ".", "replace", "(", "DNA_sequence", ",", "' '", ",", "''", ")", "DNA_sequence", "=", "string", ".", "upper", "(", "DNA_sequence", ")", "ok", "=", "1", ...
Check that we have a DNA sequence without junk
[ "Check", "that", "we", "have", "a", "DNA", "sequence", "without", "junk" ]
[ "\"\"\"Check that we have a DNA sequence without junk\"\"\"", "#", "# Remove all spaces", "# Upper case", "# Check that we only have DNA bases in the seq" ]
[ { "param": "DNA_sequence", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "DNA_sequence", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
ab93463bc387a627ed8c4f2b9eeba00b5c46d1e5
shambo001/peat
PEATDB/DNAtool/mutation.py
[ "MIT" ]
Python
translate
<not_specific>
def translate(DNA_sequence): """Translate the DNA sequence in three forward frames""" # # Check the sequence first # ok,DNA_sequence=check_DNA(DNA_sequence) if not ok: print print 'DNA sequence not ok' print DNA_sequence print return None # # Trans...
Translate the DNA sequence in three forward frames
Translate the DNA sequence in three forward frames
[ "Translate", "the", "DNA", "sequence", "in", "three", "forward", "frames" ]
def translate(DNA_sequence): Check the sequence first ok,DNA_sequence=check_DNA(DNA_sequence) if not ok: print print 'DNA sequence not ok' print DNA_sequence print return None Translate import string translation_3=[] translation_1=[] for start in...
[ "def", "translate", "(", "DNA_sequence", ")", ":", "ok", ",", "DNA_sequence", "=", "check_DNA", "(", "DNA_sequence", ")", "if", "not", "ok", ":", "print", "print", "'DNA sequence not ok'", "print", "DNA_sequence", "print", "return", "None", "import", "string", ...
Translate the DNA sequence in three forward frames
[ "Translate", "the", "DNA", "sequence", "in", "three", "forward", "frames" ]
[ "\"\"\"Translate the DNA sequence in three forward frames\"\"\"", "#", "# Check the sequence first", "#", "#", "# Translate", "#" ]
[ { "param": "DNA_sequence", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "DNA_sequence", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
ab93463bc387a627ed8c4f2b9eeba00b5c46d1e5
shambo001/peat
PEATDB/DNAtool/mutation.py
[ "MIT" ]
Python
exhaustive_research
<not_specific>
def exhaustive_research(DNA_sequence,AA_number,NewAA,Tm_desired,Tm_method,enzyme_list=None, parent=None,primer_max_len=30,find_restriction_site=None): """Generate a primer for introducing the required mutation by generating all possible DNA_sequences that will produce the amino acid sequ...
Generate a primer for introducing the required mutation by generating all possible DNA_sequences that will produce the amino acid sequence, and then scoring all of them for Tm, number of mismatches and restriction sites introduced
Generate a primer for introducing the required mutation by generating all possible DNA_sequences that will produce the amino acid sequence, and then scoring all of them for Tm, number of mismatches and restriction sites introduced
[ "Generate", "a", "primer", "for", "introducing", "the", "required", "mutation", "by", "generating", "all", "possible", "DNA_sequences", "that", "will", "produce", "the", "amino", "acid", "sequence", "and", "then", "scoring", "all", "of", "them", "for", "Tm", "...
def exhaustive_research(DNA_sequence,AA_number,NewAA,Tm_desired,Tm_method,enzyme_list=None, parent=None,primer_max_len=30,find_restriction_site=None): Make the mutation in the DNA codons=get_codons(NewAA) base_position=(AA_number-1)*3 mut_DNA=DNA_sequence[:base_position]+'XXX'+D...
[ "def", "exhaustive_research", "(", "DNA_sequence", ",", "AA_number", ",", "NewAA", ",", "Tm_desired", ",", "Tm_method", ",", "enzyme_list", "=", "None", ",", "parent", "=", "None", ",", "primer_max_len", "=", "30", ",", "find_restriction_site", "=", "None", ")...
Generate a primer for introducing the required mutation by generating all possible DNA_sequences that will produce the amino acid sequence, and then scoring all of them for Tm, number of mismatches and restriction sites introduced
[ "Generate", "a", "primer", "for", "introducing", "the", "required", "mutation", "by", "generating", "all", "possible", "DNA_sequences", "that", "will", "produce", "the", "amino", "acid", "sequence", "and", "then", "scoring", "all", "of", "them", "for", "Tm", "...
[ "\"\"\"Generate a primer for introducing the required mutation by generating all possible DNA_sequences\n that will produce the amino acid sequence, and then scoring all of them for Tm, number of mismatches and\n restriction sites introduced\"\"\"", "#", "# Make the mutation in the DNA", "#", "#", "...
[ { "param": "DNA_sequence", "type": null }, { "param": "AA_number", "type": null }, { "param": "NewAA", "type": null }, { "param": "Tm_desired", "type": null }, { "param": "Tm_method", "type": null }, { "param": "enzyme_list", "type": null }, { ...
{ "returns": [], "raises": [], "params": [ { "identifier": "DNA_sequence", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "AA_number", "type": null, "docstring": null, "docstri...
d003f523b967f023d9ee85c1592a6018b82fbfb7
shambo001/peat
pKaTool/stab_fit/Double_mutant.py
[ "MIT" ]
Python
doublemuts
<not_specific>
def doublemuts(self,stabdata,pKa_values): """Find all double mutant cycles and analyze them as a function of pH""" # # Standardize the names # for key in stabdata.keys(): muts=key.split('+') import string muts=string.join(sorted(muts),'+') ...
Find all double mutant cycles and analyze them as a function of pH
Find all double mutant cycles and analyze them as a function of pH
[ "Find", "all", "double", "mutant", "cycles", "and", "analyze", "them", "as", "a", "function", "of", "pH" ]
def doublemuts(self,stabdata,pKa_values): Standardize the names for key in stabdata.keys(): muts=key.split('+') import string muts=string.join(sorted(muts),'+') stabdata[muts]=stabdata[key] dbl_cycles=self.find_double_mutants(stabdata.keys()) ...
[ "def", "doublemuts", "(", "self", ",", "stabdata", ",", "pKa_values", ")", ":", "for", "key", "in", "stabdata", ".", "keys", "(", ")", ":", "muts", "=", "key", ".", "split", "(", "'+'", ")", "import", "string", "muts", "=", "string", ".", "join", "...
Find all double mutant cycles and analyze them as a function of pH
[ "Find", "all", "double", "mutant", "cycles", "and", "analyze", "them", "as", "a", "function", "of", "pH" ]
[ "\"\"\"Find all double mutant cycles and analyze them as a function of pH\"\"\"", "#", "# Standardize the names", "#", "#" ]
[ { "param": "self", "type": null }, { "param": "stabdata", "type": null }, { "param": "pKa_values", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "stabdata", "type": null, "docstring": null, "docstring_tokens...
d003f523b967f023d9ee85c1592a6018b82fbfb7
shambo001/peat
pKaTool/stab_fit/Double_mutant.py
[ "MIT" ]
Python
find_double_mutants
<not_specific>
def find_double_mutants(self,mutants): """Find all double mutant cycles in a list of mutants""" dbl_muts=[] sorted_muts=[] for prot in mutants: import string muts=sorted(prot.split('+')) if not 'wt' in muts: muts.append('wt') ...
Find all double mutant cycles in a list of mutants
Find all double mutant cycles in a list of mutants
[ "Find", "all", "double", "mutant", "cycles", "in", "a", "list", "of", "mutants" ]
def find_double_mutants(self,mutants): dbl_muts=[] sorted_muts=[] for prot in mutants: import string muts=sorted(prot.split('+')) if not 'wt' in muts: muts.append('wt') muts.sort() sorted_muts.append(string.join(muts...
[ "def", "find_double_mutants", "(", "self", ",", "mutants", ")", ":", "dbl_muts", "=", "[", "]", "sorted_muts", "=", "[", "]", "for", "prot", "in", "mutants", ":", "import", "string", "muts", "=", "sorted", "(", "prot", ".", "split", "(", "'+'", ")", ...
Find all double mutant cycles in a list of mutants
[ "Find", "all", "double", "mutant", "cycles", "in", "a", "list", "of", "mutants" ]
[ "\"\"\"Find all double mutant cycles in a list of mutants\"\"\"", "#sorted_muts.append('')", "#", "# Now all mutants are sorted, then we try to split all possible ways", "#", "# ", "# Make sure all are different", "#", "#", "# Check that all mutations exist", "#", "#", "# Everything is ok. N...
[ { "param": "self", "type": null }, { "param": "mutants", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "mutants", "type": null, "docstring": null, "docstring_tokens"...
b53151bf5836e1f0bec599f702f64457192a34bc
shambo001/peat
pKarun/WI_tools.py
[ "MIT" ]
Python
do_fulchk
<not_specific>
def do_fulchk(pdbfile): """Run a fulchk on a pdbfile""" import tempfile, os topdir=os.getcwd() tdir=tempfile.mkdtemp(dir=topdir) import shutil pdbname=os.path.join(tdir,os.path.split(pdbfile)[1]) shutil.copyfile(pdbfile,pdbname) # os.chdir(tdir) newpdb=pdbname+'_delhyd' # Fir...
Run a fulchk on a pdbfile
Run a fulchk on a pdbfile
[ "Run", "a", "fulchk", "on", "a", "pdbfile" ]
def do_fulchk(pdbfile): import tempfile, os topdir=os.getcwd() tdir=tempfile.mkdtemp(dir=topdir) import shutil pdbname=os.path.join(tdir,os.path.split(pdbfile)[1]) shutil.copyfile(pdbfile,pdbname) os.chdir(tdir) newpdb=pdbname+'_delhyd' First delete hydrogens com =' $pwd \n $ls ...
[ "def", "do_fulchk", "(", "pdbfile", ")", ":", "import", "tempfile", ",", "os", "topdir", "=", "os", ".", "getcwd", "(", ")", "tdir", "=", "tempfile", ".", "mkdtemp", "(", "dir", "=", "topdir", ")", "import", "shutil", "pdbname", "=", "os", ".", "path...
Run a fulchk on a pdbfile
[ "Run", "a", "fulchk", "on", "a", "pdbfile" ]
[ "\"\"\"Run a fulchk on a pdbfile\"\"\"", "#", "# First delete hydrogens" ]
[ { "param": "pdbfile", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "pdbfile", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
b53151bf5836e1f0bec599f702f64457192a34bc
shambo001/peat
pKarun/WI_tools.py
[ "MIT" ]
Python
dellig_addallhyd
<not_specific>
def dellig_addallhyd(pdbfile,renumb=1): """Remove all ligands and water, correct all, and add all hydrogens smartly (to correct flips), delete hyds and then add them back stupidly (incl. Asp and Glu)""" newpdbfile=os.path.split(pdbfile)[1]+'.new' command='getmol '+os.path.split(pdbfile)[1]+' \n Y \n 1 \n 1 ...
Remove all ligands and water, correct all, and add all hydrogens smartly (to correct flips), delete hyds and then add them back stupidly (incl. Asp and Glu)
Remove all ligands and water, correct all, and add all hydrogens smartly (to correct flips), delete hyds and then add them back stupidly (incl. Asp and Glu)
[ "Remove", "all", "ligands", "and", "water", "correct", "all", "and", "add", "all", "hydrogens", "smartly", "(", "to", "correct", "flips", ")", "delete", "hyds", "and", "then", "add", "them", "back", "stupidly", "(", "incl", ".", "Asp", "and", "Glu", ")" ...
def dellig_addallhyd(pdbfile,renumb=1): newpdbfile=os.path.split(pdbfile)[1]+'.new' command='getmol '+os.path.split(pdbfile)[1]+' \n Y \n 1 \n 1 \n dellig \n' if renumb: command=command+' %renumb \n tot \n 1 \n ' command=command+'modpka \n makpsf \n y \n n \n 1.0 \n \n' command=command+'put...
[ "def", "dellig_addallhyd", "(", "pdbfile", ",", "renumb", "=", "1", ")", ":", "newpdbfile", "=", "os", ".", "path", ".", "split", "(", "pdbfile", ")", "[", "1", "]", "+", "'.new'", "command", "=", "'getmol '", "+", "os", ".", "path", ".", "split", ...
Remove all ligands and water, correct all, and add all hydrogens smartly (to correct flips), delete hyds and then add them back stupidly (incl.
[ "Remove", "all", "ligands", "and", "water", "correct", "all", "and", "add", "all", "hydrogens", "smartly", "(", "to", "correct", "flips", ")", "delete", "hyds", "and", "then", "add", "them", "back", "stupidly", "(", "incl", "." ]
[ "\"\"\"Remove all ligands and water, correct all, and add all hydrogens smartly (to correct flips), delete hyds and then add them back stupidly (incl. Asp and Glu)\"\"\"", "# Addhyd", "#", "# Save the new PDB file", "#", "#", "# Run WHAT IF", "#" ]
[ { "param": "pdbfile", "type": null }, { "param": "renumb", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "pdbfile", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "renumb", "type": null, "docstring": null, "docstring_token...
b53151bf5836e1f0bec599f702f64457192a34bc
shambo001/peat
pKarun/WI_tools.py
[ "MIT" ]
Python
relative_accessibility
<not_specific>
def relative_accessibility(pdbfile): """ # This option runs DELLIG, INIACC, SETACC and VACACC """ import os pdbfile=os.path.join(os.getcwd(),pdbfile) pdb=os.path.split(pdbfile)[1] command='getmol '+pdb+' \n X \n dellig \nset1 \n access \n setacc \n tot 0\n \n vacacc \n N \n tot \n' logfi...
# This option runs DELLIG, INIACC, SETACC and VACACC
This option runs DELLIG, INIACC, SETACC and VACACC
[ "This", "option", "runs", "DELLIG", "INIACC", "SETACC", "and", "VACACC" ]
def relative_accessibility(pdbfile): import os pdbfile=os.path.join(os.getcwd(),pdbfile) pdb=os.path.split(pdbfile)[1] command='getmol '+pdb+' \n X \n dellig \nset1 \n access \n setacc \n tot 0\n \n vacacc \n N \n tot \n' logfile=RunWI(command,None,None,[pdbfile]) x=0 resdict={} section_...
[ "def", "relative_accessibility", "(", "pdbfile", ")", ":", "import", "os", "pdbfile", "=", "os", ".", "path", ".", "join", "(", "os", ".", "getcwd", "(", ")", ",", "pdbfile", ")", "pdb", "=", "os", ".", "path", ".", "split", "(", "pdbfile", ")", "[...
This option runs DELLIG, INIACC, SETACC and VACACC
[ "This", "option", "runs", "DELLIG", "INIACC", "SETACC", "and", "VACACC" ]
[ "\"\"\"\n # This option runs DELLIG, INIACC, SETACC and VACACC\n \"\"\"", "#", "# The line below is a mess, it should be rewritten", "# in a more sensible way to prevent character overflows", "# in WHAT IF output to break it", "#" ]
[ { "param": "pdbfile", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "pdbfile", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
4f8bcd6d6eba62022d71b7e993ea9ac6e05f5362
shambo001/peat
PEATSA/WebApp/WebScript.py
[ "MIT" ]
Python
parseCommandLine
null
def parseCommandLine(self): '''Parses the command line Execeptions: Raises Core.Exceptions.ArgumentError if there was a problem with the arguments supplied''' try: self.opt = getopt.getopt(sys.argv[1:], "vw:p:o:j:h", ["pKa", "scan", "path", "modes", "stability", "mutationList=", "ion...
Parses the command line Execeptions: Raises Core.Exceptions.ArgumentError if there was a problem with the arguments supplied
Parses the command line Execeptions: Raises Core.Exceptions.ArgumentError if there was a problem with the arguments supplied
[ "Parses", "the", "command", "line", "Execeptions", ":", "Raises", "Core", ".", "Exceptions", ".", "ArgumentError", "if", "there", "was", "a", "problem", "with", "the", "arguments", "supplied" ]
def parseCommandLine(self): try: self.opt = getopt.getopt(sys.argv[1:], "vw:p:o:j:h", ["pKa", "scan", "path", "modes", "stability", "mutationList=", "ionisableGroups=","mutation=", "mutants=", "ligand=", "configurationFile=", "mutationQuality=", "create-configuration"]) self.opt = dict(s...
[ "def", "parseCommandLine", "(", "self", ")", ":", "try", ":", "self", ".", "opt", "=", "getopt", ".", "getopt", "(", "sys", ".", "argv", "[", "1", ":", "]", ",", "\"vw:p:o:j:h\"", ",", "[", "\"pKa\"", ",", "\"scan\"", ",", "\"path\"", ",", "\"modes\"...
Parses the command line Execeptions: Raises Core.Exceptions.ArgumentError if there was a problem with the arguments supplied
[ "Parses", "the", "command", "line", "Execeptions", ":", "Raises", "Core", ".", "Exceptions", ".", "ArgumentError", "if", "there", "was", "a", "problem", "with", "the", "arguments", "supplied" ]
[ "'''Parses the command line\n\t\t\n\t\tExeceptions:\n\t\t\tRaises Core.Exceptions.ArgumentError if there was a problem with the arguments supplied'''", "#Create configuration instance ", "#This is needed for reading the default data and output directories", "#Use default configuration for the web application"...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
e7021c76c1a0121b4ce97d2d1c3eef7d0f6eb8bd
shambo001/peat
PEATDB/Sandbox.py
[ "MIT" ]
Python
createData
<not_specific>
def createData(self): """Create a OOBTree object for the root Protein data and a seperate object for meta data like userfields. All objects directly added to dbroot should be persistent aware New db adds each cell individually, not whole rec structure """ self.da...
Create a OOBTree object for the root Protein data and a seperate object for meta data like userfields. All objects directly added to dbroot should be persistent aware New db adds each cell individually, not whole rec structure
Create a OOBTree object for the root Protein data and a seperate object for meta data like userfields. All objects directly added to dbroot should be persistent aware New db adds each cell individually, not whole rec structure
[ "Create", "a", "OOBTree", "object", "for", "the", "root", "Protein", "data", "and", "a", "seperate", "object", "for", "meta", "data", "like", "userfields", ".", "All", "objects", "directly", "added", "to", "dbroot", "should", "be", "persistent", "aware", "Ne...
def createData(self): self.data = self.dbroot['data'] = OOBTree() self.records = self.dbroot['records'] = OOBTree() self.meta = self.dbroot['meta'] = Meta('PEAT-DB database') self.meta.staticfields = { 'Name': 'text', 'Mutations':'text', 'Structure':'...
[ "def", "createData", "(", "self", ")", ":", "self", ".", "data", "=", "self", ".", "dbroot", "[", "'data'", "]", "=", "OOBTree", "(", ")", "self", ".", "records", "=", "self", ".", "dbroot", "[", "'records'", "]", "=", "OOBTree", "(", ")", "self", ...
Create a OOBTree object for the root Protein data and a seperate object for meta data like userfields.
[ "Create", "a", "OOBTree", "object", "for", "the", "root", "Protein", "data", "and", "a", "seperate", "object", "for", "meta", "data", "like", "userfields", "." ]
[ "\"\"\"Create a OOBTree object for the root Protein data and a\n seperate object for meta data like userfields.\n All objects directly added to dbroot should be persistent aware\n New db adds each cell individually, not whole rec structure\n \"\"\"", "#self.records = self.dbro...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
e7021c76c1a0121b4ce97d2d1c3eef7d0f6eb8bd
shambo001/peat
PEATDB/Sandbox.py
[ "MIT" ]
Python
createCellCache
<not_specific>
def createCellCache(self): """Create a cache of the displayed values for each record/field Primarily used for quick display in the table""" print '(re)creating db display cache' fields = self.meta.userfields.keys() + self.meta.staticfields.keys() self.cellcache.clear() ...
Create a cache of the displayed values for each record/field Primarily used for quick display in the table
Create a cache of the displayed values for each record/field Primarily used for quick display in the table
[ "Create", "a", "cache", "of", "the", "displayed", "values", "for", "each", "record", "/", "field", "Primarily", "used", "for", "quick", "display", "in", "the", "table" ]
def createCellCache(self): print '(re)creating db display cache' fields = self.meta.userfields.keys() + self.meta.staticfields.keys() self.cellcache.clear() for f in fields: self.cellcache[f] = {} if f in self.meta.userfields: ftype = self.meta.use...
[ "def", "createCellCache", "(", "self", ")", ":", "print", "'(re)creating db display cache'", "fields", "=", "self", ".", "meta", ".", "userfields", ".", "keys", "(", ")", "+", "self", ".", "meta", ".", "staticfields", ".", "keys", "(", ")", "self", ".", ...
Create a cache of the displayed values for each record/field Primarily used for quick display in the table
[ "Create", "a", "cache", "of", "the", "displayed", "values", "for", "each", "record", "/", "field", "Primarily", "used", "for", "quick", "display", "in", "the", "table" ]
[ "\"\"\"Create a cache of the displayed values for each record/field\n Primarily used for quick display in the table\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
e7021c76c1a0121b4ce97d2d1c3eef7d0f6eb8bd
shambo001/peat
PEATDB/Sandbox.py
[ "MIT" ]
Python
updateCellCache
<not_specific>
def updateCellCache(self, name, field): """Update cache for cell display whenever we add/remove/change fields""" if field in self.meta.userfields: ftype = self.meta.userfields[field]['field_type'] else: ftype = self.meta.staticfields[field] if not self.cellcache.h...
Update cache for cell display whenever we add/remove/change fields
Update cache for cell display whenever we add/remove/change fields
[ "Update", "cache", "for", "cell", "display", "whenever", "we", "add", "/", "remove", "/", "change", "fields" ]
def updateCellCache(self, name, field): if field in self.meta.userfields: ftype = self.meta.userfields[field]['field_type'] else: ftype = self.meta.staticfields[field] if not self.cellcache.has_key(field): self.cellcache[field] = {} p = self.data[name]...
[ "def", "updateCellCache", "(", "self", ",", "name", ",", "field", ")", ":", "if", "field", "in", "self", ".", "meta", ".", "userfields", ":", "ftype", "=", "self", ".", "meta", ".", "userfields", "[", "field", "]", "[", "'field_type'", "]", "else", "...
Update cache for cell display whenever we add/remove/change fields
[ "Update", "cache", "for", "cell", "display", "whenever", "we", "add", "/", "remove", "/", "change", "fields" ]
[ "\"\"\"Update cache for cell display whenever we add/remove/change fields\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "name", "type": null }, { "param": "field", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "name", "type": null, "docstring": null, "docstring_tokens": [...
e7021c76c1a0121b4ce97d2d1c3eef7d0f6eb8bd
shambo001/peat
PEATDB/Sandbox.py
[ "MIT" ]
Python
commit
<not_specific>
def commit(self, user='anon', note=None): """Commit change in the DB to zodb. We treate conflicts as application level errors, so the method returns false if it fails to commit""" t = transaction.get() t.setUser(user) if note==None: note='minor' ...
Commit change in the DB to zodb. We treate conflicts as application level errors, so the method returns false if it fails to commit
Commit change in the DB to zodb. We treate conflicts as application level errors, so the method returns false if it fails to commit
[ "Commit", "change", "in", "the", "DB", "to", "zodb", ".", "We", "treate", "conflicts", "as", "application", "level", "errors", "so", "the", "method", "returns", "false", "if", "it", "fails", "to", "commit" ]
def commit(self, user='anon', note=None): t = transaction.get() t.setUser(user) if note==None: note='minor' t.note(note) from ZODB import POSException try: t.commit() except POSException.ConflictError: print 'there is a conflict...
[ "def", "commit", "(", "self", ",", "user", "=", "'anon'", ",", "note", "=", "None", ")", ":", "t", "=", "transaction", ".", "get", "(", ")", "t", ".", "setUser", "(", "user", ")", "if", "note", "==", "None", ":", "note", "=", "'minor'", "t", "....
Commit change in the DB to zodb.
[ "Commit", "change", "in", "the", "DB", "to", "zodb", "." ]
[ "\"\"\"Commit change in the DB to zodb.\n We treate conflicts as application level errors, so the\n method returns false if it fails to commit\"\"\"", "#t.abort()" ]
[ { "param": "self", "type": null }, { "param": "user", "type": null }, { "param": "note", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "user", "type": null, "docstring": null, "docstring_tokens": [...