PEATSA/Core/Utilities.py
def ParseStandardResidueCode(residueCode, extended=False): 

	'''Parses a residue code returning the chain and residueIndex (as an int).
	
	Set extended to True if the code is in extended format,
	See CreateResidueCode for information on the residue code format.
	
	Raises an Exceptions.ResidueCodeError if the residue code is not in the correct format'''
	
	components = residueCode.split(':')
	try:
		if components[1] != '0000':
			data = (components[0], int(components[1].lstrip('0'))) + tuple(components[2:])
		else:
			data = (components[0], int(components[1])) + tuple(components[2:])	
	except BaseException, data:
		print data
		raise Exceptions.ResidueCodeFormatError, 'Residue Code is %s. Invalid for standard format' % residueCode
	
	if len(data) > 3:
		raise Exceptions.ResidueCodeFormatError, 'Residue Code is %s. Invalid for standard format - too many components' % residueCode
	
	return data
Parses a residue code returning the chain and residueIndex (as an int).
	
	Set extended to True if the code is in extended format,
	See CreateResidueCode for information on the residue code format.
	
	Raises an Exceptions.ResidueCodeError if the residue code is not in the correct format
Parses a residue code returning the chain and residueIndex (as an int).
Set extended to True if the code is in extended format,
See CreateResidueCode for information on the residue code format.

Raises an Exceptions.ResidueCodeError if the residue code is not in the correct format
Parses a residue code returning the chain and residueIndex ( as an int ) . Set extended to True if the code is in extended format See CreateResidueCode for information on the residue code format . Raises an Exceptions . ResidueCodeError if the residue code is not in the correct format
def ParseStandardResidueCode(residueCode, extended=False): 
	components = residueCode.split(':')
	try:
		if components[1] != '0000':
			data = (components[0], int(components[1].lstrip('0'))) + tuple(components[2:])
		else:
			data = (components[0], int(components[1])) + tuple(components[2:])	
	except BaseException, data:
		print data
		raise Exceptions.ResidueCodeFormatError, 'Residue Code is %s. Invalid for standard format' % residueCode
	if len(data) > 3:
		raise Exceptions.ResidueCodeFormatError, 'Residue Code is %s. Invalid for standard format - too many components' % residueCode
	return data
def ParseStandardResidueCode ( residueCode , extended = False ) : components = residueCode . split ( ':' ) try : if components [ 1 ] != '0000' : data = ( components [ 0 ] , int ( components [ 1 ] . lstrip ( '0' ) ) ) + tuple ( components [ 2 : ] ) else : data = ( components [ 0 ] , int ( components [ 1 ] ) ) + tuple ( components [ 2 : ] ) except BaseException , data : print data raise Exceptions . ResidueCodeFormatError , 'Residue Code is %s. Invalid for standard format' % residueCode if len ( data ) > 3 : raise Exceptions . ResidueCodeFormatError , 'Residue Code is %s. Invalid for standard format - too many components' % residueCode return data
Parses a residue code returning the chain and residueIndex (as an int).
Parses a residue code returning the chain and residueIndex ( as an int ) .
'''Parses a residue code returning the chain and residueIndex (as an int).
	
	Set extended to True if the code is in extended format,
	See CreateResidueCode for information on the residue code format.
	
	Raises an Exceptions.ResidueCodeError if the residue code is not in the correct format'''
residueCode
extended