def create_coot_start_script(self,dir_for_scr,output_file_root): script_location = os.path.join(dir_for_scr ,"coot_start.sh") cootscr = open(script_location,"w") coot_str = """#!/bin/bash\n coot --auto {output_file_root}.2.mtz --pdb {output_file_root}.2.pdb""".format(output_file_root = output_file_root) print coot_str safe_write_script(coot_str,cootscr)
def create_and_return_runscript_file(self): scrfile1 = open(os.path.join(self.outputdir,"%s_1.sh" % self.proj_name),"w") outfile_prefix = os.path.join(self.outputdir,self.proj_name) # scrfile2 = open(os.path.join(self.outputdir,"%s_2.sh" % self.proj_name),"w") # scrfile3 = open(os.path.join(self.outputdir,"%s_3.sh" % self.proj_name),"w") # scrfile4 = open(os.path.join(self.outputdir,"%s_4.sh" % self.proj_name),"w") # print "PROJ_NAME_OUTPREFIX set to ", outfile_prefix ,"DIRECTORY" scr1 = """#!/bin/sh #set -e # bug # 3192 - run-all examples produce harvest files - well to counteract # this here set HARVESTHOME to somewhere in $CCP4_SCR #HARVESTHOME=${self.outputdir} #export HARVESTHOME # from /home/hari/official_ccp4/ccp4-6.1.3/examples/unix/runnable # SCALEPACK2MTZ # # h k l I+ SigI+ I- SigI- were extracted from aucn.na4 # (acentric data only), and put into scalepack format. # This is simply to illustrate the procedure for getting # scalepack data into CCP4. I don't really know if it # is a good example. # # (You can use the same procedure whether or not you have # anomalous data.) scalepack2mtz hklin {self.filename} hklout {outfile_prefix}_junk1.mtz <<eof name project {self.proj_name} crystal {self.proj_name} dataset {self.proj_name} symm {self.spag} end eof # convert Is to Fs and Ds. truncate hklin {outfile_prefix}_junk1.mtz hklout {outfile_prefix}_junk2.mtz <<eof title {self.proj_name} data truncate yes nresidue {self.number_of_residues_in_asu} labout F=FP_{self.proj_name} SIGF=SIGFP_{self.proj_name} end eof # get correct sort order and asymmetric unit cad hklin1 {outfile_prefix}_junk2.mtz hklout {outfile_prefix}_trn.mtz <<eof labi file 1 ALL sort H K L end eof # Add free r to reflections freerflag hklin {outfile_prefix}_trn.mtz hklout {outfile_prefix}_trnfreeR.mtz <<eof FREERFRAC 0.05 END eof""".format(self=self, outfile_prefix = outfile_prefix) safe_write_script(scr1,scrfile1) return scrfile1.name
def write_runscript_and_return_name(self): comfile = open( os.path.join( os.path.join(self.auriga_output_directory_root, self.proj_name), self.proj_name + "_phaser_input.sh" ), "w", ) safe_write_script(self.mycomfile, comfile) return comfile.name
def write_runscript_and_return_name(self): self.comstring = """#!/bin/csh # # Example of refinement by refmac # set inmtz={self.outputdir}/{self.proj_name}_trnfreeR.mtz start: set name = {self.proj_name} set last = 1 set cycles = 1 set count = 0 while ($count != $cycles) echo '*******************************************************************' echo $count echo '*******************************************************************' @ curr = $last + 1 # # Refmac # refmac: refmac5 \ HKLIN $inmtz \ HKLOUT {self.outputdir}/{self.proj_name}.${{curr}}.mtz \ XYZIN {self.outputdir}/{self.proj_name}.${{last}}.pdb \ XYZOUT {self.outputdir}/{self.proj_name}.${{curr}}.pdb \ << eor # #####Do not add hydrogens # MAKE_restraints HYDRogens No # #####Do not check correctness of all monomers. Rely on users naming #####One should be careful in using this option. # MAKE CHECk 0 # ####Input mtz labels. # LABIN FP=FP_{self.proj_name} SIGFP=SIGFP_{self.proj_name} FREE=FreeR_flag # ####Output mtz labels # LABO FC=FC PHIC=PHIC FWT=2FOFCWT PHWT=PH2FOFCWT - DELFWT=FOFCWT PHDELWT=PHFOFCWT # ####Restrained refinement. Reflections between 20 1.5Å resolution will be used # REFI TYPE RESTrained RESOLUTION 20 1.10 # ####Use maximum likelihood residual ####Use maximum likelihood residual # REFI RESI MLKF # ####Refine isotropic B values. # REFI BREF ISOTropic # ####Use 0.35 as weighting between X-ray and geometry # WEIGHT AUTO # ####Scaling parameters. Use BULK solvent based on Babinet's principle. ####NB: Unless otherwise SOLVENT NO given contribution of bulk solvent ####based on constant value will be used. # SCALe TYPE BULK # ####Fix Babinet's bulk solvent B value to 200.0 # SCALe LSSCale FIXBulk 200.0 # ####number of refinement cycles # NCYC 2 # ####Monitor only overall statistics # MONI MEDIUM end eor if ($status) exit # @ last++ @ count++ end """.format(self=self) self.mycomfile = open(os.path.join(self.outputdir,self.proj_name + "_refmac5_input.sh"),"w") safe_write_script(self.comstring,self.mycomfile) return self.mycomfile.name