Actualiser src/libecoPCR/ecotax.c
This commit is contained in:
@ -32,7 +32,7 @@ ecotxidx_t *read_taxonomyidx(const char *filename,const char *filename2)
|
||||
fprintf(stderr,"Reading %d taxa...\n",count);
|
||||
for (i=0; i < count; i++){
|
||||
readnext_ecotaxon(f,&(index->taxon[i]));
|
||||
index->taxon[i].parent=index->taxon + (int64_t)index->taxon[i].parent;
|
||||
index->taxon[i].parent=index->taxon + (int32_t)index->taxon[i].parent;
|
||||
}
|
||||
|
||||
if (count2>0)
|
||||
@ -42,7 +42,7 @@ ecotxidx_t *read_taxonomyidx(const char *filename,const char *filename2)
|
||||
|
||||
for (i=0; i < count2; i++){
|
||||
readnext_ecotaxon(f2,&(index->taxon[count+i]));
|
||||
index->taxon[count+i].parent=index->taxon + (int64_t)index->taxon[count+i].parent;
|
||||
index->taxon[count+i].parent=index->taxon + (int32_t)index->taxon[count+i].parent;
|
||||
}
|
||||
|
||||
return index;
|
||||
@ -112,7 +112,7 @@ ecotx_t *readnext_ecotaxon(FILE *f,ecotx_t *taxon)
|
||||
raw->taxid = swap_int32_t(raw->taxid);
|
||||
}
|
||||
|
||||
taxon->parent = (ecotx_t*)(size_t)raw->parent;
|
||||
taxon->parent = (ecotx_t*)raw->parent;
|
||||
taxon->taxid = raw->taxid;
|
||||
taxon->rank = raw->rank;
|
||||
|
||||
@ -159,6 +159,7 @@ ecotaxonomy_t *read_taxonomy(const char *prefix,int32_t readAlternativeName)
|
||||
else
|
||||
tax->names=NULL;
|
||||
return tax;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -340,6 +341,9 @@ ecotx_t *eco_getsuperkingdom(ecotx_t *taxon,
|
||||
if (taxonomy && tax!=taxonomy)
|
||||
{
|
||||
rankindex = rank_index("superkingdom",taxonomy->ranks);
|
||||
if (rankindex < 0) {
|
||||
rankindex = rank_index("domain",taxonomy->ranks);
|
||||
}
|
||||
tax=taxonomy;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user