Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for HKLIN and XYZIN issue in refmac refinement #426

Merged
merged 18 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions xce/gui_scripts/settings_preferences.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import os
import subprocess
import sys

from PyQt4 import QtCore

from xce.lib import XChemDB, XChemLog, XChemMain, XChemUtils


Expand All @@ -23,7 +21,7 @@ def set_xce_logfile(self, xce_object):

def settings(self, xce_object):
# set XCE version
xce_object.xce_version = "v1.9.4"
xce_object.xce_version = "v2.0.1"

# general settings
xce_object.allowed_unitcell_difference_percent = 12
Expand Down Expand Up @@ -724,30 +722,29 @@ def dropdown_items(self, xce_object):
]

xce_object.panddas_file_tasks = [
"pre-run for ground state model",
"Build ground state model",
"------------------------------------------",
"pandda.analyse",
"pandda.analyse (PanDDA2)",
"pandda.inspect",
"run pandda.inspect at home",
"------------------------------------------",
"Export NEW PANDDA models",
"Export ALL PANDDA models",
"Export SELECTED PANDDA models",
"------------------------------------------",
"Show HTML summary",
"cluster datasets",
"Event Map -> SF",
"apo -> mmcif",
"check modelled ligands",
"------------------------------------------",
"refine ALL bound-state models with BUSTER",
"refine NEW bound-state models with BUSTER",
"------------------------------------------",
"refine ALL bound-state models with BUSTER (no sanity check)",
"refine NEW bound-state models with BUSTER (no sanity check)",
"------------------------------------------",
"pre-run for ground state model",
"Build ground state model",
"------------------------------------------",
"pandda.analyse (PanDDA2)",
"Show HTML summary",
"cluster datasets",
"Event Map -> SF",
"apo -> mmcif",
"check modelled ligands",
]

