several small changes

Former-commit-id: c1cdb95885e44fd6ee7d1c963860d7ab41230c96
This commit is contained in:
2023-06-07 17:50:10 +02:00
parent 49fa1a76cb
commit d46f6b06c5
6 changed files with 32 additions and 8 deletions

View File

@@ -81,6 +81,7 @@ func EvalAttributeWorker(expression map[string]string) obiseq.SeqWorker {
return w
}
func AddTaxonAtRankWorker(taxonomy *obitax.Taxonomy, ranks ...string) obiseq.SeqWorker {
f := func(s *obiseq.BioSequence) *obiseq.BioSequence {
for _, r := range ranks {
@@ -111,6 +112,11 @@ func CLIAnnotationWorker() obiseq.SeqWorker {
annotator = annotator.ChainWorkers(w)
}
if CLIHasSetId() {
w := obiseq.EditIdWorker(CLSetIdExpression())
annotator = annotator.ChainWorkers(w)
}
if CLIHasAttibuteToDelete() {
w := DeleteAttributesWorker(CLIAttibuteToDelete())
annotator = annotator.ChainWorkers(w)

View File

@@ -24,6 +24,7 @@ var _uniqueID = false
var _ahoCorazick = ""
var _lcaSlot = ""
var _lcaError = 0.0
var _setId = ""
func SequenceAnnotationOptionSet(options *getoptions.GetOpt) {
// options.BoolVar(&_addRank, "seq-rank", _addRank,
@@ -47,6 +48,10 @@ func SequenceAnnotationOptionSet(options *getoptions.GetOpt) {
"a new slot named <SLOT_NAME> is added with the taxid of the lowest common ancester corresponding "+
"to the current annotation."))
options.StringVar(&_setId, "set-identifier", _setId,
options.ArgName("EXPRESSION"),
options.Description("An expression used to assigned the new id of the sequence"))
options.Float64Var(&_lcaError, "lca-error", _lcaError,
options.ArgName("#.###"),
options.Description("Error rate tolerated on the taxonomical discription during the lowest common "+
@@ -123,6 +128,15 @@ func OptionSet(options *getoptions.GetOpt) {
// --uniq-id
// Forces sequence record ids to be unique.
func CLIHasSetId() bool {
return _setId != ""
}
func CLSetIdExpression() string {
return _setId
}
func CLIHasAttributeToBeRenamed() bool {
return len(_toBeRenamed) > 0
}