PEATSA/Core/Utilities.py
def IsExtendedMutationFormat(code):

	'''Returns True if code is in extended format.
	
	That is, it contains both the residue and the mutation name
	
	Parameters:
		code: A mutation code - can be normal or reduced'''
		
	isExtended = True	
	if IsReducedCode(code):
		#Check if the second last element is a string or a number
		try:		
			element = code[-2]
			int(element)
			isExtended = False
		except ValueError:
			pass
		except IndexError:
			raise Exceptions.MutationCodeFormatError, 'Code %s does not have enough elements' % code
	else:
		#Check if there are four components separated by colons
		components = code.split(':')
		if len(components) == 3:
			isExtended = False
	
	return isExtended
Returns True if code is in extended format.
	
	That is, it contains both the residue and the mutation name
	
	Parameters:
		code: A mutation code - can be normal or reduced
Returns True if code is in extended format.
That is, it contains both the residue and the mutation name
Returns True if code is in extended format . That is it contains both the residue and the mutation name
def IsExtendedMutationFormat(code):
	isExtended = True	
	if IsReducedCode(code):
		try:		
			element = code[-2]
			int(element)
			isExtended = False
		except ValueError:
			pass
		except IndexError:
			raise Exceptions.MutationCodeFormatError, 'Code %s does not have enough elements' % code
	else:
		components = code.split(':')
		if len(components) == 3:
			isExtended = False
	return isExtended
def IsExtendedMutationFormat ( code ) : isExtended = True if IsReducedCode ( code ) : try : element = code [ - 2 ] int ( element ) isExtended = False except ValueError : pass except IndexError : raise Exceptions . MutationCodeFormatError , 'Code %s does not have enough elements' % code else : components = code . split ( ':' ) if len ( components ) == 3 : isExtended = False return isExtended
Returns True if code is in extended format.
Returns True if code is in extended format .
'''Returns True if code is in extended format.
	
	That is, it contains both the residue and the mutation name
	
	Parameters:
		code: A mutation code - can be normal or reduced''' #Check if the second last element is a string or a number #Check if there are four components separated by colons
code
A mutation code - can be normal or reduced
A mutation code - can be normal or reduced