Skip to content

Fix BAM index lookup and --log_level handling (v1.10.1) - #18

Merged
adkinsrs merged 1 commit into
masterfrom
fix-cli-edge-cases
Oct 28, 2026
Merged

adkinsrs merged 1 commit into
masterfrom
fix-cli-edge-cases

Conversation

@adkinsrs

Copy link
Copy Markdown
Member

Summary

  • BAM index lookup: FADU looked for the index with replace(path, ".bam" => ".bai"), which rewrote every .bam in the path. A BAM without a .bam extension (e.g. a Galaxy dataset_123.dat) was treated as its own index and failed with input is not a valid BAI file, and .bam in a directory name was rewritten too. The new find_bam_index() replaces only the final .bam extension, then tries <name>.bam.bai. A missing index is now reported during argument validation (exit code 1).
  • --log_level: now case-insensitive. CRITICAL, which the help listed but the validator never accepted, is removed from the help.
  • Help text: program name shown as fadu; --feature_type/--attribute_type descriptions fixed (GFF3 only; column 9 is an attribute); typo fix. Usage block in README and docs regenerated.
  • Version bumped to 1.10.1 (Project.toml, Manifest.toml, VERSION_NUMBER, README/docs, CHANGELOG).

Found while preparing the Galaxy wrapper (bgruening/galaxytools#2074). The wrapper itself isn't affected, since it symlinks inputs to input.bam/input.bam.bai.

Testing

  • Pkg.test(): 24/24 pass, including new testsets for the index lookup, extensionless BAMs, a missing index, and lowercase log levels.
  • test/run_test.sh: output still matches expected.counts.txt.

After merge

Tag v1.10.1 on master; bioconda's autobump should then open the recipe update.

🤖 Generated with Claude Code

- Only replace the final ".bam" extension when looking for <name>.bai,
  then fall back to <name>.bam.bai. Previously a BAM path without a
  ".bam" extension was used as its own index, and ".bam" in directory
  names was rewritten. A missing index is now reported during argument
  validation.
- Make --log_level case-insensitive and drop CRITICAL (never accepted)
  from the help text.
- Show "fadu" as the program name and fix the --feature_type and
  --attribute_type help text; regenerate the usage block in the docs.
- Add tests for the index lookup, extensionless BAMs, a missing index,
  and lowercase log levels.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adkinsrs
adkinsrs merged commit 718622f into master Oct 28, 2026
4 checks passed
@adkinsrs
adkinsrs deleted the fix-cli-edge-cases branch October 28, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant