PEATSA/Core/Utilities.py
def ParseReducedResidueCode(code, extended=False):

	'''Returns the chain, the residue index and the residue name'''
	
	invertedMap = InvertedCodeDictionary()

	noChain = False
	if not code[0].isalpha():
		noChain = True
		chainId = ""
		indexStart = 0

	try:
		if not noChain:
			chainId = code[0]
			indexStart = 1

		if extended is True:
			index = code[indexStart:-1]
			return chainId, int(index), invertedMap[code[-1]]
		else:
			index = code[indexStart:]
			return chainId, int(index)
	except ValueError:
		error = 'Residue code %s is invalid for reduced format. %s is not a valid residue index' % (code, index)	
		raise Exceptions.ResidueCodeFormatError, error
Returns the chain, the residue index and the residue name
Returns the chain, the residue index and the residue name
Returns the chain the residue index and the residue name
def ParseReducedResidueCode(code, extended=False):
	invertedMap = InvertedCodeDictionary()
	noChain = False
	if not code[0].isalpha():
		noChain = True
		chainId = ""
		indexStart = 0
	try:
		if not noChain:
			chainId = code[0]
			indexStart = 1
		if extended is True:
			index = code[indexStart:-1]
			return chainId, int(index), invertedMap[code[-1]]
		else:
			index = code[indexStart:]
			return chainId, int(index)
	except ValueError:
		error = 'Residue code %s is invalid for reduced format. %s is not a valid residue index' % (code, index)	
		raise Exceptions.ResidueCodeFormatError, error
def ParseReducedResidueCode ( code , extended = False ) : invertedMap = InvertedCodeDictionary ( ) noChain = False if not code [ 0 ] . isalpha ( ) : noChain = True chainId = "" indexStart = 0 try : if not noChain : chainId = code [ 0 ] indexStart = 1 if extended is True : index = code [ indexStart : - 1 ] return chainId , int ( index ) , invertedMap [ code [ - 1 ] ] else : index = code [ indexStart : ] return chainId , int ( index ) except ValueError : error = 'Residue code %s is invalid for reduced format. %s is not a valid residue index' % ( code , index ) raise Exceptions . ResidueCodeFormatError , error
Returns the chain, the residue index and the residue name
Returns the chain the residue index and the residue name
'''Returns the chain, the residue index and the residue name'''
code
extended