mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
First version of obimatrix
Former-commit-id: 6e09eb0dd75bc688a6c83ef40dd88658fb1b296e
This commit is contained in:
56
cmd/obitools/obimatrix/main.go
Normal file
56
cmd/obitools/obimatrix/main.go
Normal file
@ -0,0 +1,56 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
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/obimatrix"
|
||||
)
|
||||
|
||||
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(
|
||||
obimatrix.OptionSet,
|
||||
)
|
||||
|
||||
_, args := optionParser(os.Args)
|
||||
|
||||
fs, err := obiconvert.CLIReadBioSequences(args...)
|
||||
|
||||
if err != nil {
|
||||
log.Errorf("Cannot open file (%v)", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
matrix := obimatrix.IMatrix(fs)
|
||||
|
||||
if obimatrix.CLIOutFormat() == "matrix" {
|
||||
obimatrix.CLIWriteCSVToStdout(matrix)
|
||||
} else {
|
||||
obimatrix.CLIWriteThreeColumnsToStdout(matrix)
|
||||
}
|
||||
fmt.Printf("\n")
|
||||
}
|
@ -34,10 +34,7 @@ func main() {
|
||||
// trace.Start(ftrace)
|
||||
// defer trace.Stop()
|
||||
|
||||
optionParser := obioptions.GenerateOptionParser(
|
||||
obiconvert.InputOptionSet,
|
||||
obisummary.OptionSet,
|
||||
)
|
||||
optionParser := obioptions.GenerateOptionParser(obisummary.OptionSet)
|
||||
|
||||
_, args := optionParser(os.Args)
|
||||
|
||||
|
Reference in New Issue
Block a user