PEATSA/Core/Data.py
def CreateScanList(pdbFile, mutation='ALA', skipResidueTypes=['ALA', 'GLY']):

	'''Creates a list representing the mutation of each residue to the specified residue
	
	Errors:
		Raises an FileFormatError if the pdb file is not valid'''

	if mutation == "ALL":
		return CreateCompleteScanList(pdbFile)

	#Create a protool instance of the pdb
	import Protool
	try:
		pdb = Protool.structureIO()
		pdb.readpdb(pdbFile)
	except Exception, data:	
		raise Exceptions.FileFormatError, 'Format of specified PDB file %s not valid.\nUnderlying error - %s' % (pdbFile, data)

	#Create a list where each element is a residue, mutation pair.
	#The mutation in each case is the same and is given by the mutation parameter	
	#The keys returned in the next line have the format ChainID:ResidueNumber	
	residues=pdb.residues.keys()
	residues.sort()
			
	#Convert the passed in list or tuple to a set
	skipResidueTypes = set(skipResidueTypes)
	#Remove from residues
	residues = filter(lambda x: pdb.resname(x) not in skipResidueTypes, residues)
	
	mutations = [[mutation]]*len(residues)
	data = zip(residues, mutations)
	mutationList = []
	for residueCode, list in data:
		chain, residueIndex = Utilities.ParseResidueCode(residueCode)
		for element in list:
			listElement = MutationSet()
			listElement.addMutation(chain=chain, residueIndex=residueIndex, mutation=element)
			mutationList.append(listElement)
	
	return mutationList
Creates a list representing the mutation of each residue to the specified residue
	
	Errors:
		Raises an FileFormatError if the pdb file is not valid
Creates a list representing the mutation of each residue to the specified residue
Errors:
Raises an FileFormatError if the pdb file is not valid
Creates a list representing the mutation of each residue to the specified residue Errors : Raises an FileFormatError if the pdb file is not valid
def CreateScanList(pdbFile, mutation='ALA', skipResidueTypes=['ALA', 'GLY']):
	if mutation == "ALL":
		return CreateCompleteScanList(pdbFile)
	import Protool
	try:
		pdb = Protool.structureIO()
		pdb.readpdb(pdbFile)
	except Exception, data:	
		raise Exceptions.FileFormatError, 'Format of specified PDB file %s not valid.\nUnderlying error - %s' % (pdbFile, data)
	residues=pdb.residues.keys()
	residues.sort()
	skipResidueTypes = set(skipResidueTypes)
	residues = filter(lambda x: pdb.resname(x) not in skipResidueTypes, residues)
	mutations = [[mutation]]*len(residues)
	data = zip(residues, mutations)
	mutationList = []
	for residueCode, list in data:
		chain, residueIndex = Utilities.ParseResidueCode(residueCode)
		for element in list:
			listElement = MutationSet()
			listElement.addMutation(chain=chain, residueIndex=residueIndex, mutation=element)
			mutationList.append(listElement)
	return mutationList
def CreateScanList ( pdbFile , mutation = 'ALA' , skipResidueTypes = [ 'ALA' , 'GLY' ] ) : if mutation == "ALL" : return CreateCompleteScanList ( pdbFile ) import Protool try : pdb = Protool . structureIO ( ) pdb . readpdb ( pdbFile ) except Exception , data : raise Exceptions . FileFormatError , 'Format of specified PDB file %s not valid.\nUnderlying error - %s' % ( pdbFile , data ) residues = pdb . residues . keys ( ) residues . sort ( ) skipResidueTypes = set ( skipResidueTypes ) residues = filter ( lambda x : pdb . resname ( x ) not in skipResidueTypes , residues ) mutations = [ [ mutation ] ] * len ( residues ) data = zip ( residues , mutations ) mutationList = [ ] for residueCode , list in data : chain , residueIndex = Utilities . ParseResidueCode ( residueCode ) for element in list : listElement = MutationSet ( ) listElement . addMutation ( chain = chain , residueIndex = residueIndex , mutation = element ) mutationList . append ( listElement ) return mutationList
Creates a list representing the mutation of each residue to the specified residue
Errors:
Raises an FileFormatError if the pdb file is not valid
Creates a list representing the mutation of each residue to the specified residue Errors : Raises an FileFormatError if the pdb file is not valid
'''Creates a list representing the mutation of each residue to the specified residue
	
	Errors:
		Raises an FileFormatError if the pdb file is not valid''' #Create a protool instance of the pdb #Create a list where each element is a residue, mutation pair. #The mutation in each case is the same and is given by the mutation parameter	 #The keys returned in the next line have the format ChainID:ResidueNumber	 #Convert the passed in list or tuple to a set #Remove from residues
pdbFile
mutation
skipResidueTypes