Exemplo n.º 1
0
    def run(self):

        inputFiles = [self.inputMtzFile]
        if not checkInputsExist(inputFiles, self.runLog):
            return False

        # can change unique identifier for map type in file name
        if self.mapTag == '':
            self.mapTag = self.mapType

        if self.outputMapFile == '':
            self.outputMapFile = '{}-{}_FFT.map'.format(
                self.pdbFile.split('.pdb')[0], self.mapTag)

        self.runFFT()

        if self.jobSuccess:
            self.provideFeedback()
            self.runLog.writeToLog('Output files:')
            self.runLog.writeToLog('{}'.format(self.outputMapFile))
            return True

        else:
            self.runLog.writeToLog('Job did not run successfully, see job ' +
                                   'log file "{}"'.format(self.outputLogfile))
            return False
Exemplo n.º 2
0
	def cropMap2Map(self,
					includeDir = False):

		# Crop map 1 to map 2

		# fillerLine()
		self.printPurpose(mode = 'crop to map')
		self.defineCorrectOutputMap(False)
		inputFiles = [self.inputMapFile,self.inputMapFile2]
		if not checkInputsExist(inputFiles,self.runLog):
			 return False

		maps = [self.inputMapFile,self.inputMapFile2]
		if not includeDir:
			maps = [m.split('/')[-1] for m in maps]

		self.defineCommandInput()
		self.commandInput2 = 'EXTEND\nXYZLIM MATCH\nEND'
		self.outputLogfile = 'MAPMASKlogfile.txt'

		# run MAPMASK job
		job = ccp4Job(jobName       = 'MAPMASK_cropMap2Map',
					  commandInput1 = self.commandInput1,
					  commandInput2 = self.commandInput2,
					  outputDir     = self.outputDir,
					  outputLog     = self.outputLogfile,
					  outputFile    = self.outputMapFile)

		self.jobSuccess = job.checkJobSuccess()
		success = self.provideFeedback()
		return success
Exemplo n.º 3
0
    def run(self):

        # a new labelling convention for output files

        self.renameLabels = [self.Mtz1LabelRename, self.Mtz2LabelRename,
                             self.Mtz3LabelRename]

        inputFiles = [self.inputMtz2, self.inputMtz3]
        if not self.ignoreDset1:
            inputFiles += [self.inputMtz1]

        if self.FOMWeight.lower() != 'false':
            self.FOMtag['out'] = '- \nE3 = FOM_{}'.format(self.renameLabels[0])
            self.FOMtag['type'] = '- \nE3 = W'

        if self.FOMWeight.lower() == 'recalculate':
            self.FOMtag['in'] = '- \nE3 = FOM{}'.format(self.labels[0])

        elif 'preset' in self.FOMWeight.lower():
            lbl = self.FOMWeight.split(',')[-1]
            self.FOMtag['in'] = '- \nE3 = FOM{}'.format(lbl)

        if not checkInputsExist(inputFiles, self.runLog):
            return False

        self.runCAD()
        if self.jobSuccess:
            self.provideFeedback()
            return True

        else:
            self.runLog.writeToLog('Job did not run successfully, see job' +
                                   'log file "{}"'.format(self.outputLogfile))
            return False
Exemplo n.º 4
0
    def switchAxisOrder(self,
                        order=[], symGroup="", includeDir=False):

        # switch the axis order of an input .map file.
        # order = [1,2,3] for example

        self.defineCorrectOutputMap(switch=True)
        xyz = {'1': 'X', '2': 'Y', '3': 'Z'}
        axisOrder = [xyz[str(i)] for i in order]

        self.printPurpose(mode='switch axes', axisOrder=axisOrder)

        inputFiles = [self.inputMapFile]
        if not checkInputsExist(inputFiles, self.runLog):
            return False

        self.defineCommandInput()
        self.commandInput2 = 'SYMMETRY {}\nAXIS {}\nEND'.format(
            symGroup, ' '.join(axisOrder))
        self.outputLogfile = 'MAPMASKlogfile.txt'

        # run MAPMASK job
        job = ccp4Job(jobName='MAPMASK_switchAxisOrder',
                      commandInput1=self.commandInput1,
                      commandInput2=self.commandInput2,
                      outputDir=self.outputDir,
                      outputLog=self.outputLogfile,
                      outputFile=self.outputMapFile)

        self.jobSuccess = job.checkJobSuccess(self.runLog)
        success = self.provideFeedback()
        return success
