mirror of
https://github.com/metabarcoding/obitools4.git
synced 2026-11-09 17:24:41 +00:00
Refactor taxonomy handling and improve performance
This update introduces logic for handling embedded taxonomy, allowing users to specify taxonomy or extract it from sequences, while optimizing performance through reduced memory usage. It also adds batch reordering capabilities and implements comprehensive testing to ensure correct precedence rules and robust error handling for missing taxonomic paths.
This commit is contained in:
1 parent
57c2517b24
commit
574221df42
6 files changed
+284
-19
No files matched your search
@@ -5,9 +5,7 @@ import (
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obidefault"
|
||||
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obioptions"
|
||||
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitools/obiconvert"
|
||||
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitools/obicsv"
|
||||
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitools/obiprimers"
|
||||
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils"
|
||||
@@ -16,21 +14,18 @@ import (
|
||||
func main() {
|
||||
optionParser := obioptions.GenerateOptionParser(
|
||||
"obiprimers",
|
||||
"designs the primer pairs amplifying a set of example sequences and evaluates the DNA barcode they delimit",
|
||||
"designs the primer pairs amplifying a set of example sequences and evaluates the DNA barcode they delimit. "+
|
||||
"The taxonomy comes from the -t option, or is read from the taxonomic paths embedded in the sequences (obiannotate --taxonomic-path)",
|
||||
obiprimers.OptionSet)
|
||||
|
||||
_, args := optionParser(os.Args)
|
||||
|
||||
if !obidefault.HasSelectedTaxonomy() {
|
||||
log.Fatal("you must indicate a taxonomy using the -t or --taxonomy option")
|
||||
}
|
||||
|
||||
sequences, err := obiconvert.CLIReadBioSequences(args...)
|
||||
sequences, taxonomy, err := obiprimers.CLIReadSequencesAndTaxonomy(args)
|
||||
if err != nil {
|
||||
log.Fatalf("Cannot open the sequence files: %v", err)
|
||||
log.Fatalf("Cannot read the sequences: %v", err)
|
||||
}
|
||||
|
||||
pairs, err := obiprimers.CLIPrimerPairs(sequences)
|
||||
pairs, err := obiprimers.CLIPrimerPairs(sequences, taxonomy)
|
||||
if err != nil {
|
||||
log.Fatalf("%v", err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user