def preprocess(self): """ Things to do before the main process runs 1. Change to the correct directory 2. Print out the reference for MR pipeline """ if self.verbose: self.logger.debug('AutoMolRep::preprocess') #change directory to the one specified in the incoming dict self.working_dir = self.setup.get('work') if os.path.exists(self.working_dir) == False: os.makedirs(self.working_dir) os.chdir(self.working_dir) #Convert SCA to MTZ (if needed) and get unit cell and SG info and convert R3/H3 self.input_sg,self.cell,self.cell2,vol = Utils.getMTZInfo(self,False,True,True) #Needed for running in different queues for more memory.. if Utils.calcResNumber(self,self.input_sg,False,vol) > 5000: self.large_cell = True #Check if input_pdb is pdb file or pdbID. if self.input_pdb[-4:].upper() != '.PDB': if len(self.input_pdb) == 4: #self.input_pdb = Utils.downloadPDB(self,self.input_pdb) self.input_pdb = Utils.getmmCIF(self,self.input_pdb) else: self.postprocess(True) else: #Have to copy into working_dir to limit path length in Phaser try: shutil.copy(self.input_pdb,os.getcwd()) except: if self.verbose: self.logger.debug('Cannot copy input pdb to working dir. Probably already there.') self.input_pdb = os.path.join(os.getcwd(),os.path.basename(self.input_pdb)) #Check if pdb exists... if self.input_pdb == False: self.postprocess(True) else: self.dres = Utils.getRes(self) self.pdb_info = Utils.getPDBInfo(self,self.input_pdb) if self.pdb_info == False: self.postprocess(True) #If user requests to search for more mols, then allow. if self.nmol: if int(self.pdb_info['all'].get('NMol')) < int(self.nmol): self.pdb_info['all']['NMol'] = self.nmol if self.test: self.logger.debug('TEST IS SET "ON"') #print out recognition of the program being used self.PrintInfo()
def preprocess(self): """ Things to do before the main process runs 1. Change to the correct directory 2. Print out the reference for Stat pipeline """ if self.verbose: self.logger.debug('AutoStats::preprocess') #Make the self.working_dir if it does not exist. if os.path.exists(self.working_dir) == False: os.makedirs(self.working_dir) #change directory to the one specified in the incoming dict os.chdir(self.working_dir) #print out recognition of the program being used self.PrintInfo() #Check if input file is sca and convert to mtz. if self.datafile: self.input_sg,self.cell,self.cell2,vol = Utils.getMTZInfo(self,False,True,True) #Change timer to allow more time for Ribosome structures. if Utils.calcResNumber(self,self.input_sg,False,vol) > 5000: self.stats_timer = 300 if self.test: self.logger.debug('TEST IS SET "ON"')