mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Change the API of workers
Former-commit-id: 9b07306edd8cf28266f86f95823948fa99d39ea9
This commit is contained in:
@ -147,14 +147,14 @@ func AddLCAWorker(taxonomy *Taxonomy, slot_name string, threshold float64) obise
|
||||
lca_name = "scientific_name"
|
||||
}
|
||||
|
||||
f := func(sequence *obiseq.BioSequence) *obiseq.BioSequence {
|
||||
f := func(sequence *obiseq.BioSequence) (obiseq.BioSequenceSlice, error) {
|
||||
lca, rans, _ := taxonomy.LCA(sequence, threshold)
|
||||
|
||||
sequence.SetAttribute(slot_name, lca.Taxid())
|
||||
sequence.SetAttribute(lca_name, lca.ScientificName())
|
||||
sequence.SetAttribute(lca_error, math.Round((1-rans)*1000)/1000)
|
||||
|
||||
return sequence
|
||||
return obiseq.BioSequenceSlice{sequence}, nil
|
||||
}
|
||||
|
||||
return f
|
||||
|
Reference in New Issue
Block a user