mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-12-10 01:30:27 +00:00
Manage a lock on StatsOnValues
This commit is contained in:
@@ -11,11 +11,13 @@ import (
|
||||
|
||||
func (sequence *BioSequence) TaxonomicDistribution(taxonomy *obitax.Taxonomy) map[*obitax.TaxNode]int {
|
||||
taxids := sequence.StatsOn(MakeStatsOnDescription("taxid"), "na")
|
||||
taxons := make(map[*obitax.TaxNode]int, len(taxids))
|
||||
taxons := make(map[*obitax.TaxNode]int, taxids.Len())
|
||||
|
||||
taxonomy = taxonomy.OrDefault(true)
|
||||
|
||||
for taxid, v := range taxids {
|
||||
taxids.RLock()
|
||||
defer taxids.RUnlock()
|
||||
for taxid, v := range taxids.Map() {
|
||||
t, isAlias, err := taxonomy.Taxon(taxid)
|
||||
if err != nil {
|
||||
log.Fatalf(
|
||||
|
||||
Reference in New Issue
Block a user