xce_object.refine_file_tasks = [
Expand Down
5 changes: 1 addition & 4 deletions xce/lib/XChemLog.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ def create_logfile(self, version):
" # #\n"
" # Version: %s #\n"
" # #\n"
" # Date: 10/10/2022 #\n"
" # #\n"
" # Authors: Tobias Krojer, MAXIV Laboratory, SE #\n"
" # [email protected] #\n"
" # Date: 01/08/2024 #\n"
" # #\n"
" ###################################################################\n"
"\n" % pasteVersion
Expand Down
124 changes: 64 additions & 60 deletions xce/lib/XChemRefine.py
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ def RunRefmac(
os.path.join(self.ProjectPath, self.xtalID, self.xtalID + ".free.mtz")
):
RefmacParams["HKLIN"] = "HKLIN " + os.path.join(
self.ProjectPath, self.xtalID, self.xtalID + ".free.mtz \\\n"
self.ProjectPath, self.xtalID, self.xtalID + ".free.mtz"
)
else:
Logfile.error(
Expand All @@ -884,19 +884,19 @@ def RunRefmac(
self.ProjectPath,
self.xtalID,
"Refine_" + Serial,
"refine_" + Serial + ".mtz \\\n",
"refine_" + Serial + ".mtz",
)

#######################################################
# XYZIN & XYZOUT
RefmacParams["XYZIN"] = "XYZIN " + os.path.join(
self.ProjectPath, self.xtalID, "Refine_" + Serial, "in.pdb \\\n"
self.ProjectPath, self.xtalID, "Refine_" + Serial, "in.pdb"
)
RefmacParams["XYZOUT"] = "XYZOUT " + os.path.join(
self.ProjectPath,
self.xtalID,
"Refine_" + Serial,
"refine_" + Serial + ".pdb \\\n",
"refine_" + Serial + ".pdb",
)

#######################################################
Expand Down Expand Up @@ -1069,69 +1069,68 @@ def RunRefmac(
+ '"\n'
+ "module load phenix/1.20\n"
+ "module load buster/20240123\n"
+ "module load ccp4\n"
+ "cd "
+ self.ProjectPath
+ "/"
+ self.xtalID
+ "/Refine_"
+ Serial
+ "\n"
"\n"
+ refinementStatus
+ "\n"
+ findTLS
+ "refmac5 "
+ RefmacParams["HKLIN"]
+ " "
+ RefmacParams["HKLOUT"]
+ " "
+ RefmacParams["XYZIN"]
+ " "
+ RefmacParams["XYZOUT"]
+ " "
+ RefmacParams["LIBIN"]
+ " "
+ RefmacParams["LIBOUT"]
+ " "
+ RefmacParams["TLSIN"]
+ " "
+ RefmacParams["TLSOUT"]
+ " << EOF > refmac.log\n"
"make -\n"
" hydrogen ALL -\n"
" hout NO -\n"
" peptide NO -\n"
" cispeptide YES -\n"
" ssbridge YES -\n"
" symmetry YES -\n"
" sugar YES -\n"
" connectivity NO -\n"
" link NO\n" + RefmacParams["NCS"] + "refi -\n"
" type REST -\n"
" resi MLKF -\n"
" meth CGMAT -\n"
+ " "
+ "<< EOF > refmac.log\n"
+ "make -hydrogen ALL"
+ "-hout NO "
+ "-peptide NO "
+ "-cispeptide YES "
+ "-ssbridge YES "
+ "-symmetry YES "
+ "-sugar YES "
+ "-connectivity NO "
+ "-link NO\n"
+ RefmacParams["NCS"]
+ "refi -type REST -resi MLKF -meth CGMAT\n"
+ RefmacParams["BREF"]
+ RefmacParams["TLS"]
+ RefmacParams["TWIN"]
+ "ncyc "
+ RefmacParams["NCYCLES"]
+ "scal -type SIMP -LSSC -ANISO -EXPE\n"
+ weight
+ "solvent YES\n"
+ "monitor MEDIUM -torsion 10.0 -distance 10.0 -angle 10.0 -plane 10.0 "
+ "-chiral 10.0 -bfactor 10.0 -bsphere 10.0 -rbond 10.0 -ncsr 10.0\n"
+ "labin FP=F SIGFP=SIGF FREE=FreeR_flag\n"
+ "labout FC=FC FWT=FWT PHIC=PHIC PHWT=PHWT DELFWT=DELFWT PHDELWT=PHDELWT "
+ "FOM=FOM\n"
+ RefmacParams["TLSADD"]
+ "\n"
"scal -\n"
" type SIMP -\n"
" LSSC -\n"
" ANISO -\n"
" EXPE\n" + weight + "solvent YES\n"
"monitor MEDIUM -\n"
" torsion 10.0 -\n"
" distance 10.0 -\n"
" angle 10.0 -\n"
" plane 10.0 -\n"
" chiral 10.0 -\n"
" bfactor 10.0 -\n"
" bsphere 10.0 -\n"
" rbond 10.0 -\n"
" ncsr 10.0\n"
"labin FP=F SIGFP=SIGF FREE=FreeR_flag\n"
"labout FC=FC FWT=FWT PHIC=PHIC PHWT=PHWT DELFWT=DELFWT PHDELWT=PHDELWT"
" FOM=FOM\n" + RefmacParams["TLSADD"] + "\n"
"DNAME " + self.xtalID + "\n"
"END\n"
"EOF\n"
"\n"
"phenix.molprobity refine_%s.pdb refine_%s.mtz\n" % (Serial, Serial)
+ "DNAME "
+ self.xtalID
+ "\n"
+ "END\n"
+ "EOF\n"
+ "\n"
+ "phenix.molprobity refine_%s.pdb refine_%s.mtz\n" % (Serial, Serial)
+ "/bin/mv molprobity.out refine_molprobity.log\n"
"mmtbx.validate_ligands refine_%s.pdb refine_%s.mtz LIG"
" > validate_ligands.txt\n" % (Serial, Serial)
Expand All @@ -1140,30 +1139,35 @@ def RunRefmac(
+ "/"
+ self.xtalID
+ "\n"
"#ln -s %s/%s/Refine_%s/refine_%s.pdb refine.pdb\n"
% (self.ProjectPath, self.xtalID, Serial, Serial)
+ "#ln -s %s/%s/Refine_%s/refine_%s.mtz refine.mtz\n"
% (self.ProjectPath, self.xtalID, Serial, Serial)
+ "ln -s ./Refine_%s/refine_%s.pdb refine.pdb\n" % (Serial, Serial)
+ "ln -s ./Refine_%s/refine_%s.mtz refine.mtz\n" % (Serial, Serial)
+ "ln -s refine.pdb refine.split.bound-state.pdb\n"
"\n"
"ln -s Refine_%s/validate_ligands.txt .\n" % Serial
+ "\n"
+ "ln -s Refine_%s/validate_ligands.txt .\n" % Serial
+ "ln -s Refine_%s/refine_molprobity.log .\n" % Serial
+ "mmtbx.validation_summary refine.pdb > validation_summary.txt\n"
"\n"
"fft hklin refine.mtz mapout 2fofc.map << EOF\n"
"labin F1=FWT PHI=PHWT\n"
"EOF\n"
"\n"
"fft hklin refine.mtz mapout fofc.map << EOF\n"
"labin F1=DELFWT PHI=PHDELWT\n"
"EOF\n"
"\n" + updateDB + "\n"
"/bin/rm %s/%s/REFINEMENT_IN_PROGRESS\n" % (self.ProjectPath, self.xtalID)
+ "\n"
"cd " + self.ProjectPath + "/" + self.xtalID + "/Refine_" + Serial + "\n"
"\n" + spider_plot + "\n"
+ "fft hklin refine.mtz mapout 2fofc.map << EOF\n"
+ "labin F1=FWT PHI=PHWT\n"
+ "EOF\n"
+ "\n"
+ "fft hklin refine.mtz mapout fofc.map << EOF\n"
+ "labin F1=DELFWT PHI=PHDELWT\n"
+ "EOF\n"
+ "\n"
+ updateDB
+ "\n"
+ "/bin/rm %s/%s/REFINEMENT_IN_PROGRESS\n" % (self.ProjectPath, self.xtalID)
+ "\n"
+ "cd "
+ self.ProjectPath
+ "/"
+ self.xtalID
+ "/Refine_"
+ Serial
+ "\n"
+ spider_plot
+ "\n"
)

if os.path.isfile(xce_logfile):
Expand Down
Loading