diff --git a/wwpdb/apps/entity_transform/__init__.py b/wwpdb/apps/entity_transform/__init__.py index afebe05..72aafe0 100644 --- a/wwpdb/apps/entity_transform/__init__.py +++ b/wwpdb/apps/entity_transform/__init__.py @@ -2,4 +2,4 @@ __author__ = "Ezra Peisach" __email__ = "ezra.peisach@rcsb.org" __license__ = "Apache 2.0" -__version__ = "0.18" +__version__ = "0.19" diff --git a/wwpdb/apps/entity_transform/depict/PrdSummaryDepict.py b/wwpdb/apps/entity_transform/depict/PrdSummaryDepict.py index 3bc2aae..6facf3f 100644 --- a/wwpdb/apps/entity_transform/depict/PrdSummaryDepict.py +++ b/wwpdb/apps/entity_transform/depict/PrdSummaryDepict.py @@ -61,22 +61,25 @@ def DoRenderSummaryPage(self, imageFlag=True): # if self.__splitPolymerResidueFlag: text += '
Selection/ User Defined Group ID | \n'
+ text += 'Selection/ User Defined Group ID | \n'
text += '3 Letter Code | \n' text += 'Chain ID | \n' text += 'ResNum | \n' diff --git a/wwpdb/apps/entity_transform/update/ChopperHandler.py b/wwpdb/apps/entity_transform/update/ChopperHandler.py index 26cd533..f771172 100644 --- a/wwpdb/apps/entity_transform/update/ChopperHandler.py +++ b/wwpdb/apps/entity_transform/update/ChopperHandler.py @@ -21,6 +21,12 @@ __license__ = "Creative Commons Attribution 3.0 Unported" __version__ = "V0.07" +try: + import cPickle as pickle +except ImportError: + import pickle as pickle +# + import os import sys @@ -104,10 +110,29 @@ def __runMappingScript(self): def __searchOtherInstances(self): """ Get other instances list """ + residue_id = '' + if self.__option == 'split_residue': + pickleFilePath = os.path.join(self.__instancePath, self.__instId + ".pkl") + if os.access(pickleFilePath, os.F_OK): + fb = open(pickleFilePath, "rb") + pickleD = pickle.load(fb) + fb.close() + # + if ('residue' in pickleD) and pickleD['residue']: + residue_id = pickleD['residue'] + # + # + # + self.__lfh.write("residue_id=%s\n" % residue_id) searchPath = os.path.join(self.__sessionPath, 'search') extraOptions = ' -summaryfile ' + self.__summaryFile + ' -searchpath ' + searchPath + ' -merge_cif ' + self.__instId \ + '.merge.cif -chopper_cif ' + os.path.join(self.__instancePath, 'chopper_output.cif') + ' ' # + if residue_id != '': + identifier = str(self.__reqObj.getValue("identifier")) + ciffile = os.path.join(self.__sessionPath, identifier + '_model_P1.cif') + extraOptions += ' -residue_id ' + residue_id + ' -model_cif ' + ciffile + # self.__cmdUtil.setSessionPath(self.__instancePath) self.__cmdUtil.runAnnotCmd('SearchAllInstances', '', self.__instId + '.all_instance_search.list', 'search-instances.log', 'search-instances.clog', extraOptions) diff --git a/wwpdb/apps/entity_transform/update/CombineCoord.py b/wwpdb/apps/entity_transform/update/CombineCoord.py index 0bcd880..77a05ff 100644 --- a/wwpdb/apps/entity_transform/update/CombineCoord.py +++ b/wwpdb/apps/entity_transform/update/CombineCoord.py @@ -21,6 +21,12 @@ __license__ = "Creative Commons Attribution 3.0 Unported" __version__ = "V0.07" +try: + import cPickle as pickle +except ImportError: + import pickle as pickle +# + import os import shutil import sys @@ -45,6 +51,7 @@ def __init__(self, reqObj=None, instList=None, cifFile=None, verbose=False, log= self.__sessionPath = None self.__instId = '' self.__message = '' + self.__submitValue = '' # self.__getSession() self.__getInstId() @@ -62,7 +69,22 @@ def processWithCombine(self): # self.__runUpdateScript() - def processWithCopy(self): + def processWithCopy(self, submitValue=''): + # + self.__submitValue = submitValue + # + if self.__submitValue and (len(self.__instList) == 1) and self.__instList[0]: + pickleFilePath = os.path.join(self.__instancePath, self.__instId + ".pkl") + if os.access(pickleFilePath, os.F_OK): + os.remove(pickleFilePath) + # + pickleD = {} + pickleD['residue'] = self.__instList[0] + pickleD['submit'] = self.__submitValue + # + fb = open(pickleFilePath, "wb") + pickle.dump(pickleD, fb) + fb.close() # if not self.__runCopyScript(): self.__runCombineScript() @@ -122,7 +144,6 @@ def __runCopyScript(self): if not os.access(source, os.F_OK): return False # - # shutil.copyfile(source, os.path.join(self.__instancePath, self.__instId + ext)) # return True diff --git a/wwpdb/apps/entity_transform/webapp/EntityWebApp.py b/wwpdb/apps/entity_transform/webapp/EntityWebApp.py index ff66b01..a6bed30 100644 --- a/wwpdb/apps/entity_transform/webapp/EntityWebApp.py +++ b/wwpdb/apps/entity_transform/webapp/EntityWebApp.py @@ -793,7 +793,7 @@ def _resultView(self): rC = ResponseContent(reqObj=self.__reqObj, verbose=self.__verbose, log=self.__lfh) # instId = str(self.__reqObj.getValue("instanceid")) - type = str(self.__reqObj.getValue("type")) # pylint: disable=redefined-builtin + viewType = str(self.__reqObj.getValue("type")) # pylint: disable=redefined-builtin resultObj = None if self.__summaryCifObj: resultObj = ResultDepict(reqObj=self.__reqObj, summaryCifObj=self.__summaryCifObj, verbose=self.__verbose, log=self.__lfh) @@ -804,28 +804,30 @@ def _resultView(self): myD['title'] = self.__title myD['pdbid'] = self.__reqObj.getValue('pdbid') myD['label'] = self.__reqObj.getValue('label') - if type == 'match': + if viewType == 'match': if resultObj: myD['form_data'] = resultObj.DoRenderUpdatePage() else: myD['form_data'] = 'Can not find summary result file.' # rC.setHtmlText(self.__processTemplate('update_form/update_match_tmplt.html', myD)) - elif type == 'input': + elif viewType == 'input': if resultObj: myD['form_data'] = resultObj.DoRenderInputPage() else: myD['form_data'] = 'Can not find summary result file.' # rC.setHtmlText(self.__processTemplate('update_form/update_user_input_tmplt.html', myD)) - elif type == 'split': + elif viewType == 'split': if resultObj: myD['form_data'] = resultObj.DoRenderSplitPage() else: myD['form_data'] = '|
---|---|---|---|---|---|
Can not find summary result file. |