mirror of
https://github.com/metabarcoding/obitools4.git
synced 2026-05-01 04:20:40 +00:00
[obitools] Add validation for paired files and config template support
- Enforce requirement of both forward (-F) and reverse files in obipairing/main.go - Add config template support to obtagpcr via CLIAskConfigTemplate() - Remove redundant Required() constraints in options.go - Introduce new helper CLIHasPairedFiles()
This commit is contained in:
@@ -37,6 +37,11 @@ func main() {
|
||||
|
||||
optionParser(os.Args)
|
||||
|
||||
if !obipairing.CLIHasPairedFiles() {
|
||||
log.Error("You must provide both a forward file (-F) and a reverse file (-R)")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
obidefault.SetStrictReadWorker(2)
|
||||
obidefault.SetStrictWriteWorker(2)
|
||||
pairs, err := obipairing.CLIPairedSequence()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
@@ -8,6 +9,7 @@ import (
|
||||
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obidefault"
|
||||
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obioptions"
|
||||
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitools/obiconvert"
|
||||
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitools/obimultiplex"
|
||||
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitools/obipairing"
|
||||
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitools/obitagpcr"
|
||||
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils"
|
||||
@@ -39,6 +41,17 @@ func main() {
|
||||
obitagpcr.OptionSet)
|
||||
|
||||
optionParser(os.Args)
|
||||
|
||||
if obimultiplex.CLIAskConfigTemplate() {
|
||||
fmt.Print(obimultiplex.CLIConfigTemplate())
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
if !obipairing.CLIHasPairedFiles() {
|
||||
log.Error("You must provide both a forward file (-F) and a reverse file (-R)")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
pairs, err := obipairing.CLIPairedSequence()
|
||||
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user