PEATSA/Core/Data.py
def _createMutant(self, element, location, successes, failures, qualities, operations, standardOut):
	
		'''Private method - creates the mutant represented by mutationCode.
		
		Note: Other objects should never call this method
		
		Params:
			element - A MutationSet instance representing the mutant
			location - The mutant output directory
			successes - A list: If successful the filename of the created mutant is appended to this list
			failures - A list: If modelling failed the mutants name is appended to this list
			qualities - A list: The modelling quality is appended to this list
			operations - A dictionary: The operations for this mutant are added to this dict
			standardOut - Where to write output'''	
		
		import Protool.mutate
		
		mutationCodes = element.mutationCodes(self.pdb, reduced=False)
		name = element.codeString(pdb=self.pdb, reduced=False)		
		self.environment.output('[MUTATE] (%d) Creating mutant %s\n' % (self.environment.rank(), name), 
			stream=standardOut, rootOnly=False)
			
		#Skip mutations that can't be modelled
		totalBump = len(mutationCodes)*self.maxOverlap
		mutant, score = Protool.mutate.Model_Mutations(self.pdbFile, 
					self.ligands, 
					mutationCodes, 
					max_overlap=self.maxOverlap, 
					max_totalbump=totalBump,
					return_score=True,
					store_mutation_operations=True)
		self.environment.output('[MUTATE] (%d) Done - Score %lf. Total-bump %lf\n' % (self.environment.rank(), score, totalBump), 
			stream=standardOut, rootOnly=False)
		
		if mutant is False:
			qualities.append([element.codeString(pdb=self.pdb,reduced=True), 'Failed', score])			
			self.environment.output('[MUTATE] Unable to create mutant %s - Could not be modelled.\n' %
					name,
					stream=standardOut,
					rootOnly=False)	
			failures.append(name)
		else:
			
			#Store mutation quality & operations
			qualities.append([name, 'Created', score])	
			operations[name] = mutant.mutate_operations 
			mutant = mutant.PI
			
			#Remove the ligand and write out the pdb file
			mutant.remove_atoms_with_tag('LIGAND')
			name = element.defaultFilename(pdb=self.pdb)
			name = os.path.join(location, name)
			mutant.writepdb(name)
			
			#Add hydrogens to new residue
			self.environment.output('[MUTATE] (%d) Starting clean\n' % self.environment.rank(), 
				stream=standardOut, rootOnly=False)
			self.environment.output('[MUTATE] Cleaning mutant %s\n' % name, 
				stream=standardOut, rootOnly=False)
			Utilities.CleanPDB(inputFile=name, outputFile=name, 
					removeWater=False, 
					removeLigand=False, 
					removeAltLoc=False,
					addHydrogens=True,
					correct=True)
			successes.append(name)
			self.environment.output('[MUTATE] (%d) Done\n' % self.environment.rank(), 
				stream=standardOut, rootOnly=False)
Private method - creates the mutant represented by mutationCode.
		
		Note: Other objects should never call this method
		
		Params:
			element - A MutationSet instance representing the mutant
			location - The mutant output directory
			successes - A list: If successful the filename of the created mutant is appended to this list
			failures - A list: If modelling failed the mutants name is appended to this list
			qualities - A list: The modelling quality is appended to this list
			operations - A dictionary: The operations for this mutant are added to this dict
			standardOut - Where to write output
Private method - creates the mutant represented by mutationCode.
Note: Other objects should never call this method


