Commit 50e61b2a by Frédéric Boyer

BUG count obiuniq with merged

parent 23d7c218
......@@ -58,6 +58,7 @@ def uniqSequence(seqIterator,taxonomy=None,mergedKey=None,mergeIds=False,categor
s['count']+=seq['count']
else:
s['count']+=1
seq['count']=1
# if taxonomy is not None and 'taxid' in seq:
# s['merged_taxid'][seq['taxid']]=
for key in mergedKey:
......@@ -70,7 +71,7 @@ def uniqSequence(seqIterator,taxonomy=None,mergedKey=None,mergeIds=False,categor
mkey = "merged_%s" % key
#cas ou on met a jour les merged_keys mais il n'y a pas de merged_keys dans la sequence qui arrive
if key in seq:
s[mkey][seq[key]]=s[mkey].get(seq[key],0)+1
s[mkey][seq[key]]=s[mkey].get(seq[key],0)+seq['count']
#cas ou merged_keys existe deja
else:
if mkey in seq:
......@@ -98,7 +99,7 @@ def uniqSequence(seqIterator,taxonomy=None,mergedKey=None,mergeIds=False,categor
if mkey not in seq:
seq[mkey]={}
if key in seq:
seq[mkey][seq[key]]=seq[mkey].get(seq[key],0)+1
seq[mkey][seq[key]]=seq[mkey].get(seq[key],0)+seq['count']
del(seq[key])
if 'count' not in seq:
......
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