I have lines of data which I want to parse. The data looks like this:
a score=216 expect=1.05e-06
a score=180 expect=0.0394
What I want to do is to have a subroutine that parse them and return 2 values (score and expect) for each line.
However this function of mine doesn't seem to work:
def scoreEvalFromMaf(mafLines):
for word in mafLines[0]:
if word.startswith("score="):
theScore = word.split('=')[1]
theEval = word.split('=')[2]
return [theScore, theEval]
raise Exception("encountered an alignment without a score")
Please advice what's the right way to do it?