Compare commits

...

8 Commits

6 changed files with 26 additions and 15 deletions

View File

@ -325,8 +325,9 @@ cdef class Taxonomy(OBIWrapper) :
cdef Taxon taxon
try:
taxon = self.get_taxon_by_taxid(taxid)
except:
raise StopIteration
except Exception as e:
print('\n'+e, file=sys.stderr)
return
if taxon is not None:
while taxon.taxid != 1:
yield taxon
@ -334,7 +335,7 @@ cdef class Taxonomy(OBIWrapper) :
taxon = taxon.parent
yield taxon
else:
raise StopIteration
return
def is_ancestor(self, int ancestor_taxid, int taxid):

View File

@ -23,15 +23,16 @@ cdef class TabFormat:
@cython.boundscheck(False)
def __call__(self, object data):
cdef set ktags
cdef object ktags
cdef list tags = [key for key in data]
line = []
if self.tags is not None and self.tags:
ktags = self.tags
if self.tags != None and self.tags:
ktags = list(self.tags)
else:
ktags = set(tags)
ktags = list(set(tags))
ktags.sort()
if self.header and self.first_line:
for k in ktags:

View File

@ -103,7 +103,11 @@ def fastqWithQualityIterator(lineiterator,
yield seq
read+=1
try:
hline = next(i)
except StopIteration:
return
def fastqWithoutQualityIterator(lineiterator,
@ -174,5 +178,7 @@ def fastqWithoutQualityIterator(lineiterator,
yield seq
read+=1
try:
hline = next(i)
except StopIteration:
return

View File

@ -99,7 +99,10 @@ def tabIterator(lineiterator,
read+=1
try:
line = next(iterator)
except StopIteration:
return

View File

@ -280,7 +280,7 @@ def open_uri(uri,
iseq = urib
objclass = bytes
else: # TODO update uopen to be able to write?
if config['obi']['outputformat'] == b'metabaR':
if 'outputformat' in config['obi'] and config['obi']['outputformat'] == b'metabaR':
if 'metabarprefix' not in config['obi']:
raise Exception("Prefix needed when exporting for metabaR (--metabaR-prefix option)")
else:

View File

@ -1,5 +1,5 @@
major = 3
minor = 0
serial= '1b24'
serial= '1b26'
version ="%d.%d.%s" % (major,minor,serial)