PEATSA/Core/Data.py
def _parseSinglePointMutationList(self, stream):
	
		'''Parses a mutation list in simple format
		
		Assumes the data read from stream is in single point mutation format.
		
		Exceptions:
			Raises an Exceptions.MutationListFileFormatError if the file format is invalid'''
		
		stream.seek(0)
		lines = [line.strip('\n') for line in stream.readlines()]
		lines = [line.strip('\t') for line in lines]
		lines = [line for line in lines if line != ""]
		lines = [line.split(",") for line in lines]
		for line in lines:
			code = line[0].strip()
			try:
				#Use ParseStandardResidueCode as we know that this is the format it should be in
				#A standard code with a missing : could be misidentified as reduced e.g. A0053
				chain, residueIndex = Utilities.ParseStandardResidueCode(code)
			except Exceptions.ResidueCodeFormatError, data:
				raise Exceptions.MutationListFileFormatError, "Detected an error with a residue code in single point mutation list.\n%s" % data
			except ValueError, data:
				pass
				
			mutations = [element.strip() for element in line[1:]]
			for mutation in mutations:
				listElement = MutationSet()
				try:
					listElement.addMutation(chain, residueIndex, mutation)
					self.addMutant(listElement, autoUpdate=False)
				except Exceptions.MutationCodeFormatError, data: 
					raise Exceptions.MutationListFileFormatError, "Detected an error with a mutation code in single point mutation list.\n%s" % data
Parses a mutation list in simple format
		
		Assumes the data read from stream is in single point mutation format.
		
		Exceptions:
			Raises an Exceptions.MutationListFileFormatError if the file format is invalid
Parses a mutation list in simple format
Assumes the data read from stream is in single point mutation format.

Raises an Exceptions.MutationListFileFormatError if the file format is invalid
Parses a mutation list in simple format Assumes the data read from stream is in single point mutation format . Raises an Exceptions . MutationListFileFormatError if the file format is invalid
def _parseSinglePointMutationList(self, stream):
		stream.seek(0)
		lines = [line.strip('\n') for line in stream.readlines()]
		lines = [line.strip('\t') for line in lines]
		lines = [line for line in lines if line != ""]
		lines = [line.split(",") for line in lines]
		for line in lines:
			code = line[0].strip()
			try:
				chain, residueIndex = Utilities.ParseStandardResidueCode(code)
			except Exceptions.ResidueCodeFormatError, data:
				raise Exceptions.MutationListFileFormatError, "Detected an error with a residue code in single point mutation list.\n%s" % data
			except ValueError, data:
				pass
			mutations = [element.strip() for element in line[1:]]
			for mutation in mutations:
				listElement = MutationSet()
				try:
					listElement.addMutation(chain, residueIndex, mutation)
					self.addMutant(listElement, autoUpdate=False)
				except Exceptions.MutationCodeFormatError, data: 
					raise Exceptions.MutationListFileFormatError, "Detected an error with a mutation code in single point mutation list.\n%s" % data
def _parseSinglePointMutationList ( self , stream ) : stream . seek ( 0 ) lines = [ line . strip ( '\n' ) for line in stream . readlines ( ) ] lines = [ line . strip ( '\t' ) for line in lines ] lines = [ line for line in lines if line != "" ] lines = [ line . split ( "," ) for line in lines ] for line in lines : code = line [ 0 ] . strip ( ) try : chain , residueIndex = Utilities . ParseStandardResidueCode ( code ) except Exceptions . ResidueCodeFormatError , data : raise Exceptions . MutationListFileFormatError , "Detected an error with a residue code in single point mutation list.\n%s" % data except ValueError , data : pass mutations = [ element . strip ( ) for element in line [ 1 : ] ] for mutation in mutations : listElement = MutationSet ( ) try : listElement . addMutation ( chain , residueIndex , mutation ) self . addMutant ( listElement , autoUpdate = False ) except Exceptions . MutationCodeFormatError , data : raise Exceptions . MutationListFileFormatError , "Detected an error with a mutation code in single point mutation list.\n%s" % data
Parses a mutation list in simple format
Assumes the data read from stream is in single point mutation format.
Parses a mutation list in simple format Assumes the data read from stream is in single point mutation format .
'''Parses a mutation list in simple format
		
		Assumes the data read from stream is in single point mutation format.
		
		Exceptions:
			Raises an Exceptions.MutationListFileFormatError if the file format is invalid''' #Use ParseStandardResidueCode as we know that this is the format it should be in #A standard code with a missing : could be misidentified as reduced e.g. A0053
self
stream