mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Patch module name from oa2 to obitools
This commit is contained in:
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
cpu.pprof
|
||||
cpu.trace
|
||||
obicount
|
||||
obipairing
|
@ -3,9 +3,9 @@ package main
|
||||
import (
|
||||
"os"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obitools/obiconvert"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obiconvert"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obioptions"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -6,10 +6,10 @@ import (
|
||||
"os"
|
||||
"runtime/trace"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obitools/obiconvert"
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obitools/obicount"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obiconvert"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obicount"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obioptions"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -4,8 +4,8 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obioptions"
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obitools/obifind"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obifind"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -5,9 +5,9 @@ import (
|
||||
"os"
|
||||
"runtime/pprof"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiformats"
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obioptions"
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obitools/obipairing"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiformats"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obipairing"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -3,9 +3,9 @@ package main
|
||||
import (
|
||||
"os"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obioptions"
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obitools/obiconvert"
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obitools/obipcr"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obiconvert"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obipcr"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -6,8 +6,8 @@ import (
|
||||
"os"
|
||||
"runtime/trace"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obialign"
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiseq"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obialign"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -4,9 +4,9 @@ import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiannot"
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiformats"
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiseq"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiannot"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiformats"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
)
|
||||
|
||||
func TestParseOBIFasta(t *testing.T) {
|
||||
|
15
go.mod
Normal file
15
go.mod
Normal file
@ -0,0 +1,15 @@
|
||||
module git.metabarcoding.org/lecasofts/go/obitools
|
||||
|
||||
go 1.17
|
||||
|
||||
require (
|
||||
github.com/DavidGamba/go-getoptions v0.25.0 // indirect
|
||||
github.com/goccy/go-json v0.9.1 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.13 // indirect
|
||||
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
|
||||
github.com/rivo/uniseg v0.2.0 // indirect
|
||||
github.com/schollz/progressbar/v3 v3.8.5 // indirect
|
||||
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 // indirect
|
||||
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
|
||||
)
|
5
go.sum
5
go.sum
@ -57,6 +57,8 @@ github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym
|
||||
github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
|
||||
github.com/DavidGamba/go-getoptions v0.24.0 h1:Nz9lUWRjzxdkC4YRU5UaqiHZS0uA/Ak9b9FCfD1AlUM=
|
||||
github.com/DavidGamba/go-getoptions v0.24.0/go.mod h1:qLaLSYeQ8sUVOfKuu5JT5qKKS3OCwyhkYSJnoG+ggmo=
|
||||
github.com/DavidGamba/go-getoptions v0.25.0 h1:lc66nzD7BPN9RtNN6us8FWFFUjKi7C4+EF8MPMj+I9U=
|
||||
github.com/DavidGamba/go-getoptions v0.25.0/go.mod h1:qLaLSYeQ8sUVOfKuu5JT5qKKS3OCwyhkYSJnoG+ggmo=
|
||||
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs=
|
||||
github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
|
||||
github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
|
||||
@ -198,6 +200,8 @@ github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b/go.mod h1:aUCEOzz
|
||||
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
|
||||
github.com/goccy/go-json v0.7.10 h1:ulhbuNe1JqE68nMRXXTJRrUu0uhouf0VevLINxQq4Ec=
|
||||
github.com/goccy/go-json v0.7.10/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
|
||||
github.com/goccy/go-json v0.9.1 h1:xurvfvj3gq6SWUkkZ0opoUDTms7jif41uZ9z9s+hVlY=
|
||||
github.com/goccy/go-json v0.9.1/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
|
||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
|
||||
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||
@ -912,6 +916,7 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
golang.org/x/sys v0.0.0-20211013075003-97ac67df715c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211124211545-fe61309f8881 h1:TyHqChC80pFkXWraUUf6RuB5IqFdQieMLwwCJokV2pc=
|
||||
golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM=
|
||||
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220111092808-5a964db01320 h1:0jf+tOCoZ3LyutmCOWpVni1chK4VfFLhRsDK7MhqGRY=
|
||||
golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
|
@ -1,18 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obitools/obiconvert"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obioptions"
|
||||
)
|
||||
|
||||
func main() {
|
||||
option_parser := obioptions.GenerateOptionParser(obiconvert.OptionSet)
|
||||
|
||||
_, args, _ := option_parser(os.Args)
|
||||
|
||||
fs, _ := obiconvert.ReadBioSequences(args...)
|
||||
obiconvert.WriteBioSequences(fs)
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"runtime/trace"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obitools/obiconvert"
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obitools/obicount"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obioptions"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
// f, err := os.Create("cpu.pprof")
|
||||
// if err != nil {
|
||||
// log.Fatal(err)
|
||||
// }
|
||||
// pprof.StartCPUProfile(f)
|
||||
// defer pprof.StopCPUProfile()
|
||||
|
||||
ftrace, err := os.Create("cpu.trace")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
trace.Start(ftrace)
|
||||
defer trace.Stop()
|
||||
|
||||
option_parser := obioptions.GenerateOptionParser(
|
||||
obiconvert.InputOptionSet,
|
||||
obicount.OptionSet,
|
||||
)
|
||||
|
||||
_, args, _ := option_parser(os.Args)
|
||||
|
||||
fs, _ := obiconvert.ReadBioSequences(args...)
|
||||
nread := 0
|
||||
nvariant := 0
|
||||
nsymbol := 0
|
||||
for fs.Next() {
|
||||
s := fs.Get()
|
||||
if s.IsNil() {
|
||||
log.Panicln("Read sequence is nil")
|
||||
}
|
||||
nread += s.Count()
|
||||
nvariant++
|
||||
nsymbol += s.Length()
|
||||
}
|
||||
|
||||
if obicount.IsPrintingVariantCount() {
|
||||
fmt.Printf(" %d", nvariant)
|
||||
}
|
||||
|
||||
if obicount.IsPrintingReadCount() {
|
||||
fmt.Printf(" %d", nread)
|
||||
}
|
||||
|
||||
if obicount.IsPrintingSymbolCount() {
|
||||
fmt.Printf(" %d", nsymbol)
|
||||
}
|
||||
|
||||
fmt.Printf("\n")
|
||||
}
|
@ -1,68 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obioptions"
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obitools/obifind"
|
||||
)
|
||||
|
||||
func main() {
|
||||
option_parser := obioptions.GenerateOptionParser(obifind.OptionSet)
|
||||
|
||||
_, args, _ := option_parser(os.Args)
|
||||
|
||||
//prof, _ := os.Create("obifind.prof")
|
||||
//pprof.StartCPUProfile(prof)
|
||||
|
||||
restrictions, err := obifind.ITaxonRestrictions()
|
||||
if err != nil {
|
||||
fmt.Printf("%+v", err)
|
||||
}
|
||||
|
||||
switch {
|
||||
case obifind.RequestsPathForTaxid() >= 0:
|
||||
taxonomy, err := obifind.LoadSelectedTaxonomy()
|
||||
if err != nil {
|
||||
fmt.Printf("%+v", err)
|
||||
}
|
||||
|
||||
taxon, err := taxonomy.Taxon(obifind.RequestsPathForTaxid())
|
||||
|
||||
if err != nil {
|
||||
fmt.Printf("%+v", err)
|
||||
}
|
||||
|
||||
s, err := taxon.Path()
|
||||
|
||||
if err != nil {
|
||||
fmt.Printf("%+v", err)
|
||||
}
|
||||
|
||||
obifind.TaxonWriter(s.Iterator(),
|
||||
fmt.Sprintf("path:%d", taxon.Taxid()))
|
||||
|
||||
case len(args) == 0:
|
||||
taxonomy, err := obifind.LoadSelectedTaxonomy()
|
||||
if err != nil {
|
||||
fmt.Printf("%+v", err)
|
||||
}
|
||||
|
||||
obifind.TaxonWriter(restrictions(taxonomy.Iterator()), "")
|
||||
|
||||
default:
|
||||
matcher, err := obifind.ITaxonNameMatcher()
|
||||
|
||||
if err != nil {
|
||||
fmt.Printf("%+v", err)
|
||||
}
|
||||
|
||||
for _, pattern := range args {
|
||||
s := restrictions(matcher(pattern))
|
||||
obifind.TaxonWriter(s, pattern)
|
||||
}
|
||||
}
|
||||
|
||||
//pprof.StopCPUProfile()
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
"runtime/pprof"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiformats"
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obioptions"
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obitools/obipairing"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
// 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()
|
||||
|
||||
option_parser := obioptions.GenerateOptionParser(obipairing.OptionSet)
|
||||
|
||||
option_parser(os.Args)
|
||||
pairs, _ := obipairing.IBatchPairedSequence()
|
||||
paired := obipairing.IAssemblePESequencesBatch(pairs, 2, 50, 20, true)
|
||||
written, _ := obiformats.WriteFastqBatchToStdout(paired)
|
||||
written.Destroy()
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obioptions"
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obitools/obiconvert"
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obitools/obipcr"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
// f, err := os.Create("cpu.pprof")
|
||||
// if err != nil {
|
||||
// log.Fatal(err)
|
||||
// }
|
||||
// pprof.StartCPUProfile(f)
|
||||
// defer pprof.StopCPUProfile()
|
||||
|
||||
// ftrace, err := os.Create("cpu.trace")
|
||||
// if err != nil {
|
||||
// log.Fatal(err)
|
||||
// }
|
||||
// trace.Start(ftrace)
|
||||
// defer trace.Stop()
|
||||
|
||||
option_parser := obioptions.GenerateOptionParser(obipcr.OptionSet)
|
||||
|
||||
_, args, _ := option_parser(os.Args)
|
||||
|
||||
sequences, _ := obiconvert.ReadBioSequencesBatch(args...)
|
||||
amplicons, _ := obipcr.PCR(sequences)
|
||||
obiconvert.WriteBioSequences(amplicons)
|
||||
}
|
@ -3,7 +3,7 @@ package obialign
|
||||
import (
|
||||
"math"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiseq"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
)
|
||||
|
||||
type __build_align_arena__ struct {
|
||||
|
@ -1,7 +1,7 @@
|
||||
package obialign
|
||||
|
||||
import (
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiseq"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
)
|
||||
|
||||
var __four_bits_base_code__ = []byte{0b0000,
|
||||
|
@ -3,8 +3,8 @@ package obialign
|
||||
import (
|
||||
"log"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obikmer"
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiseq"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obikmer"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
)
|
||||
|
||||
type __pe_align_arena__ struct {
|
||||
|
@ -10,7 +10,7 @@ import (
|
||||
"errors"
|
||||
"unsafe"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiseq"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
)
|
||||
|
||||
var MAX_PAT_LEN = int(C.MAX_PAT_LEN)
|
||||
|
@ -1,8 +1,8 @@
|
||||
package obiapat
|
||||
|
||||
import (
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/goutils"
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiseq"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/goutils"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
)
|
||||
|
||||
type __options__ struct {
|
||||
|
@ -10,7 +10,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiseq"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
)
|
||||
|
||||
type __ecopcr_file__ struct {
|
||||
|
@ -11,7 +11,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiseq"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
)
|
||||
|
||||
var __FILE_CHUNK_SIZE__ = 1 << 20
|
||||
|
@ -3,7 +3,7 @@ package obiformats
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiseq"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
)
|
||||
|
||||
func ParseGuessedFastSeqHeader(sequence obiseq.BioSequence) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
package obiformats
|
||||
|
||||
import "git.metabarcoding.org/lecasofts/go/oa2/pkg/obiseq"
|
||||
import "git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
|
||||
type FormatHeader func(sequence obiseq.BioSequence) string
|
||||
|
@ -3,7 +3,7 @@ package obiformats
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiseq"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
"github.com/goccy/go-json"
|
||||
)
|
||||
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiseq"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
"github.com/goccy/go-json"
|
||||
)
|
||||
|
||||
|
@ -14,8 +14,8 @@ import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/cutils"
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiseq"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/cutils"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
)
|
||||
|
||||
func __fastseq_reader__(seqfile C.fast_kseq_p,
|
||||
|
@ -10,7 +10,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiseq"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
)
|
||||
|
||||
func min(x, y int) int {
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiseq"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
)
|
||||
|
||||
func FormatFastq(seq obiseq.BioSequence, quality_shift int, formater FormatHeader) string {
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obitax"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitax"
|
||||
)
|
||||
|
||||
func loadNodeTable(reader io.Reader, taxonomy *obitax.Taxonomy) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package obiformats
|
||||
|
||||
import "git.metabarcoding.org/lecasofts/go/oa2/pkg/obiseq"
|
||||
import "git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
|
||||
type __options__ struct {
|
||||
fastseq_header_parser obiseq.SeqAnnotator
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiseq"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
)
|
||||
|
||||
func GuessSeqFileType(firstline string) string {
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiseq"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
)
|
||||
|
||||
func WriteSequences(iterator obiseq.IBioSequence,
|
||||
|
@ -1,6 +1,6 @@
|
||||
package obikmer
|
||||
|
||||
import "git.metabarcoding.org/lecasofts/go/oa2/pkg/obiseq"
|
||||
import "git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
|
||||
var __single_base_code__ = []byte{0,
|
||||
// A, B, C, D,
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"bytes"
|
||||
"crypto/md5"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/goutils"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/goutils"
|
||||
)
|
||||
|
||||
type Quality []uint8
|
||||
|
@ -1,6 +1,6 @@
|
||||
package obiseq
|
||||
|
||||
import "git.metabarcoding.org/lecasofts/go/oa2/pkg/goutils"
|
||||
import "git.metabarcoding.org/lecasofts/go/obitools/pkg/goutils"
|
||||
|
||||
func (sequence BioSequence) Join(seq2 BioSequence, copy_annot bool) (BioSequence, error) {
|
||||
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/goutils"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/goutils"
|
||||
)
|
||||
|
||||
// Returns a sub sequence start from position 'from' included,
|
||||
|
@ -6,8 +6,8 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiformats"
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiseq"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiformats"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
)
|
||||
|
||||
func __expand_list_of_files__(check_ext bool, filenames ...string) ([]string, error) {
|
||||
|
@ -3,8 +3,8 @@ package obiconvert
|
||||
import (
|
||||
"log"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiformats"
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiseq"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiformats"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
)
|
||||
|
||||
func WriteBioSequences(iterator obiseq.IBioSequence, filenames ...string) error {
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obitax"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitax"
|
||||
)
|
||||
|
||||
func IFilterRankRestriction() func(*obitax.ITaxonSet) *obitax.ITaxonSet {
|
||||
|
@ -3,8 +3,8 @@ package obifind
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiformats/ncbitaxdump"
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obitax"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiformats/ncbitaxdump"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitax"
|
||||
"github.com/DavidGamba/go-getoptions"
|
||||
)
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
package obipairing
|
||||
|
||||
import (
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiseq"
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obitools/obiconvert"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obiconvert"
|
||||
"github.com/DavidGamba/go-getoptions"
|
||||
)
|
||||
|
||||
|
@ -6,8 +6,8 @@ import (
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obialign"
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiseq"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obialign"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
"github.com/schollz/progressbar/v3"
|
||||
)
|
||||
|
||||
|
@ -3,8 +3,8 @@ package obipcr
|
||||
import (
|
||||
"log"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiapat"
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obitools/obiconvert"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiapat"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obiconvert"
|
||||
"github.com/DavidGamba/go-getoptions"
|
||||
)
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
package obipcr
|
||||
|
||||
import (
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiapat"
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiseq"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiapat"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
)
|
||||
|
||||
func PCR(iterator obiseq.IBioSequenceBatch) (obiseq.IBioSequence, error) {
|
||||
|
62
test/main.go
62
test/main.go
@ -1,62 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"runtime/trace"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obialign"
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiseq"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
ftrace, err := os.Create("cpu.trace")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
trace.Start(ftrace)
|
||||
defer trace.Stop()
|
||||
|
||||
// option_parser := obioptions.GenerateOptionParser(
|
||||
// obiconvert.InputOptionSet,
|
||||
// )
|
||||
|
||||
//_, args, _ := option_parser(os.Args)
|
||||
|
||||
// fs, _ := obiconvert.ReadBioSequences(args...)
|
||||
// buffer := make([]byte, 0)
|
||||
// fs.Next()
|
||||
// s := fs.Get()
|
||||
// index := obikmer.Index4mer(s, nil, nil)
|
||||
// for fs.Next() {
|
||||
// s := fs.Get()
|
||||
// if s.IsNil() {
|
||||
// log.Panicln("Read sequence is nil")
|
||||
// }
|
||||
// maxshift, maxcount := obikmer.FastShiftFourMer(index, s, buffer)
|
||||
|
||||
// fmt.Printf("Shift : %d Score : %d\n", maxshift, maxcount)
|
||||
// }
|
||||
|
||||
A := []byte("ccgcctccttagaacaggctcctctagaaaaccatagtgggatatctaaagaaggcggagatagaaagagcggttcagcaggaatgccgagatggacggcgtgtgacg")
|
||||
B := []byte("cgccaccaccgagatctacactctttccctacacgacgctcttccgatctccgcctccttagaacaggctcctctagaaaagcatagtggggtatctaaaggaggcgg")
|
||||
sA := obiseq.MakeBioSequence("A", A, "")
|
||||
sB := obiseq.MakeBioSequence("B", B, "")
|
||||
|
||||
fmt.Println(string(sA.Sequence()))
|
||||
fmt.Println(sA.Qualities())
|
||||
fmt.Println(string(sB.Sequence()))
|
||||
fmt.Println(sB.Qualities())
|
||||
|
||||
score, path := obialign.PELeftAlign(sA, sB, 2, obialign.NilPEAlignArena)
|
||||
fmt.Printf("Score : %d Path : %v\n", score, path)
|
||||
score, path = obialign.PERightAlign(sA, sB, 2, obialign.NilPEAlignArena)
|
||||
fmt.Printf("Score : %d Path : %v\n", score, path)
|
||||
|
||||
fmt.Println(string(sA.Sequence()))
|
||||
sA.ReverseComplement(true)
|
||||
fmt.Println(string(sA.Sequence()))
|
||||
fmt.Println(string(sA.Id()))
|
||||
}
|
@ -1,58 +0,0 @@
|
||||
package main_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiannot"
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiformats"
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiseq"
|
||||
)
|
||||
|
||||
func TestParseOBIFasta(t *testing.T) {
|
||||
f := "/Users/coissac/travail/Adeline/Soumission_data/Zonation/euka03/euka03.ecotag.fasta.gz"
|
||||
|
||||
var nseq, nread int
|
||||
nseq = 0
|
||||
nread = 0
|
||||
|
||||
fs := obiformats.ReaderFromIlluminaFile(f)
|
||||
|
||||
fmt.Println(f)
|
||||
|
||||
for i := range obiannot.ExtractHeaderChannel(fs, fastseq.ParseOBIHeader) {
|
||||
for _, s := range i {
|
||||
nseq++
|
||||
nread += s.Count()
|
||||
}
|
||||
}
|
||||
fmt.Println(nseq, nread)
|
||||
|
||||
}
|
||||
|
||||
func ExtractHeaderChannel(fs fastseq.IFastSeq, sequence func(sequence obiseq.Sequence)) {
|
||||
panic("unimplemented")
|
||||
}
|
||||
|
||||
// Performance test of an ADEXP message parsing
|
||||
func BenchmarkParseOBIFasta(t *testing.B) {
|
||||
|
||||
f := "/Users/coissac/travail/Adeline/Soumission_data/Zonation/euka03/euka03.ecotag.fasta.gz"
|
||||
|
||||
var nseq, nread int
|
||||
nseq = 0
|
||||
nread = 0
|
||||
|
||||
fs := fastseq.ReaderFromIlluminaFile(f)
|
||||
|
||||
fmt.Println(f)
|
||||
|
||||
for i := range obiannot.ExtractHeaderChannel(fs, fastseq.ParseOBIHeader) {
|
||||
for _, s := range i {
|
||||
nseq++
|
||||
nread += s.Count()
|
||||
}
|
||||
}
|
||||
fmt.Println(nseq, nread)
|
||||
|
||||
}
|
Reference in New Issue
Block a user