Exemplo n.º 5
0
    def crop2model(self,
                   includeDir=False,
                   spaceGroup='P1'):

        # crop map to an input coordinate model

        self.printPurpose(mode='crop to model')
        self.defineCorrectOutputMap()
        inputFiles = [self.inputMapFile, self.inputPdbFile]
        if not checkInputsExist(inputFiles, self.runLog):
            return False

        self.defineCommandInput()
        self.commandInput2 = 'SYMMETRY {}\nBORDER 1'.format(spaceGroup)
        self.outputLogfile = 'MAPMASKlogfile.txt'

        # run MAPMASK job
        job = ccp4Job(jobName='MAPMASK_crop2Model',
                      commandInput1=self.commandInput1,
                      commandInput2=self.commandInput2,
                      outputDir=self.outputDir,
                      outputLog=self.outputLogfile,
                      outputFile=self.outputMapFile)

        self.jobSuccess = job.checkJobSuccess(self.runLog)
        success = self.provideFeedback()
        return success
Exemplo n.º 6
0
    def multiplyByFactor(self,
                         includeDir=False, factor=-1.0, symGroup=""):

        # multiply all points in a density
        # map file by a constant factor

        self.printPurpose(mode='Multiply by factor')
        self.defineCorrectOutputMap(factorMultiply=True)
        inputFiles = [self.inputMapFile]
        if not checkInputsExist(inputFiles, self.runLog):
            return False

        self.defineCommandInput()

        self.commandInput2 = 'SYMMETRY {}\nSCALE -\nFACTOR {} 0.0\nEND'.format(
            symGroup, factor)
        self.outputLogfile = 'MAPMASKlogfile.txt'

        # run MAPMASK job
        job = ccp4Job(jobName='MAPMASK_multipyByFactor',
                      commandInput1=self.commandInput1,
                      commandInput2=self.commandInput2,
                      outputDir=self.outputDir,
                      outputLog=self.outputLogfile,
                      outputFile=self.outputMapFile)

        self.jobSuccess = job.checkJobSuccess(self.runLog)
        success = self.provideFeedback()
        return success
Exemplo n.º 7
0
    def extend2UnitCell(self,
                        includeDir=False, symGroup=1):

        # extend map 1 to the unit cell limits
        self.printPurpose(mode='extend to unit cell')
        self.defineCorrectOutputMap()
        inputFiles = [self.inputMapFile]
        if not checkInputsExist(inputFiles, self.runLog):
            return False

        self.defineCommandInput()
        self.commandInput2 = 'SYMMETRY {}\nXYZLIM CELL\nEND'.format(symGroup)
        self.outputLogfile = 'MAPMASKlogfile.txt'

        # run MAPMASK job
        job = ccp4Job(jobName='MAPMASK_extend2UnitCell',
                      commandInput1=self.commandInput1,
                      commandInput2=self.commandInput2,
                      outputDir=self.outputDir,
                      outputLog=self.outputLogfile,
                      outputFile=self.outputMapFile)

        self.jobSuccess = job.checkJobSuccess(self.runLog)
        success = self.provideFeedback()
        return success
Exemplo n.º 8
0
	def crop2AsymUnit(self,
					  includeDir = False):

		# Crop map 1 to asymmetric unit

		# fillerLine()
		self.printPurpose(mode = 'crop to asym')
		self.defineCorrectOutputMap(False)
		inputFiles = [self.inputMapFile]
		if not checkInputsExist(inputFiles,self.runLog):
			return False

		if not includeDir:
			map1 = self.inputMapFile.split('/')[-1]
		else:
			map1 = self.inputMapFile

		self.defineCommandInput()
		self.commandInput2 = 'EXTEND\nXYZLIM ASU\nEND'
		self.outputLogfile = 'MAPMASKlogfile.txt'

		# run MAPMASK job
		job = ccp4Job(jobName       = 'MAPMASK_crop2AsymUnit',
					  commandInput1 = self.commandInput1,
					  commandInput2 = self.commandInput2,
					  outputDir     = self.outputDir,
					  outputLog     = self.outputLogfile,
					  outputFile    = self.outputMapFile)

		self.jobSuccess = job.checkJobSuccess()
		success = self.provideFeedback()
		return success
Exemplo n.º 9
0
	def run(self):
		inputFiles = [self.inputPDBfile]
		if checkInputsExist(inputFiles,self.runLog) is False:
			return False
		self.runSFALL()
		if self.jobSuccess is True:
			self.provideFeedback()
			return True
		else:
			ln = 'Job did not run successfully, see job log file "{}"'.format(self.outputLogfile)
			self.runLog.writeToLog(ln)
			return False
Exemplo n.º 10
0
	def run(self):
		inputFiles = [self.inputMtz]
		if checkInputsExist(inputFiles,self.runLog) is False:
			return False
		self.runSCALEIT()
		if self.jobSuccess is True:
			self.provideFeedback()
			self.runLog.writeToLog('Output files:')	
			self.runLog.writeToLog('{}'.format(self.outputMtz))
			return True
		else:
			self.runLog.writeToLog('Job did not run successfully, see job log file "{}"'.format(self.outputLogfile))
			return False
