Skip to content

Commit

Permalink
When running chem-comp-link operation - perform cleanup. Document why…
Browse files Browse the repository at this point in the history
… unsafe to use set self.__cleanUp
  • Loading branch information
Ezra Peisach committed Nov 15, 2024
1 parent 15bfb5e commit 1064e03
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion wwpdb/utils/wf/plugins/ChemCompUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ class ChemCompUtils(UtilsBase):

def __init__(self, verbose=False, log=sys.stderr):
super(ChemCompUtils, self).__init__(verbose, log)
# DO NOT SET TO TRUE - RcsbDpUtility removes setWorkingDir - breaks image generation ligand lite as directories removed!!
# Cannot cleanup after chemCompAssignOp
self.__cleanUp = False
self.__cleanUpSafe = True
"""Flag to remove any temporary directories created by this class.
"""
#
Expand All @@ -70,9 +73,10 @@ def chemCompLinkOp(self, **kwArgs):
dp.imp(pdbxPath)
dp.op("chem-comp-link")
dp.exp(ccLinkPath)
if self.__cleanUp:
if self.__cleanUpSafe:
dp.cleanup()
if self._verbose:
self._lfh.write("+ChemCompUtils.chemCompLinkOp() - PDBx XXXXX: %s\n" % self.__cleanUpSafe)
self._lfh.write("+ChemCompUtils.chemCompLinkOp() - PDBx file path: %s\n" % pdbxPath)
self._lfh.write("+ChemCompUtils.chemCompLinkOp() - CC link file path: %s\n" % ccLinkPath)
return True
Expand Down

0 comments on commit 1064e03

Please sign in to comment.