mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-12-08 16:50:27 +00:00
Xprize update
Former-commit-id: d38919a897961e4d40da3b844057c3fb94fdb6d7
This commit is contained in:
@@ -215,6 +215,24 @@ func AddTaxonAtRankWorker(taxonomy *obitax.Taxonomy, ranks ...string) obiseq.Seq
|
||||
return f
|
||||
}
|
||||
|
||||
func AddTaxonRankWorker(taxonomy *obitax.Taxonomy) obiseq.SeqWorker {
|
||||
f := func(s *obiseq.BioSequence) (obiseq.BioSequenceSlice, error) {
|
||||
taxonomy.SetTaxonomicRank(s)
|
||||
return obiseq.BioSequenceSlice{s}, nil
|
||||
}
|
||||
|
||||
return f
|
||||
}
|
||||
|
||||
func AddScientificNameWorker(taxonomy *obitax.Taxonomy) obiseq.SeqWorker {
|
||||
f := func(s *obiseq.BioSequence) (obiseq.BioSequenceSlice, error) {
|
||||
taxonomy.SetScientificName(s)
|
||||
return obiseq.BioSequenceSlice{s}, nil
|
||||
}
|
||||
|
||||
return f
|
||||
}
|
||||
|
||||
func AddSeqLengthWorker() obiseq.SeqWorker {
|
||||
f := func(s *obiseq.BioSequence) (obiseq.BioSequenceSlice, error) {
|
||||
s.SetAttribute("seq_length", s.Len())
|
||||
@@ -266,6 +284,18 @@ func CLIAnnotationWorker() obiseq.SeqWorker {
|
||||
annotator = annotator.ChainWorkers(w)
|
||||
}
|
||||
|
||||
if CLISetTaxonomicRank() {
|
||||
taxo := obigrep.CLILoadSelectedTaxonomy()
|
||||
w := AddTaxonRankWorker(taxo)
|
||||
annotator = annotator.ChainWorkers(w)
|
||||
}
|
||||
|
||||
if CLISetScientificName() {
|
||||
taxo := obigrep.CLILoadSelectedTaxonomy()
|
||||
w := AddScientificNameWorker(taxo)
|
||||
annotator = annotator.ChainWorkers(w)
|
||||
}
|
||||
|
||||
if CLIHasAddLCA() {
|
||||
taxo := obigrep.CLILoadSelectedTaxonomy()
|
||||
w := obitax.AddLCAWorker(taxo, CLILCASlotName(), CLILCAThreshold())
|
||||
|
||||
@@ -32,6 +32,8 @@ var _lcaError = 0.0
|
||||
var _setId = ""
|
||||
var _cut = ""
|
||||
var _taxonomicPath = false
|
||||
var _withRank = false
|
||||
var _withScientificName = false
|
||||
|
||||
func SequenceAnnotationOptionSet(options *getoptions.GetOpt) {
|
||||
// options.BoolVar(&_addRank, "seq-rank", _addRank,
|
||||
@@ -117,6 +119,12 @@ func SequenceAnnotationOptionSet(options *getoptions.GetOpt) {
|
||||
options.BoolVar(&_taxonomicPath, "taxonomic-path", _taxonomicPath,
|
||||
options.Description("Annotate the sequence with its taxonomic path"))
|
||||
|
||||
options.BoolVar(&_withRank, "taxonomic-rank", _withRank,
|
||||
options.Description("Annotate the sequence with its taxonomic rank"))
|
||||
|
||||
options.BoolVar(&_withScientificName, "scientific-name", _withScientificName,
|
||||
options.Description("Annotate the sequence with its scientific name"))
|
||||
|
||||
// options.StringVar(&_tagList, "tag-list", _tagList,
|
||||
// options.ArgName("FILENAME"),
|
||||
// options.Description("<FILENAME> points to a file containing attribute names"+
|
||||
@@ -307,3 +315,11 @@ func CLIPatternInDels() bool {
|
||||
func CLISetTaxonomicPath() bool {
|
||||
return _taxonomicPath
|
||||
}
|
||||
|
||||
func CLISetTaxonomicRank() bool {
|
||||
return _withRank
|
||||
}
|
||||
|
||||
func CLISetScientificName() bool {
|
||||
return _withScientificName
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user