Several bugs dicoverd during the doc writing

This commit is contained in:
Eric Coissac
2025-04-04 16:59:27 +02:00
parent 03b5ce9397
commit 7542e33010
6 changed files with 38 additions and 11 deletions

View File

@ -4,6 +4,15 @@
### Bug fixes
- In `obipairing` correct the misspelling of the `obiparing_*` tags where the `i`
was missing to `obipairing_`.
- In `obigrep` the **-C** option that excludes sequences too abundant was not
functional.
- In `obitaxonomy` the **-l** option that lists all the taxonomic rank defined by
a taxonomy was not functional
- The file type guesser was not using enough data to be able to correctly detect
file format when sequences were too long in fastq and fasta or when lines were
to long in CSV files. That's now corrected

View File

@ -4,9 +4,11 @@ import (
"os"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obidefault"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiitercsv"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obioptions"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitax"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitools/obiconvert"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitools/obicsv"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitools/obitaxonomy"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils"
@ -37,13 +39,25 @@ func main() {
}
switch {
case obitaxonomy.CLIDownloadNCBI():
err := obitaxonomy.CLIDownloadNCBITaxdump()
if err != nil {
log.Errorf("Cannot download NCBI taxonomy: %s", err.Error())
os.Exit(1)
}
case obitaxonomy.CLIAskForRankList():
newIter := obiitercsv.NewICSVRecord()
newIter.Add(1)
newIter.AppendField("rank")
go func() {
ranks := obitax.DefaultTaxonomy().RankList()
data := make([]obiitercsv.CSVRecord, len(ranks))
for i, rank := range ranks {
record := make(obiitercsv.CSVRecord)
record["rank"] = rank
data[i] = record
}
newIter.Push(obiitercsv.MakeCSVRecordBatch(obitax.DefaultTaxonomy().Name(), 0, data))
newIter.Close()
newIter.Done()
}()
obicsv.CLICSVWriter(newIter, true)
obiutils.WaitForLastPipe()
os.Exit(0)
case obitaxonomy.CLIExtractTaxonomy():

View File

@ -8,7 +8,7 @@ import (
// corresponds to the last commit, and not the one when the file will be
// commited
var _Commit = "2d52322"
var _Commit = "03b5ce9"
var _Version = "Release 4.4.0"
// Version returns the version of the obitools package.

View File

@ -223,7 +223,7 @@ func CLISequenceCountPredicate() obiseq.SequencePredicate {
return p
}
if _MaximumLength != int(2e9) {
if _MaximumCount != int(2e9) {
return obiseq.IsLessAbundantOrEqualTo(_MaximumCount)
}

View File

@ -137,9 +137,9 @@ func AssemblePESequences(seqA, seqB *obiseq.BioSequence,
annot := cons.Annotations()
if fastAlign {
annot["paring_fast_count"] = fastcount
annot["paring_fast_score"] = math.Round(fastscore*1000) / 1000
annot["paring_fast_overlap"] = over
annot["pairing_fast_count"] = fastcount
annot["pairing_fast_score"] = math.Round(fastscore*1000) / 1000
annot["pairing_fast_overlap"] = over
}
if aliLength >= minOverlap && identity >= minIdentity {

View File

@ -165,3 +165,7 @@ func CLIExtractTaxonomy() bool {
func CLIAsNewick() bool {
return __newick__
}
func CLIAskForRankList() bool {
return __rank_list__
}