some cleaning

This commit is contained in:
Eric Coissac
2025-02-24 11:31:49 +01:00
parent 8671285d02
commit 51b3e83d32
7 changed files with 64 additions and 97 deletions

View File

@ -19,7 +19,7 @@ func IFragments(minsize, length, overlap, size, nworkers int) Pipeable {
newiter.WaitAndClose()
}()
f := func(iterator IBioSequence, id int) {
f := func(iterator IBioSequence) {
source := ""
for iterator.Next() {
news := obiseq.MakeBioSequenceSlice()
@ -66,9 +66,9 @@ func IFragments(minsize, length, overlap, size, nworkers int) Pipeable {
}
for i := 1; i < nworkers; i++ {
go f(iterator.Split(), i)
go f(iterator.Split())
}
go f(iterator, 0)
go f(iterator)
return newiter.SortBatches().Rebatch(size)
}

View File

@ -8,7 +8,7 @@ import (
// corresponds to the last commit, and not the one when the file will be
// commited
var _Commit = "51d11aa"
var _Commit = "8671285"
var _Version = "Release 4.2.0"
// Version returns the version of the obitools package.

View File

@ -31,7 +31,7 @@ func TaxonomyClassifier(taxonomicRank string,
if taxon != nil {
ttaxon := taxon.TaxonAtRank(taxonomicRank)
if abortOnMissing && ttaxon == nil {
log.Fatalf("Taxon at rank %s not found in taxonomy for taxid %d", taxonomicRank, taxon.String())
log.Fatalf("Taxon at rank %s not found in taxonomy for taxid %s", taxonomicRank, taxon.String())
}
} else {
if abortOnMissing {

View File

@ -25,7 +25,7 @@ func IsAValidTaxon(taxonomy *obitax.Taxonomy, withAutoCorrection ...bool) Sequen
if autocorrection {
sequence.SetTaxid(ttaxid)
log.Printf(
"Sequence %s : Taxid %d updated with %d",
"Sequence %s : Taxid %s updated with %s",
sequence.Id(),
taxid,
ttaxid,

View File

@ -52,35 +52,6 @@ func makeEdge(father, dist, pos int, from, to byte) Edge {
}
}
func abs(x int) int {
if x < 0 {
return -x
}
return x
}
func max(x, y int) int {
if x > y {
return x
}
return y
}
func min(x, y int) int {
if x < y {
return x
}
return y
}
func minMax(x, y int) (int, int) {
if x < y {
return x, y
}
return y, x
}
// It takes a filename and a 2D slice of floats pruduced during graph building,
// and writes a CSV file with the first column being the
// first nucleotide, the second column being the second nucleotide, and the third column being the

View File

@ -57,9 +57,7 @@ func buildSamples(dataset obiseq.BioSequenceSlice,
return samples
}
func annotateOBIClean(source string, dataset obiseq.BioSequenceSlice,
sample map[string]*([]*seqPCR),
tag, NAValue string) obiiter.IBioSequence {
func annotateOBIClean(source string, dataset obiseq.BioSequenceSlice) obiiter.IBioSequence {
batchsize := 1000
var annot = func(data obiseq.BioSequenceSlice) (obiseq.BioSequenceSlice, error) {
@ -365,7 +363,7 @@ func CLIOBIClean(itertator obiiter.IBioSequence) obiiter.IBioSequence {
EmpiricalDistCsv(RatioTableFilename(), all_ratio)
}
iter := annotateOBIClean(source, db, samples, SampleAttribute(), "NA")
iter := annotateOBIClean(source, db)
if OnlyHead() {
iter = iter.FilterOn(IsHead, obidefault.BatchSize())