def map_processing(self): # combine the density map and atom-tagged map for a given dataset, # to calculate per-atom density metrics for each refined atom self.logFile.writeToLog( str='Combining density maps and atom-tagged maps to calculate ' + 'per-atom density metrics for each refined atom.\n') self.logFile.writeToLog( str='input directory: {}\n'.format(self.mapDir) + 'output directory: {}'.format(self.outputDir), strip=False) # create additional subdirectories self.makeOutputDir(dirName=self.outputDir) self.makeOutputDir(dirName=self.outputDataDir) self.makeOutputDir(dirName=self.pklFileDir) pklFileNames = [] # set up the class to calculate metrics from maps maps2DensMets = maps2DensMetrics( filesIn=self.mapDir, filesOut=self.outputDataDir, pdbName=self.pdbFileList[0], atomTagMap=self.atomMapList[0], logFile=self.logFile, calcFCmap=self.inclFCmets) # only add Fcalc map if it exists. Note, will cause error if # FcMapList = [] but inclFCmets = True if self.inclFCmets: maps2DensMets.FCmapIn = self.FcMapList[0] for i in range(len(self.densMapList)): if i == 0: mapsAlreadyRead = False else: mapsAlreadyRead = True if self.sepPDBperDataset: maps2DensMets.atomMapIn = self.atomMapList[i] maps2DensMets.pdbName = self.pdbFileList[i] if self.inclFCmets: maps2DensMets.FCmapIn = self.FcMapList[i] # if new maps per dataset, need to reread them mapsAlreadyRead = False self.logFile.writeToLog( str='\n---------------------------------\n' + 'Higher dose dataset {} starts here'.format(i)) maps2DensMets.densMapIn = self.densMapList[i] maps2DensMets.maps2atmdensity(mapsAlreadyRead) # save list of atom objects to a .pkl file tag = self.densMapList[i].replace('_density.map', '') pklFileName = save_objectlist(maps2DensMets.PDBarray, tag) move(pklFileName, '{}{}'.format(self.pklFileDir, pklFileName)) pklFileNames.append( '{}{}'.format(self.pklFileDir, pklFileName)) self.pklFiles = pklFileNames
def pickleAtomList(self): self.pklFileName = save_objectlist(self.PDBarray,self.pdbname)
def pickleAtomList(self): # save list of atom objects to a .pkl file self.pklFileName = save_objectlist(self.PDBarray,self.pdbName)