mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Normalise the managment of speed measure
This commit is contained in:
@ -36,7 +36,7 @@ func main() {
|
||||
|
||||
sequences, _ := obiconvert.ReadBioSequences(args...)
|
||||
annotator := obiannotate.CLIAnnotationPipeline()
|
||||
obiconvert.WriteBioSequences(sequences.Pipe(annotator).Speed(), true)
|
||||
obiconvert.CLIWriteBioSequences(sequences.Pipe(annotator), true)
|
||||
|
||||
obiiter.WaitForLastPipe()
|
||||
|
||||
|
@ -19,7 +19,7 @@ func main() {
|
||||
|
||||
cleaned := obiclean.IOBIClean(fs)
|
||||
|
||||
obiconvert.WriteBioSequences(cleaned, true)
|
||||
obiconvert.CLIWriteBioSequences(cleaned, true)
|
||||
|
||||
obiiter.WaitForLastPipe()
|
||||
|
||||
|
22
cmd/obitools/obicleandb/main.go
Normal file
22
cmd/obitools/obicleandb/main.go
Normal file
@ -0,0 +1,22 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obicleandb"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obiconvert"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions"
|
||||
)
|
||||
|
||||
func main() {
|
||||
optionParser := obioptions.GenerateOptionParser(obicleandb.OptionSet)
|
||||
|
||||
_, args, _ := optionParser(os.Args)
|
||||
|
||||
fs, _ := obiconvert.ReadBioSequences(args...)
|
||||
|
||||
cleaned := obicleandb.ICleanDB(fs)
|
||||
|
||||
obiconvert.CLIWriteBioSequences(cleaned, true)
|
||||
}
|
@ -18,7 +18,7 @@ func main() {
|
||||
fs, _ := obiconvert.ReadBioSequences(args...)
|
||||
|
||||
comp := fs.MakeIWorker(obiseq.ReverseComplementWorker(true))
|
||||
obiconvert.WriteBioSequences(comp, true)
|
||||
obiconvert.CLIWriteBioSequences(comp, true)
|
||||
|
||||
obiiter.WaitForLastPipe()
|
||||
|
||||
|
@ -15,7 +15,7 @@ func main() {
|
||||
_, args, _ := optionParser(os.Args)
|
||||
|
||||
fs, _ := obiconvert.ReadBioSequences(args...)
|
||||
obiconvert.WriteBioSequences(fs, true)
|
||||
obiconvert.CLIWriteBioSequences(fs, true)
|
||||
|
||||
obiiter.WaitForLastPipe()
|
||||
|
||||
|
@ -36,7 +36,7 @@ func main() {
|
||||
|
||||
sequences, _ := obiconvert.ReadBioSequences(args...)
|
||||
selected := obigrep.IFilterSequence(sequences)
|
||||
obiconvert.WriteBioSequences(selected, true)
|
||||
obiconvert.CLIWriteBioSequences(selected, true)
|
||||
obiiter.WaitForLastPipe()
|
||||
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ func main() {
|
||||
|
||||
sequences, _ := obiconvert.ReadBioSequences(args...)
|
||||
amplicons, _ := obimultiplex.IExtractBarcode(sequences)
|
||||
obiconvert.WriteBioSequences(amplicons, true)
|
||||
obiconvert.CLIWriteBioSequences(amplicons, true)
|
||||
amplicons.Wait()
|
||||
obiiter.WaitForLastPipe()
|
||||
|
||||
|
@ -39,7 +39,7 @@ func main() {
|
||||
obipairing.WithStats(),
|
||||
obioptions.CLIParallelWorkers(),
|
||||
)
|
||||
obiconvert.WriteBioSequences(paired, true)
|
||||
obiconvert.CLIWriteBioSequences(paired, true)
|
||||
|
||||
obiiter.WaitForLastPipe()
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ func main() {
|
||||
|
||||
sequences, _ := obiconvert.ReadBioSequences(args...)
|
||||
amplicons, _ := obipcr.PCR(sequences)
|
||||
obiconvert.WriteBioSequences(amplicons, true)
|
||||
obiconvert.CLIWriteBioSequences(amplicons, true)
|
||||
obiiter.WaitForLastPipe()
|
||||
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ func main() {
|
||||
fs, _ := obiconvert.ReadBioSequences(args...)
|
||||
indexed := obirefidx.IndexReferenceDB(fs)
|
||||
|
||||
obiconvert.WriteBioSequences(indexed, true)
|
||||
obiconvert.CLIWriteBioSequences(indexed, true)
|
||||
obiiter.WaitForLastPipe()
|
||||
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ func main() {
|
||||
fs, _ := obiconvert.ReadBioSequences(args...)
|
||||
identified := obitag.AssignTaxonomy(fs)
|
||||
|
||||
obiconvert.WriteBioSequences(identified, true)
|
||||
obiconvert.CLIWriteBioSequences(identified, true)
|
||||
obiiter.WaitForLastPipe()
|
||||
|
||||
fmt.Println("")
|
||||
|
@ -36,7 +36,7 @@ func main() {
|
||||
|
||||
sequences, _ := obiconvert.ReadBioSequences(args...)
|
||||
unique := obiuniq.Unique(sequences)
|
||||
obiconvert.WriteBioSequences(unique, true)
|
||||
obiconvert.CLIWriteBioSequences(unique, true)
|
||||
|
||||
obiiter.WaitForLastPipe()
|
||||
|
||||
|
@ -24,6 +24,8 @@ var __output_fastjson_format__ = false
|
||||
var __output_fastobi_format__ = false
|
||||
var __output_solexa_quality__ = false
|
||||
|
||||
var __no_progress_bar__ = false
|
||||
|
||||
func InputOptionSet(options *getoptions.GetOpt) {
|
||||
// options.IntVar(&__skipped_entries__, "skip", __skipped_entries__,
|
||||
// options.Description("The N first sequence records of the file are discarded from the analysis and not reported to the output file."))
|
||||
@ -67,8 +69,8 @@ func OutputOptionSet(options *getoptions.GetOpt) {
|
||||
options.Alias("O"),
|
||||
options.Description("output FASTA/FASTQ title line annotations follow OBI format."))
|
||||
|
||||
options.BoolVar(&__output_solexa_quality__, "solexa-output", false,
|
||||
options.Description("Encodes quality string according to the Solexa specification."))
|
||||
options.BoolVar(&__no_progress_bar__, "no-progressbar", false,
|
||||
options.Description("Disable the progress bar printing"))
|
||||
}
|
||||
|
||||
func OptionSet(options *getoptions.GetOpt) {
|
||||
@ -154,3 +156,7 @@ func CLIOutputQualityShift() int {
|
||||
return 33
|
||||
}
|
||||
}
|
||||
|
||||
func CLIProgressBar() bool {
|
||||
return !__no_progress_bar__
|
||||
}
|
||||
|
@ -8,9 +8,12 @@ import (
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions"
|
||||
)
|
||||
|
||||
func WriteBioSequences(iterator obiiter.IBioSequence,
|
||||
func CLIWriteBioSequences(iterator obiiter.IBioSequence,
|
||||
terminalAction bool, filenames ...string) (obiiter.IBioSequence, error) {
|
||||
|
||||
if CLIProgressBar() {
|
||||
iterator = iterator.Speed()
|
||||
}
|
||||
var newIter obiiter.IBioSequence
|
||||
|
||||
opts := make([]obiformats.WithOption, 0, 10)
|
||||
|
@ -22,7 +22,7 @@ func IFilterSequence(iterator obiiter.IBioSequence) obiiter.IBioSequence {
|
||||
obioptions.CLIBatchSize())
|
||||
|
||||
go func() {
|
||||
_, err := obiconvert.WriteBioSequences(discarded,
|
||||
_, err := obiconvert.CLIWriteBioSequences(discarded,
|
||||
true,
|
||||
CLIDiscardedFileName())
|
||||
|
||||
|
@ -44,7 +44,7 @@ func IExtractBarcode(iterator obiiter.IBioSequence) (obiiter.IBioSequence, error
|
||||
obioptions.CLIBatchSize())
|
||||
|
||||
go func() {
|
||||
_, err := obiconvert.WriteBioSequences(unidentified,
|
||||
_, err := obiconvert.CLIWriteBioSequences(unidentified,
|
||||
true,
|
||||
CLIUnidentifiedFileName())
|
||||
|
||||
|
@ -192,5 +192,5 @@ func AssignTaxonomy(iterator obiiter.IBioSequence) obiiter.IBioSequence {
|
||||
|
||||
worker := IdentifySeqWorker(references, refcounts, taxo, CLIRunExact())
|
||||
|
||||
return iterator.Rebatch(17).MakeIWorker(worker, obioptions.CLIParallelWorkers(), 0).Speed("Annotated sequences").Rebatch(1000)
|
||||
return iterator.Rebatch(17).MakeIWorker(worker, obioptions.CLIParallelWorkers(), 0).Rebatch(1000)
|
||||
}
|
||||
|
Reference in New Issue
Block a user