PEATSA/Core/Data.py
def _isSinglePointMutationFormat(self, stream):
	
		'''Returns True if filename is in single point mutation format
		
		Note: This is a very simple check.
		It only looks to see if the first line from stream is in a valid SPM format'''
		
		isSPM = True
		
		stream.seek(0)		
		line = stream.readline()
	
		components = line.split(",")
		#Check the first component
		try:
			if len(components) != 0:
				code = components[0].strip()
				parts = Utilities.ParseResidueCode(code)
				#should only have two components Chain:Number for SPM
				if len(parts) == 3:
					isSPM = False
			else:
				isSPM = False
		except BaseException:
			isSPM = False
			
		#Check the mutation codes	
		if isSPM is not False:
			mutations = [element.strip() for element in components[1:]]	
			for mutation in mutations:
				if Utilities.allResidues.count(mutation.upper()) is not 1:
					isSPM = False
					break
					
		return isSPM
Returns True if filename is in single point mutation format
		
		Note: This is a very simple check.
		It only looks to see if the first line from stream is in a valid SPM format
Returns True if filename is in single point mutation format
Note: This is a very simple check.
It only looks to see if the first line from stream is in a valid SPM format
Returns True if filename is in single point mutation format Note : This is a very simple check . It only looks to see if the first line from stream is in a valid SPM format
def _isSinglePointMutationFormat(self, stream):
		isSPM = True
		stream.seek(0)		
		line = stream.readline()
		components = line.split(",")
		try:
			if len(components) != 0:
				code = components[0].strip()
				parts = Utilities.ParseResidueCode(code)
				if len(parts) == 3:
					isSPM = False
			else:
				isSPM = False
		except BaseException:
			isSPM = False
		if isSPM is not False:
			mutations = [element.strip() for element in components[1:]]	
			for mutation in mutations:
				if Utilities.allResidues.count(mutation.upper()) is not 1:
					isSPM = False
					break
		return isSPM
def _isSinglePointMutationFormat ( self , stream ) : isSPM = True stream . seek ( 0 ) line = stream . readline ( ) components = line . split ( "," ) try : if len ( components ) != 0 : code = components [ 0 ] . strip ( ) parts = Utilities . ParseResidueCode ( code ) if len ( parts ) == 3 : isSPM = False else : isSPM = False except BaseException : isSPM = False if isSPM is not False : mutations = [ element . strip ( ) for element in components [ 1 : ] ] for mutation in mutations : if Utilities . allResidues . count ( mutation . upper ( ) ) is not 1 : isSPM = False break return isSPM
Returns True if filename is in single point mutation format
Note: This is a very simple check.
Returns True if filename is in single point mutation format Note : This is a very simple check .
'''Returns True if filename is in single point mutation format
		
		Note: This is a very simple check.
		It only looks to see if the first line from stream is in a valid SPM format''' #Check the first component #should only have two components Chain:Number for SPM #Check the mutation codes	
self
stream