PEATSA/Core/Utilities.py
def CreateResidueCode(chain, number, name=None):

	'''Creates a residue code from a chain id and residue number and optionally a name
	
	A normal residue code has the form ChainID:ResidueIndex where the residue index is a
	string of length 4 left padded with zeros.
	For example passing A, 4 return A:0004.
	
	If a name is passed an extended residue code is returned. This has the format
	ChainID:ResidueIndex(Padded):ResidueName'''
	
	if name is None:
		return  chain + ":" + "0"*(4 - len(str(number))) + str(number)
	else:
		return chain + ":" + "0"*(4 - len(str(number))) + str(number) + ":" + name
Creates a residue code from a chain id and residue number and optionally a name
	
	A normal residue code has the form ChainID:ResidueIndex where the residue index is a
	string of length 4 left padded with zeros.
	For example passing A, 4 return A:0004.
	
	If a name is passed an extended residue code is returned. This has the format
	ChainID:ResidueIndex(Padded):ResidueName
Creates a residue code from a chain id and residue number and optionally a name
A normal residue code has the form ChainID:ResidueIndex where the residue index is a
string of length 4 left padded with zeros.
For example passing A, 4 return A:0004.

If a name is passed an extended residue code is returned.
Creates a residue code from a chain id and residue number and optionally a name A normal residue code has the form ChainID : ResidueIndex where the residue index is a string of length 4 left padded with zeros . For example passing A 4 return A : 0004 . If a name is passed an extended residue code is returned .
def CreateResidueCode(chain, number, name=None):
	if name is None:
		return  chain + ":" + "0"*(4 - len(str(number))) + str(number)
	else:
		return chain + ":" + "0"*(4 - len(str(number))) + str(number) + ":" + name
def CreateResidueCode ( chain , number , name = None ) : if name is None : return chain + ":" + "0" * ( 4 - len ( str ( number ) ) ) + str ( number ) else : return chain + ":" + "0" * ( 4 - len ( str ( number ) ) ) + str ( number ) + ":" + name
Creates a residue code from a chain id and residue number and optionally a name
A normal residue code has the form ChainID:ResidueIndex where the residue index is a
string of length 4 left padded with zeros.
Creates a residue code from a chain id and residue number and optionally a name A normal residue code has the form ChainID : ResidueIndex where the residue index is a string of length 4 left padded with zeros .
'''Creates a residue code from a chain id and residue number and optionally a name
	
	A normal residue code has the form ChainID:ResidueIndex where the residue index is a
	string of length 4 left padded with zeros.
	For example passing A, 4 return A:0004.
	
	If a name is passed an extended residue code is returned. This has the format
	ChainID:ResidueIndex(Padded):ResidueName'''
chain
number
name