Exemplo n.º 11
0
	def run(self):

		inputFiles = [self.inputMtz]

		if not checkInputsExist(inputFiles,self.runLog):
			return False
		self.runSCALEIT()
		if self.jobSuccess:
			self.provideFeedback()
			return True
		else:
			err = 'Job did not run successfully, see job log file "{}"'.format(self.outputLogfile)
			self.runLog.writeToLog(err)
			return False
Exemplo n.º 12
0
 def run(self):
     inputFiles = [self.inputPDBfile]
     if not checkInputsExist(inputFiles, self.runLog):
         return False
     self.runSFALL()
     if self.jobSuccess:
         self.provideFeedback()
         return True
     else:
         error(
             text='Job did not run successfully, see job log file ' +
                  '"{}"'.format(self.outputLogfile),
             log=self.runLog, type='error')
         return False
Exemplo n.º 13
0
 def run(self):
     inputFiles = [self.pdbFile, self.mtzFile, self.effFile]
     if not checkInputsExist(inputFiles, self.runLog):
         return False
     self.runEND()
     if self.jobSuccess:
         self.provideFeedback()
         self.runLog.writeToLog('Output files:')
         self.runLog.writeToLog('{}'.format(self.outputMapFile))
         return True
     else:
         self.runLog.writeToLog(
             'Job did not run successfully, see job ' +
             'log file "{}"'.format(self.outputLogfile))
         return False
Exemplo n.º 14
0
	def cropMap2Map(self):
		# Crop map 1 to map 2
		self.defineCorrectOutputMap(False)
		inputFiles = [self.inputMapFile,self.inputMapFile2]
		if checkInputsExist(inputFiles,self.runLog) is False:
			 return False

		self.runLog.writeToLog('Cropping map "{}" to map "{}"'.format(self.inputMapFile,self.inputMapFile2))
		self.defineCommandInput()
		self.commandInput2 = 'EXTEND\nXYZLIM MATCH\nEND'
		self.outputLogfile = 'MAPMASKlogfile.txt'

		# run MAPMASK job
		job = ccp4Job('MAPMASK_cropMap2Map',self.commandInput1,self.commandInput2,
					  self.outputDir,self.outputLogfile,self.outputMapFile)
		self.jobSuccess = job.checkJobSuccess()
		success = self.provideFeedback()
		return success
Exemplo n.º 15
0
	def run(self):
		inputFiles = [self.inputMtz,self.inputPDB]
		if checkInputsExist(inputFiles,self.runLog) is False:
			return False

		success = self.getSpaceGroup() # get space group from pdb file
		if success is False:
			return False

		self.runSIGMAA()
		if self.jobSuccess is True:
			self.provideFeedback()
			self.runLog.writeToLog('Output files:')	
			self.runLog.writeToLog('{}'.format(self.outputMtz))
			return True
		else:
			self.runLog.writeToLog('Job did not run successfully, see job log file "{}"'.format(self.outputLogfile))
			return False
Exemplo n.º 16
0
    def run(self):
        inputFiles = [self.inputMtz, self.inputPDB]
        if not checkInputsExist(inputFiles, self.runLog):
            return False

        success = self.getSpaceGroup()
        if not success:
            return False

        self.runSIGMAA()
        if self.jobSuccess:
            self.provideFeedback()
            self.runLog.writeToLog('Output files:')
            self.runLog.writeToLog('{}'.format(self.outputMtz))
            return True
        else:
            error(text='Job did not run successfully, see job log file ' +
                       '"{}"'.format(self.outputLogfile),
                  log=self.runLog, type='error')
            return False
Exemplo n.º 17
0
	def switchAxisOrder(self,order,symGroup):
		# switch the axis order of an input .map file. order = [1,2,3] for example
		self.defineCorrectOutputMap(True)
		xyz = {'1':'X','2':'Y','3':'Z'}
		axisOrder = [xyz[str(i)] for i in order]

		inputFiles = [self.inputMapFile]
		if checkInputsExist(inputFiles,self.runLog) is False:
			return False

		self.runLog.writeToLog('Switching map "{}" axis ordering to {}'.format(self.inputMapFile,axisOrder))
		self.defineCommandInput()
		self.commandInput2 = 'SYMMETRY {}\nAXIS {}\nEND'.format(symGroup,' '.join(axisOrder))
		self.outputLogfile = 'MAPMASKlogfile.txt'

		# run MAPMASK job
		job = ccp4Job('MAPMASK_switchAxisOrder',self.commandInput1,self.commandInput2,
					  self.outputDir,self.outputLogfile,self.outputMapFile)
		self.jobSuccess = job.checkJobSuccess()
		success = self.provideFeedback()
		return success