Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)
Creates a set of mutant pdbs based on the command line options

        def CreateMutants(pdbFile, configuration, parser, environment, cleanPDB=False):

	'''Creates a set of mutant pdbs based on the command line options'''

	environment.output('[PEAT-SA] Generating mutants now ...')
	ligandFile = None
	if parser.ligandFile() is not None:
		ligandFile = [parser.ligandFile()]
		
	#Check if a mutation list was provided
	#If not create a scan list
	if parser.mutationListFile() is not None:
		filename = parser.mutationListFile()
		object = Data.MutationListFile(filename)
		#Validate - Will raise an exception if it fails
		errorData = {}
		if not object.validateOnPDB(pdbFile, errorData):
			raise Exceptions.MutationListValidationError, errorData["errorString"] 
		else:	
			mutationList = object.mutantList()
	else:
		skipResidueTypes = []
		if parser.scanMutation() is 'ALA' or parser.scanMutation() is 'GLY':
			skipResidueTypes.append('ALA')
			skipResidueTypes.append('GLY')
		else:
			skipResidueTypes.append(parser.scanMutation())	

		mutationList = Data.CreateScanList(pdbFile=pdbFile, mutation=parser.scanMutation(), skipResidueTypes=skipResidueTypes)	
		
	#Check if the overlap (mutationQuality) was specified on the command line
	
	overlap = configuration.getfloat('PKA SCAN PARAMETERS', 'mutation_quality')
	if parser.mutationQuality() is not None:
		overlap = parser.mutationQuality()
		environment.output('[PEAT-SA] Overriding conf mutation quality with command line value of %f' % overlap)
		
	#Create the collection		
	mutantCollection = Data.MutantCollection(pdbFile=pdbFile,
					name=parser.outputName(),
					mutationList=mutationList,
					ligandFiles=ligandFile,
					location=parser.outputDirectory(),
					maxOverlap=overlap,
					clean=cleanPDB)
				
				
	environment.output("[PEAT-SA] Finished mutant creation - %s" % datetime.datetime.now().strftime('%H:%M:%S'))
				
	environment.output('[PEAT-SA] Complete - %s' % mutantCollection)
	return mutantCollection
        


src/p/e/PEATDB-2.3/PEATSA/WebApp/WebScript.py   PEATDB(Download)
			#This points to the cleaned pdbFile the tool operates on.
			#Therefore we must use this to generate the mutants.
			mutantCollection = Core.ProteinDesignTool.CreateMutants(tool.pdbFile, tool.configuration, self.parser, self.environment)			
 
		if self.environment.isRoot():