mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Make the --no-progressbar option effective on graph building progress too.
Former-commit-id: 3fabecfc9de69ad406d6840c8f821c16eebaef46
This commit is contained in:
@ -7,6 +7,7 @@ import (
|
|||||||
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiiter"
|
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiiter"
|
||||||
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obioptions"
|
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obioptions"
|
||||||
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiseq"
|
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiseq"
|
||||||
|
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitools/obiconvert"
|
||||||
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils"
|
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils"
|
||||||
"github.com/schollz/progressbar/v3"
|
"github.com/schollz/progressbar/v3"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
@ -300,36 +301,47 @@ func CLIOBIClean(itertator obiiter.IBioSequence) obiiter.IBioSequence {
|
|||||||
obioptions.CLIParallelWorkers())
|
obioptions.CLIParallelWorkers())
|
||||||
|
|
||||||
if RatioMax() < 1.0 {
|
if RatioMax() < 1.0 {
|
||||||
|
bar := (*progressbar.ProgressBar)(nil)
|
||||||
|
|
||||||
|
if obiconvert.CLIProgressBar() {
|
||||||
|
|
||||||
|
pbopt := make([]progressbar.Option, 0, 5)
|
||||||
|
pbopt = append(pbopt,
|
||||||
|
progressbar.OptionSetWriter(os.Stderr),
|
||||||
|
progressbar.OptionSetWidth(15),
|
||||||
|
progressbar.OptionShowIts(),
|
||||||
|
progressbar.OptionSetPredictTime(true),
|
||||||
|
progressbar.OptionSetDescription("[Filter graph on abundance ratio]"),
|
||||||
|
)
|
||||||
|
|
||||||
|
bar = progressbar.NewOptions(len(samples), pbopt...)
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, seqs := range samples {
|
||||||
|
FilterGraphOnRatio(seqs, RatioMax())
|
||||||
|
if bar != nil {
|
||||||
|
bar.Add(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Mutation(samples)
|
||||||
|
|
||||||
|
bar := (*progressbar.ProgressBar)(nil)
|
||||||
|
|
||||||
|
if obiconvert.CLIProgressBar() {
|
||||||
pbopt := make([]progressbar.Option, 0, 5)
|
pbopt := make([]progressbar.Option, 0, 5)
|
||||||
pbopt = append(pbopt,
|
pbopt = append(pbopt,
|
||||||
progressbar.OptionSetWriter(os.Stderr),
|
progressbar.OptionSetWriter(os.Stderr),
|
||||||
progressbar.OptionSetWidth(15),
|
progressbar.OptionSetWidth(15),
|
||||||
progressbar.OptionShowIts(),
|
progressbar.OptionShowIts(),
|
||||||
progressbar.OptionSetPredictTime(true),
|
progressbar.OptionSetPredictTime(true),
|
||||||
progressbar.OptionSetDescription("[Filter graph on abundance ratio]"),
|
progressbar.OptionSetDescription("[Annotate sequence status]"),
|
||||||
)
|
)
|
||||||
|
|
||||||
bar := progressbar.NewOptions(len(samples), pbopt...)
|
bar = progressbar.NewOptions(len(samples), pbopt...)
|
||||||
|
|
||||||
for _, seqs := range samples {
|
|
||||||
FilterGraphOnRatio(seqs, RatioMax())
|
|
||||||
bar.Add(1)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Mutation(samples)
|
|
||||||
|
|
||||||
pbopt := make([]progressbar.Option, 0, 5)
|
|
||||||
pbopt = append(pbopt,
|
|
||||||
progressbar.OptionSetWriter(os.Stderr),
|
|
||||||
progressbar.OptionSetWidth(15),
|
|
||||||
progressbar.OptionShowIts(),
|
|
||||||
progressbar.OptionSetPredictTime(true),
|
|
||||||
progressbar.OptionSetDescription("[Annotate sequence status]"),
|
|
||||||
)
|
|
||||||
|
|
||||||
bar := progressbar.NewOptions(len(samples), pbopt...)
|
|
||||||
|
|
||||||
for name, seqs := range samples {
|
for name, seqs := range samples {
|
||||||
for _, pcr := range *seqs {
|
for _, pcr := range *seqs {
|
||||||
obistatus := Status(pcr.Sequence)
|
obistatus := Status(pcr.Sequence)
|
||||||
@ -338,7 +350,10 @@ func CLIOBIClean(itertator obiiter.IBioSequence) obiiter.IBioSequence {
|
|||||||
obiweight := Weight(pcr.Sequence)
|
obiweight := Weight(pcr.Sequence)
|
||||||
obiweight[name] = pcr.Weight
|
obiweight[name] = pcr.Weight
|
||||||
}
|
}
|
||||||
bar.Add(1)
|
|
||||||
|
if bar != nil {
|
||||||
|
bar.Add(1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if SaveGraphToFiles() {
|
if SaveGraphToFiles() {
|
||||||
|
Reference in New Issue
Block a user