Private method - creates the mutant represented by mutationCode . Note : Other objects should never call this method
def _createMutant(self, element, location, successes, failures, qualities, operations, standardOut):
		import Protool.mutate
		mutationCodes = element.mutationCodes(self.pdb, reduced=False)
		name = element.codeString(pdb=self.pdb, reduced=False)		
		self.environment.output('[MUTATE] (%d) Creating mutant %s\n' % (self.environment.rank(), name), 
			stream=standardOut, rootOnly=False)
		totalBump = len(mutationCodes)*self.maxOverlap
		mutant, score = Protool.mutate.Model_Mutations(self.pdbFile, 
					self.ligands, 
					mutationCodes, 
					max_overlap=self.maxOverlap, 
					max_totalbump=totalBump,
					return_score=True,
					store_mutation_operations=True)
		self.environment.output('[MUTATE] (%d) Done - Score %lf. Total-bump %lf\n' % (self.environment.rank(), score, totalBump), 
			stream=standardOut, rootOnly=False)
		if mutant is False:
			qualities.append([element.codeString(pdb=self.pdb,reduced=True), 'Failed', score])			
			self.environment.output('[MUTATE] Unable to create mutant %s - Could not be modelled.\n' %
					name,
					stream=standardOut,
					rootOnly=False)	
			failures.append(name)
		else:
			qualities.append([name, 'Created', score])	
			operations[name] = mutant.mutate_operations 
			mutant = mutant.PI
			mutant.remove_atoms_with_tag('LIGAND')
			name = element.defaultFilename(pdb=self.pdb)
			name = os.path.join(location, name)
			mutant.writepdb(name)
			self.environment.output('[MUTATE] (%d) Starting clean\n' % self.environment.rank(), 
				stream=standardOut, rootOnly=False)
			self.environment.output('[MUTATE] Cleaning mutant %s\n' % name, 
				stream=standardOut, rootOnly=False)
			Utilities.CleanPDB(inputFile=name, outputFile=name, 
					removeWater=False, 
					removeLigand=False, 
					removeAltLoc=False,
					addHydrogens=True,
					correct=True)
			successes.append(name)
			self.environment.output('[MUTATE] (%d) Done\n' % self.environment.rank(), 
				stream=standardOut, rootOnly=False)
def _createMutant ( self , element , location , successes , failures , qualities , operations , standardOut ) : import Protool . mutate mutationCodes = element . mutationCodes ( self . pdb , reduced = False ) name = element . codeString ( pdb = self . pdb , reduced = False ) self . environment . output ( '[MUTATE] (%d) Creating mutant %s\n' % ( self . environment . rank ( ) , name ) , stream = standardOut , rootOnly = False ) totalBump = len ( mutationCodes ) * self . maxOverlap mutant , score = Protool . mutate . Model_Mutations ( self . pdbFile , self . ligands , mutationCodes , max_overlap = self . maxOverlap , max_totalbump = totalBump , return_score = True , store_mutation_operations = True ) self . environment . output ( '[MUTATE] (%d) Done - Score %lf. Total-bump %lf\n' % ( self . environment . rank ( ) , score , totalBump ) , stream = standardOut , rootOnly = False ) if mutant is False : qualities . append ( [ element . codeString ( pdb = self . pdb , reduced = True ) , 'Failed' , score ] ) self . environment . output ( '[MUTATE] Unable to create mutant %s - Could not be modelled.\n' % name , stream = standardOut , rootOnly = False ) failures . append ( name ) else : qualities . append ( [ name , 'Created' , score ] ) operations [ name ] = mutant . mutate_operations mutant = mutant . PI mutant . remove_atoms_with_tag ( 'LIGAND' ) name = element . defaultFilename ( pdb = self . pdb ) name = os . path . join ( location , name ) mutant . writepdb ( name ) self . environment . output ( '[MUTATE] (%d) Starting clean\n' % self . environment . rank ( ) , stream = standardOut , rootOnly = False ) self . environment . output ( '[MUTATE] Cleaning mutant %s\n' % name , stream = standardOut , rootOnly = False ) Utilities . CleanPDB ( inputFile = name , outputFile = name , removeWater = False , removeLigand = False , removeAltLoc = False , addHydrogens = True , correct = True ) successes . append ( name ) self . environment . output ( '[MUTATE] (%d) Done\n' % self . environment . rank ( ) , stream = standardOut , rootOnly = False )
Private method - creates the mutant represented by mutationCode.
Private method - creates the mutant represented by mutationCode .
'''Private method - creates the mutant represented by mutationCode.
		
		Note: Other objects should never call this method
		
		Params:
			element - A MutationSet instance representing the mutant
			location - The mutant output directory
			successes - A list: If successful the filename of the created mutant is appended to this list
			failures - A list: If modelling failed the mutants name is appended to this list
			qualities - A list: The modelling quality is appended to this list
			operations - A dictionary: The operations for this mutant are added to this dict
			standardOut - Where to write output''' #Skip mutations that can't be modelled #Store mutation quality & operations #Remove the ligand and write out the pdb file #Add hydrogens to new residue
self
element
location
successes
failures
qualities
operations
standardOut