mirror of
https://github.com/metabarcoding/obitools4.git
synced 2026-11-09 17:24:41 +00:00
Refactor primer logic and enhance taxonomy features
This commit introduces refinements to primer design strategies, species identification rules, and performance analysis. It also updates taxonomy handling by implementing methods for setting and dropping taxonomic paths, along with necessary utility improvements for set handling and comprehensive test coverage.
This commit is contained in:
1 parent
574221df42
commit
d7d63f315c
8 files changed
+886
-9
No files matched your search
@@ -176,6 +176,10 @@ func (sequence *BioSequence) SetFamily(taxonomy *obitax.Taxonomy) *obitax.Taxon
|
||||
return sequence.SetTaxonAtRank(taxonomy, "family")
|
||||
}
|
||||
|
||||
// TaxonomicPathAttribute is the attribute holding the taxonomic path of a
|
||||
// sequence, from the root to its taxon (see obiannotate --taxonomic-path).
|
||||
const TaxonomicPathAttribute = "taxonomic_path"
|
||||
|
||||
func (sequence *BioSequence) SetPath(taxonomy *obitax.Taxonomy) []string {
|
||||
taxon := sequence.Taxon(taxonomy)
|
||||
path := taxon.Path()
|
||||
@@ -186,13 +190,13 @@ func (sequence *BioSequence) SetPath(taxonomy *obitax.Taxonomy) []string {
|
||||
spath[lpath-i] = path.Get(i).FullString(taxonomy.Code())
|
||||
}
|
||||
|
||||
sequence.SetAttribute("taxonomic_path", spath)
|
||||
sequence.SetAttribute(TaxonomicPathAttribute, spath)
|
||||
|
||||
return spath
|
||||
}
|
||||
|
||||
func (sequence *BioSequence) Path() []string {
|
||||
path, ok := sequence.GetAttribute("taxonomic_path")
|
||||
path, ok := sequence.GetAttribute(TaxonomicPathAttribute)
|
||||
|
||||
if !ok {
|
||||
if taxo := obitax.DefaultTaxonomy(); taxo != nil {
|
||||
|
||||
Reference in new issue
Block a user