ngsfilter: fixed a bug with unaligned chimeras (unpaired primers) and
made error annotations more explicit
This commit is contained in:
15
python/obitools3/commands/ngsfilter.pyx
Executable file → Normal file
15
python/obitools3/commands/ngsfilter.pyx
Executable file → Normal file
@ -335,13 +335,18 @@ cdef tuple annotate(sequences, infos, no_tags, verbose=False):
|
|||||||
final_sequence[b'reverse_match']=match.seq
|
final_sequence[b'reverse_match']=match.seq
|
||||||
|
|
||||||
# Keep only paired reverse primer
|
# Keep only paired reverse primer
|
||||||
infos = infos[directmatch[0]]
|
infos = infos[directmatch[0]]
|
||||||
|
rev_prim = list(infos.keys())[0]
|
||||||
|
|
||||||
# If not aligned, look for other match in already computed matches (choose the one that makes the biggest amplicon)
|
# If not aligned, look for other match in already computed matches (choose the one that makes the biggest amplicon)
|
||||||
if not_aligned:
|
if not_aligned:
|
||||||
i=1
|
i=1
|
||||||
# TODO comment
|
# TODO comment
|
||||||
while i<len(all_direct_matches) and (all_direct_matches[i][1] is None or all_direct_matches[i][0].forward == directmatch[0].forward or all_direct_matches[i][0] == directmatch[0]):
|
while i<len(all_direct_matches) and \
|
||||||
|
(all_direct_matches[i][1] is None or \
|
||||||
|
all_direct_matches[i][0].forward == directmatch[0].forward or \
|
||||||
|
all_direct_matches[i][0] == directmatch[0] or \
|
||||||
|
rev_prim != all_direct_matches[i][0]) :
|
||||||
i+=1
|
i+=1
|
||||||
if i < len(all_direct_matches):
|
if i < len(all_direct_matches):
|
||||||
reversematch = all_direct_matches[i]
|
reversematch = all_direct_matches[i]
|
||||||
@ -445,7 +450,7 @@ cdef tuple annotate(sequences, infos, no_tags, verbose=False):
|
|||||||
if len(s)==1:
|
if len(s)==1:
|
||||||
sample=s[0]
|
sample=s[0]
|
||||||
elif len(s)>1:
|
elif len(s)>1:
|
||||||
final_sequence[b'error']=b'multiple samples match tags'
|
final_sequence[b'error']=b'Did not found reverse tag'
|
||||||
return False, final_sequence
|
return False, final_sequence
|
||||||
else:
|
else:
|
||||||
sample=None
|
sample=None
|
||||||
@ -455,13 +460,13 @@ cdef tuple annotate(sequences, infos, no_tags, verbose=False):
|
|||||||
if len(s)==1:
|
if len(s)==1:
|
||||||
sample=s[0]
|
sample=s[0]
|
||||||
elif len(s)>1:
|
elif len(s)>1:
|
||||||
final_sequence[b'error']=b'multiple samples match tags'
|
final_sequence[b'error']=b'Did not found forward tag'
|
||||||
return False, final_sequence
|
return False, final_sequence
|
||||||
else:
|
else:
|
||||||
sample=None
|
sample=None
|
||||||
|
|
||||||
if sample is None:
|
if sample is None:
|
||||||
final_sequence[b'error']=b"Cannot assign sequence to a sample"
|
final_sequence[b'error']=b"No tags found"
|
||||||
return False, final_sequence
|
return False, final_sequence
|
||||||
|
|
||||||
final_sequence.update(sample)
|
final_sequence.update(sample)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
major = 3
|
major = 3
|
||||||
minor = 0
|
minor = 0
|
||||||
serial= '0-beta1'
|
serial= '0-beta2'
|
||||||
|
|
||||||
version ="%d.%02d.%s" % (major,minor,serial)
|
version ="%d.%02d.%s" % (major,minor,serial)
|
||||||
|
2
setup.py
2
setup.py
@ -83,7 +83,7 @@ def findPackage(root,base=None):
|
|||||||
|
|
||||||
|
|
||||||
PACKAGE = "OBITools3"
|
PACKAGE = "OBITools3"
|
||||||
VERSION = "3.0.0-beta1"
|
VERSION = "3.0.0-beta2"
|
||||||
AUTHOR = 'Celine Mercier'
|
AUTHOR = 'Celine Mercier'
|
||||||
EMAIL = 'celine.mercier@metabarcoding.org'
|
EMAIL = 'celine.mercier@metabarcoding.org'
|
||||||
URL = "http://metabarcoding.org/obitools3"
|
URL = "http://metabarcoding.org/obitools3"
|
||||||
|
Reference in New Issue
Block a user