BUG obiconvert: could add sequences without/with bad taxid

This commit is contained in:
Frédéric Boyer
2015-02-06 13:46:31 +00:00
parent 733707a849
commit 673ea5bd64

View File

@ -69,7 +69,7 @@ class EcoPCRDBSequenceWriter(object):
ecoTaxonomyWriter(dbname,self._taxonomy)
print >> sys.stderr,"Ok"
# Identifiy the next sequence file numbre
# Identifiy the next sequence file number
if fileidx is None:
p = re.compile(r'([0-9]{3})\.sdx')
fileidx = max(list(int(p.search(i).group(1))
@ -107,7 +107,8 @@ class EcoPCRDBSequenceWriter(object):
totalSize = 4 + 20 + 4 + 4 + 4 + cptseqlength + delength
if self._taxonomy is None or 'taxid' not in seq:
if self._taxonomy is None or 'taxid' not in seq :
raise Exception("Taxonomy error: "+seq.id)
taxon=-1
else:
taxon=self._taxonomy.findIndex(seq['taxid'])