PEATSA/Core/Data.py
def _extendedMutationCodes(self, pdb):
		
		'''Private method. Returns the mutations in extended format
		
		Parameters:
			pdb - A protool instance representing the pdb that the receiver is a mutant of.
			
		Errors: 
			Raises an MutationCodeApplicationError if 
			- the residue index specified by a mutation code is not in the pdb.
			- the residue chain specified by a mutation code is not in the pdb'''
		
		mutations = []
		for code in self.mutationCodeList:
			chain, residueIndex, mutation = Utilities.ParseMutationCode(code)
			residueCode = Utilities.CreateResidueCode(chain, residueIndex)
			try:
				extendedResidueCode = Utilities.CreateResidueCode(chain=chain,
								number=residueIndex,
								name=pdb.resname(residueCode))
			except Exception:
				#Check if the error was because of chain or index
				if pdb.chains.keys().count(chain) == 0:
					message = "There is no chain '%s' in the pdb file" % chain
				else: 
					#Its a residue index problem
					message = "There is no residue %d in chain '%s' in the pdb file" % (residueIndex, chain)
			
				raise Exceptions.MutationCodeApplicationError(mutationCode=code, message=message)
				
			extendedMutationCode = extendedResidueCode + ':' + mutation
			mutations.append(extendedMutationCode)
			
		return mutations
Private method. Returns the mutations in extended format
		
		Parameters:
			pdb - A protool instance representing the pdb that the receiver is a mutant of.
			
		Errors: 
			Raises an MutationCodeApplicationError if 
			- the residue index specified by a mutation code is not in the pdb.
			- the residue chain specified by a mutation code is not in the pdb
Private method. Returns the mutations in extended format
Parameters:
pdb - A protool instance representing the pdb that the receiver is a mutant of.

Raises an MutationCodeApplicationError if
the residue index specified by a mutation code is not in the pdb.
the residue chain specified by a mutation code is not in the pdb
Private method . Returns the mutations in extended format Parameters : pdb - A protool instance representing the pdb that the receiver is a mutant of . Raises an MutationCodeApplicationError if the residue index specified by a mutation code is not in the pdb . the residue chain specified by a mutation code is not in the pdb
def _extendedMutationCodes(self, pdb):
		mutations = []
		for code in self.mutationCodeList:
			chain, residueIndex, mutation = Utilities.ParseMutationCode(code)
			residueCode = Utilities.CreateResidueCode(chain, residueIndex)
			try:
				extendedResidueCode = Utilities.CreateResidueCode(chain=chain,
								number=residueIndex,
								name=pdb.resname(residueCode))
			except Exception:
				if pdb.chains.keys().count(chain) == 0:
					message = "There is no chain '%s' in the pdb file" % chain
				else: 
					message = "There is no residue %d in chain '%s' in the pdb file" % (residueIndex, chain)
				raise Exceptions.MutationCodeApplicationError(mutationCode=code, message=message)
			extendedMutationCode = extendedResidueCode + ':' + mutation
			mutations.append(extendedMutationCode)
		return mutations
def _extendedMutationCodes ( self , pdb ) : mutations = [ ] for code in self . mutationCodeList : chain , residueIndex , mutation = Utilities . ParseMutationCode ( code ) residueCode = Utilities . CreateResidueCode ( chain , residueIndex ) try : extendedResidueCode = Utilities . CreateResidueCode ( chain = chain , number = residueIndex , name = pdb . resname ( residueCode ) ) except Exception : if pdb . chains . keys ( ) . count ( chain ) == 0 : message = "There is no chain '%s' in the pdb file" % chain else : message = "There is no residue %d in chain '%s' in the pdb file" % ( residueIndex , chain ) raise Exceptions . MutationCodeApplicationError ( mutationCode = code , message = message ) extendedMutationCode = extendedResidueCode + ':' + mutation mutations . append ( extendedMutationCode ) return mutations
Private method.
Private method .
'''Private method. Returns the mutations in extended format
		
		Parameters:
			pdb - A protool instance representing the pdb that the receiver is a mutant of.
			
		Errors: 
			Raises an MutationCodeApplicationError if 
			- the residue index specified by a mutation code is not in the pdb.
			- the residue chain specified by a mutation code is not in the pdb''' #Check if the error was because of chain or index #Its a residue index problem
self
pdb