2022-01-13 23:27:39 +01:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
|
2023-11-29 12:14:37 +01:00
|
|
|
log "github.com/sirupsen/logrus"
|
2022-11-15 08:21:46 +01:00
|
|
|
|
2023-11-29 12:14:37 +01:00
|
|
|
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiiter"
|
|
|
|
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitools/obiconvert"
|
2022-11-15 08:21:46 +01:00
|
|
|
|
2023-11-29 12:14:37 +01:00
|
|
|
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obioptions"
|
|
|
|
)
|
2022-11-15 08:21:46 +01:00
|
|
|
|
2022-01-13 23:27:39 +01:00
|
|
|
func main() {
|
2023-11-29 12:14:37 +01:00
|
|
|
optionParser := obioptions.GenerateOptionParser(obiconvert.OptionSet)
|
2022-01-13 23:27:39 +01:00
|
|
|
|
2023-11-29 12:14:37 +01:00
|
|
|
_, args := optionParser(os.Args)
|
2023-02-01 08:14:29 +01:00
|
|
|
|
2023-11-29 12:14:37 +01:00
|
|
|
fs, err := obiconvert.CLIReadBioSequences(args...)
|
2023-02-01 08:14:29 +01:00
|
|
|
|
2023-11-29 12:14:37 +01:00
|
|
|
if err != nil {
|
|
|
|
log.Errorf("Cannot open file (%v)", err)
|
|
|
|
os.Exit(1)
|
2023-02-01 08:14:29 +01:00
|
|
|
}
|
|
|
|
|
2023-11-29 12:14:37 +01:00
|
|
|
frags := obiiter.IFragments(
|
|
|
|
1000,
|
|
|
|
100,
|
|
|
|
10,
|
|
|
|
100,
|
|
|
|
obioptions.CLIParallelWorkers(),
|
|
|
|
)
|
2022-03-07 16:37:21 +01:00
|
|
|
|
2023-11-29 12:14:37 +01:00
|
|
|
obiconvert.CLIWriteBioSequences(fs.Pipe(frags), true)
|
2022-03-07 16:37:21 +01:00
|
|
|
|
2023-11-29 12:14:37 +01:00
|
|
|
obiiter.WaitForLastPipe()
|
2022-03-07 16:37:21 +01:00
|
|
|
|
2022-01-13 23:27:39 +01:00
|
|
|
}
|