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 ### 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 - 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 file format when sequences were too long in fastq and fasta or when lines were
to long in CSV files. That's now corrected to long in CSV files. That's now corrected

View File

@ -4,9 +4,11 @@ import (
"os" "os"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obidefault" "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/obioptions"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitax" "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/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/obitools/obitaxonomy"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils"
@ -37,13 +39,25 @@ func main() {
} }
switch { switch {
case obitaxonomy.CLIDownloadNCBI(): case obitaxonomy.CLIAskForRankList():
err := obitaxonomy.CLIDownloadNCBITaxdump() newIter := obiitercsv.NewICSVRecord()
if err != nil { newIter.Add(1)
log.Errorf("Cannot download NCBI taxonomy: %s", err.Error()) newIter.AppendField("rank")
os.Exit(1) 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) os.Exit(0)
case obitaxonomy.CLIExtractTaxonomy(): case obitaxonomy.CLIExtractTaxonomy():

View File

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

View File

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

View File

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

View File

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