mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Produce less weird crash on non existing files
Former-commit-id: 74bb27bd53c685be530632994bd2ba24c1f362e1
This commit is contained in:
@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions"
|
||||
@ -34,7 +35,13 @@ func main() {
|
||||
|
||||
_, args := optionParser(os.Args)
|
||||
|
||||
sequences, _ := obiconvert.CLIReadBioSequences(args...)
|
||||
sequences, err := obiconvert.CLIReadBioSequences(args...)
|
||||
|
||||
if err != nil {
|
||||
log.Errorf("Cannot open file (%v)",err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
annotator := obiannotate.CLIAnnotationPipeline()
|
||||
obiconvert.CLIWriteBioSequences(sequences.Pipe(annotator), true)
|
||||
|
||||
|
@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obiclean"
|
||||
@ -15,7 +16,12 @@ func main() {
|
||||
|
||||
_, args := optionParser(os.Args)
|
||||
|
||||
fs, _ := obiconvert.CLIReadBioSequences(args...)
|
||||
fs, err := obiconvert.CLIReadBioSequences(args...)
|
||||
|
||||
if err != nil {
|
||||
log.Errorf("Cannot open file (%v)",err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
cleaned := obiclean.IOBIClean(fs)
|
||||
|
||||
|
@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obicleandb"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obiconvert"
|
||||
@ -14,7 +15,12 @@ func main() {
|
||||
|
||||
_, args := optionParser(os.Args)
|
||||
|
||||
fs, _ := obiconvert.CLIReadBioSequences(args...)
|
||||
fs, err := obiconvert.CLIReadBioSequences(args...)
|
||||
|
||||
if err != nil {
|
||||
log.Errorf("Cannot open file (%v)",err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
cleaned := obicleandb.ICleanDB(fs)
|
||||
|
||||
|
@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
@ -15,7 +16,12 @@ func main() {
|
||||
|
||||
_, args := optionParser(os.Args)
|
||||
|
||||
fs, _ := obiconvert.CLIReadBioSequences(args...)
|
||||
fs, err := obiconvert.CLIReadBioSequences(args...)
|
||||
|
||||
if err != nil {
|
||||
log.Errorf("Cannot open file (%v)",err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
comp := fs.MakeIWorker(obiseq.ReverseComplementWorker(true))
|
||||
obiconvert.CLIWriteBioSequences(comp, true)
|
||||
|
@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obiconvert"
|
||||
@ -14,7 +15,13 @@ func main() {
|
||||
|
||||
_, args := optionParser(os.Args)
|
||||
|
||||
fs, _ := obiconvert.CLIReadBioSequences(args...)
|
||||
fs, err := obiconvert.CLIReadBioSequences(args...)
|
||||
|
||||
if err != nil {
|
||||
log.Errorf("Cannot open file (%v)",err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
obiconvert.CLIWriteBioSequences(fs, true)
|
||||
|
||||
obiiter.WaitForLastPipe()
|
||||
|
@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obiconvert"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obicount"
|
||||
@ -33,7 +34,13 @@ func main() {
|
||||
|
||||
_, args := optionParser(os.Args)
|
||||
|
||||
fs, _ := obiconvert.CLIReadBioSequences(args...)
|
||||
fs, err := obiconvert.CLIReadBioSequences(args...)
|
||||
|
||||
if err != nil {
|
||||
log.Errorf("Cannot open file (%v)",err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
nvariant, nread, nsymbol := fs.Count(true)
|
||||
|
||||
if obicount.CLIIsPrintingVariantCount() {
|
||||
|
@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions"
|
||||
@ -14,7 +15,13 @@ func main() {
|
||||
|
||||
_, args := optionParser(os.Args)
|
||||
|
||||
fs, _ := obiconvert.CLIReadBioSequences(args...)
|
||||
fs, err := obiconvert.CLIReadBioSequences(args...)
|
||||
|
||||
if err != nil {
|
||||
log.Errorf("Cannot open file (%v)",err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
obicsv.CLIWriteCSV(fs, true)
|
||||
|
||||
obiiter.WaitForLastPipe()
|
||||
|
@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obiconvert"
|
||||
@ -15,7 +16,12 @@ func main() {
|
||||
|
||||
_, args := optionParser(os.Args)
|
||||
|
||||
fs, _ := obiconvert.CLIReadBioSequences(args...)
|
||||
fs, err := obiconvert.CLIReadBioSequences(args...)
|
||||
|
||||
if err != nil {
|
||||
log.Errorf("Cannot open file (%v)",err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
obidistribute.DistributeSequence(fs)
|
||||
|
||||
|
@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions"
|
||||
@ -34,7 +35,12 @@ func main() {
|
||||
|
||||
_, args := optionParser(os.Args)
|
||||
|
||||
sequences, _ := obiconvert.CLIReadBioSequences(args...)
|
||||
sequences, err := obiconvert.CLIReadBioSequences(args...)
|
||||
|
||||
if err != nil {
|
||||
log.Errorf("Cannot open file (%v)",err)
|
||||
os.Exit(1)
|
||||
}
|
||||
selected := obigrep.CLIFilterSequence(sequences)
|
||||
obiconvert.CLIWriteBioSequences(selected, true)
|
||||
obiiter.WaitForLastPipe()
|
||||
|
@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions"
|
||||
@ -29,7 +30,12 @@ func main() {
|
||||
|
||||
_, args := optionParser(os.Args)
|
||||
|
||||
sequences, _ := obiconvert.CLIReadBioSequences(args...)
|
||||
sequences, err := obiconvert.CLIReadBioSequences(args...)
|
||||
|
||||
if err != nil {
|
||||
log.Errorf("Cannot open file (%v)",err)
|
||||
os.Exit(1)
|
||||
}
|
||||
amplicons, _ := obimultiplex.IExtractBarcode(sequences)
|
||||
obiconvert.CLIWriteBioSequences(amplicons, true)
|
||||
amplicons.Wait()
|
||||
|
@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions"
|
||||
@ -30,7 +31,13 @@ func main() {
|
||||
optionParser := obioptions.GenerateOptionParser(obipairing.OptionSet)
|
||||
|
||||
optionParser(os.Args)
|
||||
pairs, _ := obipairing.CLIPairedSequence()
|
||||
pairs, err := obipairing.CLIPairedSequence()
|
||||
|
||||
if err != nil {
|
||||
log.Errorf("Cannot open file (%v)",err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
paired := obipairing.IAssemblePESequencesBatch(pairs,
|
||||
obipairing.CLIGapPenality(),
|
||||
obipairing.CLIDelta(),
|
||||
|
@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions"
|
||||
@ -31,7 +32,13 @@ func main() {
|
||||
|
||||
_, args := optionParser(os.Args)
|
||||
|
||||
sequences, _ := obiconvert.CLIReadBioSequences(args...)
|
||||
sequences, err := obiconvert.CLIReadBioSequences(args...)
|
||||
|
||||
if err != nil {
|
||||
log.Errorf("Cannot open file (%v)",err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
amplicons, _ := obipcr.PCR(sequences)
|
||||
obiconvert.CLIWriteBioSequences(amplicons, true)
|
||||
obiiter.WaitForLastPipe()
|
||||
|
@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obiconvert"
|
||||
@ -15,7 +16,12 @@ func main() {
|
||||
|
||||
_, args := optionParser(os.Args)
|
||||
|
||||
fs, _ := obiconvert.CLIReadBioSequences(args...)
|
||||
fs, err := obiconvert.CLIReadBioSequences(args...)
|
||||
|
||||
if err != nil {
|
||||
log.Errorf("Cannot open file (%v)",err)
|
||||
os.Exit(1)
|
||||
}
|
||||
indexed := obirefidx.IndexReferenceDB(fs)
|
||||
|
||||
obiconvert.CLIWriteBioSequences(indexed, true)
|
||||
|
@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obiconvert"
|
||||
@ -33,7 +34,13 @@ func main() {
|
||||
|
||||
_, args := optionParser(os.Args)
|
||||
|
||||
fs, _ := obiconvert.CLIReadBioSequences(args...)
|
||||
fs, err := obiconvert.CLIReadBioSequences(args...)
|
||||
|
||||
if err != nil {
|
||||
log.Errorf("Cannot open file (%v)",err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
identified := obitag.AssignTaxonomy(fs)
|
||||
|
||||
obiconvert.CLIWriteBioSequences(identified, true)
|
||||
|
@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions"
|
||||
@ -34,7 +35,13 @@ func main() {
|
||||
|
||||
_, args := optionParser(os.Args)
|
||||
|
||||
sequences, _ := obiconvert.CLIReadBioSequences(args...)
|
||||
sequences, err := obiconvert.CLIReadBioSequences(args...)
|
||||
|
||||
if err != nil {
|
||||
log.Errorf("Cannot open file (%v)",err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
unique := obiuniq.Unique(sequences)
|
||||
obiconvert.CLIWriteBioSequences(unique, true)
|
||||
|
||||
|
Reference in New Issue
Block a user