Commit 47866927 authored by Penom Nom's avatar Penom Nom

Update the metrics file parser (manage also newbler v2.8).

parent 93a18845
......@@ -18,7 +18,7 @@
__author__ = 'Plateforme bioinformatique Midi Pyrenees'
__copyright__ = 'Copyright (C) 2009 INRA'
__license__ = 'GNU General Public License'
__version__ = '1.1'
__version__ = '1.2'
__email__ = 'support.genopole@toulouse.inra.fr'
__status__ = 'beta'
......@@ -155,34 +155,18 @@ class RunAssemblyAnalyse (Analyse):
while True :
line = handle.next()
# Define all regexp we want to catch
rr = re.search(".*numAlignedReads.*= (\d+), (.*);", line)
br = re.search(".*numAlignedBases.*= (\d+), (.*);", line)
ir = re.search(".*inferredReadError.*= (.*), (\d+);", line)
ar = re.search(".*numberAssembled.*= (\d+);", line)
par = re.search(".*numberPartial.*= (\d+);", line)
sr = re.search(".*numberSingleton.*= (\d+);", line)
tr = re.search(".*numberRepeat.*= (\d+);", line)
our = re.search(".*numberOutlier.*= (\d+);", line)
tsr = re.search(".*numberTooShort.*= (\d+);", line)
# Then fill the parsing result table
rr = re.search("\s*([^\s]+)\s*= (.*);", line)
if rr != None:
metrics["readStatus"]["numAlignedReads"] = [rr.group(1), rr.group(2)]
if br != None:
metrics["readStatus"]["numAlignedBases"] = [br.group(1), br.group(2)]
if ir != None:
metrics["readStatus"]["inferredReadError"] = [ir.group(1), ir.group(2)]
if ar != None:
metrics["readStatus"]["numberAssembled"] = ar.group(1)
if par != None:
metrics["readStatus"]["numberPartial"] = par.group(1)
if sr != None:
metrics["readStatus"]["numberSingleton"] = sr.group(1)
if tr != None:
metrics["readStatus"]["numberRepeat"] = tr.group(1)
if our != None:
metrics["readStatus"]["numberOutlier"] = our.group(1)
if tsr != None:
metrics["readStatus"]["numberTooShort"] = tsr.group(1)
key = rr.group(1)
values = rr.group(2).split(", ")
two_values_fields = ["numAlignedReads", "numAlignedBases", "inferredReadError"]
one_value_fields = ["numberAssembled", "numberPartial", "numberSingleton", "numberRepeat", "numberOutlier", "numberTooShort"]
# Then fill the parsing result table
if key in two_values_fields:
metrics["readStatus"][key] = [values[0], values[1]]
if key in one_value_fields:
metrics["readStatus"][key] = values[0]
if line.startswith("\t}"):
break
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment