Adds possibility to extract a taxonomy from taxonomic path included in sequence files

This commit is contained in:
Eric Coissac
2025-01-30 11:18:21 +01:00
parent 2452aef7a9
commit 0df082da06
20 changed files with 460 additions and 173 deletions

View File

@@ -15,13 +15,15 @@ func (sequence *BioSequence) TaxonomicDistribution(taxonomy *obitax.Taxonomy) ma
taxonomy = taxonomy.OrDefault(true)
for taxid, v := range taxids {
t := taxonomy.Taxon(taxid)
if t == nil {
t, err := taxonomy.Taxon(taxid)
if err != nil {
log.Fatalf(
"On sequence %s taxid %s is not defined in taxonomy: %s",
"On sequence %s taxid %s is not defined in taxonomy: %s (%v)",
sequence.Id(),
taxid,
taxonomy.Name())
taxonomy.Name(),
err,
)
}
taxons[t.Node] = v
}