Improved taxonomy reading information display
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
#cython: language_level=3
|
||||
|
||||
import sys
|
||||
|
||||
from obitools3.utils cimport str2bytes, bytes2str, tobytes, tostr
|
||||
from ..capi.obidms cimport OBIDMS_p, obi_dms_get_full_path
|
||||
|
||||
@ -34,7 +36,7 @@ cdef class Taxonomy(OBIWrapper) :
|
||||
return <OBIDMS_taxonomy_p>(self._pointer)
|
||||
|
||||
cdef fill_name_dict(self):
|
||||
print("Indexing taxon names...")
|
||||
print("Indexing taxon names...", file=sys.stderr)
|
||||
|
||||
cdef OBIDMS_taxonomy_p pointer = self.pointer()
|
||||
cdef ecotx_t* taxon_p
|
||||
@ -147,6 +149,8 @@ cdef class Taxonomy(OBIWrapper) :
|
||||
for r in range((<OBIDMS_taxonomy_p>pointer).ranks.count) :
|
||||
taxo._ranks.append(obi_taxo_rank_index_to_label(r, (<OBIDMS_taxonomy_p>pointer).ranks))
|
||||
|
||||
print('Read %d taxa' % len(taxo), file=sys.stderr)
|
||||
|
||||
return taxo
|
||||
|
||||
|
||||
@ -304,6 +308,11 @@ cdef class Taxonomy(OBIWrapper) :
|
||||
def name(self):
|
||||
return self._name
|
||||
|
||||
# ranks property getter
|
||||
@property
|
||||
def ranks(self):
|
||||
return self._ranks
|
||||
|
||||
|
||||
def parental_tree_iterator(self, int taxid):
|
||||
"""
|
||||
|
@ -873,7 +873,7 @@ static ecotxidx_t* read_taxonomy_idx(const char* taxa_file_name, const char* loc
|
||||
taxa_index->buffer_size = taxa_index->count;
|
||||
|
||||
taxa_index->max_taxid = 0;
|
||||
printf("Reading %d taxa...\n", count_taxa);
|
||||
fprintf(stderr, "Reading %d taxa...\n", count_taxa);
|
||||
for (i=0; i<count_taxa; i++)
|
||||
{
|
||||
readnext_ecotaxon(f_taxa, &(taxa_index->taxon[i]));
|
||||
@ -886,9 +886,9 @@ static ecotxidx_t* read_taxonomy_idx(const char* taxa_file_name, const char* loc
|
||||
}
|
||||
|
||||
if (count_local_taxa > 0)
|
||||
printf("Reading %d local taxa...\n", count_local_taxa);
|
||||
fprintf(stderr, "Reading %d local taxa...\n", count_local_taxa);
|
||||
else
|
||||
printf("No local taxa\n");
|
||||
fprintf(stderr, "No local taxa\n");
|
||||
|
||||
count_taxa = taxa_index->count;
|
||||
|
||||
|
Reference in New Issue
Block a user