A first version of obigrep. Normally fully functionnal, but not fully tested

This commit is contained in:
2022-02-25 07:29:52 +01:00
parent 0a36447e2a
commit 011898bd9d
11 changed files with 709 additions and 772 deletions

View File

@ -0,0 +1,42 @@
package main
import (
"os"
"runtime/pprof"
log "github.com/sirupsen/logrus"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obiconvert"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obigrep"
)
func main() {
defer obiseq.LogBioSeqStatus()
// go tool pprof -http=":8000" ./obipairing ./cpu.pprof
f, err := os.Create("cpu.pprof")
if err != nil {
log.Fatal(err)
}
pprof.StartCPUProfile(f)
defer pprof.StopCPUProfile()
// go tool trace cpu.trace
// ftrace, err := os.Create("cpu.trace")
// if err != nil {
// log.Fatal(err)
// }
// trace.Start(ftrace)
// defer trace.Stop()
optionParser := obioptions.GenerateOptionParser(obigrep.OptionSet)
_, args, _ := optionParser(os.Args)
sequences, _ := obiconvert.ReadBioSequencesBatch(args...)
selected := obigrep.IFilterSequence(sequences)
obiconvert.WriteBioSequencesBatch(selected, true)
}