From e48ad513b32a6204e406b7b3afde953ae89b0392 Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Fri, 25 Nov 2016 12:44:45 +0100 Subject: [PATCH] Fix a bug in oneXcoverage --- python/orgasm/tango.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/python/orgasm/tango.py b/python/orgasm/tango.py index 35f2bb8..c9146b4 100644 --- a/python/orgasm/tango.py +++ b/python/orgasm/tango.py @@ -1675,10 +1675,13 @@ def oneXcoverage(assgraph): for e in assgraph.edgeIterator(): attr = assgraph.getEdgeAttr(*e) - if 'path' in attr and attr['stemid'] > 0 and len(attr['path']) > readSize: + if attr['class'] == "sequence" and len(attr['path']) > readSize: path = attr['path'] - cov = [assgraph.assembler.graph.getNodeAttr(i,)['coverage'] for i in path] + cov = [assgraph.assembler.graph.getNodeAttr(i,)['coverage'] + for i in path + if i > 0 + ] s=0 c = 0 for i in range(len(cov)): @@ -2557,12 +2560,12 @@ def path2sam(self,assgraph,path,identifier="contig",minlink=10,nlength=20,back=2 tlen=0 flag=0 - flag |= 0x01 # template having multiple segments in sequencing - # All our reads are paired + flag |= 0x01 # template having multiple segments in sequencing + # All our reads are paired if paired_mapped: - flag |= 0x02 # each segment properly aligned according to the aligner - # paired read is part of the assembly + flag |= 0x02 # each segment properly aligned according to the aligner + # paired read is part of the assembly if rid > 0: flag |= 0x40 # the first segment in the template flag |= 0x20 # SEQ of the next segment in the template being reverse complemented -- libgit2 0.26.0