Skip to content

Commit

Permalink
DAOTHER-9304 support for new separate command to produce HTML templat…
Browse files Browse the repository at this point in the history
…e part of sf_convert package
  • Loading branch information
Ezra Peisach committed May 17, 2024
1 parent ff9655b commit a8a7912
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions wwpdb/apps/ann_tasks_v2/expIoUtils/MtzTommCIF.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,21 @@ def __setup(self):
self.__htmlPath = os.path.join(self.__sessionPath, "get_mtz_infor.html")
self.__sfInfoPath = os.path.join(self.__sessionPath, "sf_information.cif")

def __bashSetting(self):
def __bashSetting(self, html=False):
setting = (
" PACKAGE_DIR="
+ self.__packagePath
+ "; export PACKAGE_DIR; "
+ " SF_PATH=${PACKAGE_DIR}/sf-valid; export SF_PATH; "
+ " CCP4_PATH=${PACKAGE_DIR}/ccp4; export CCP4_PATH; "
+ " PHENIX_PATH=${PACKAGE_DIR}/phenix; export PHENIX_PATH; "
+ " source ${CCP4_PATH}/bin/ccp4.setup.sh; source ${PHENIX_PATH}/phenix_env.sh; ${SF_PATH}/bin/sf_convert "
+ " source ${CCP4_PATH}/bin/ccp4.setup.sh; source ${PHENIX_PATH}/phenix_env.sh; "
)

if html:
setting += "${SF_PATH}/bin/sf_convert_html "
else:
setting += "${SF_PATH}/bin/sf_convert "
return setting

def __generateInputForm(self, logPath):
Expand All @@ -121,7 +126,7 @@ def __generateInputForm(self, logPath):
+ logPath
+ " 2>&1 ; "
)
self.__runCmd(options)
self.__runCmd(options, html=True)
#
if os.access(self.__mtzLogPath, os.R_OK) and os.access(self.__htmlPath, os.R_OK):
cmd = "cat " + self.__mtzLogPath + " >> " + logPath + " ; "
Expand Down Expand Up @@ -165,9 +170,9 @@ def __convertMtzTommCIF(self, expFileName, retPath, logPath):
self.__status = "error"
return False

def __runCmd(self, options):
def __runCmd(self, options, html=False):
""" """
cmd = "cd " + self.__sessionPath + " ; " + self.__bashSetting() + options
cmd = "cd " + self.__sessionPath + " ; " + self.__bashSetting(html) + options
os.system(cmd)

def __readHtmlText(self):
Expand Down

0 comments on commit a8a7912

Please sign in to comment.