mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Work on iterators and recycling of biosequences
This commit is contained in:
@ -13,6 +13,6 @@ func main() {
|
||||
|
||||
_, args, _ := optionParser(os.Args)
|
||||
|
||||
fs, _ := obiconvert.ReadBioSequences(args...)
|
||||
obiconvert.WriteBioSequences(fs)
|
||||
fs, _ := obiconvert.ReadBioSequencesBatch(args...)
|
||||
obiconvert.WriteBioSequencesBatch(fs,true)
|
||||
}
|
||||
|
@ -4,7 +4,6 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"runtime/trace"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obiconvert"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obicount"
|
||||
@ -21,12 +20,12 @@ func main() {
|
||||
// pprof.StartCPUProfile(f)
|
||||
// defer pprof.StopCPUProfile()
|
||||
|
||||
ftrace, err := os.Create("cpu.trace")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
trace.Start(ftrace)
|
||||
defer trace.Stop()
|
||||
// ftrace, err := os.Create("cpu.trace")
|
||||
// if err != nil {
|
||||
// log.Fatal(err)
|
||||
// }
|
||||
// trace.Start(ftrace)
|
||||
// defer trace.Stop()
|
||||
|
||||
optionParser := obioptions.GenerateOptionParser(
|
||||
obiconvert.InputOptionSet,
|
||||
@ -47,6 +46,7 @@ func main() {
|
||||
nread += s.Count()
|
||||
nvariant++
|
||||
nsymbol += s.Length()
|
||||
(&s).Recycle()
|
||||
}
|
||||
|
||||
if obicount.IsPrintingVariantCount() {
|
||||
|
@ -1,24 +1,22 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
"runtime/pprof"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiformats"
|
||||
"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/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()
|
||||
// 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")
|
||||
@ -33,6 +31,5 @@ func main() {
|
||||
optionParser(os.Args)
|
||||
pairs, _ := obipairing.IBatchPairedSequence()
|
||||
paired := obipairing.IAssemblePESequencesBatch(pairs, 2, 50, 20, true)
|
||||
written, _ := obiformats.WriteFastqBatchToStdout(paired)
|
||||
written.Destroy()
|
||||
obiconvert.WriteBioSequencesBatch(paired, true)
|
||||
}
|
||||
|
@ -30,5 +30,5 @@ func main() {
|
||||
|
||||
sequences, _ := obiconvert.ReadBioSequencesBatch(args...)
|
||||
amplicons, _ := obipcr.PCR(sequences)
|
||||
obiconvert.WriteBioSequences(amplicons)
|
||||
obiconvert.WriteBioSequencesBatch(amplicons,true)
|
||||
}
|
||||
|
@ -59,4 +59,9 @@ func main() {
|
||||
sA.ReverseComplement(true)
|
||||
fmt.Println(string(sA.Sequence()))
|
||||
fmt.Println(string(sA.Id()))
|
||||
|
||||
sA.Reset()
|
||||
fmt.Println(sA.Length())
|
||||
fmt.Println(sA.String())
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user