Add rammap as a supported read mapping program#297
Conversation
rammap (https://github.com/jwanglab/rammap) is a pure-Rust, minimap2-compatible read mapper available on Bioconda. Wire it in as a new `--mapper rammap` choice alongside the existing mappers. - Add MappingProgram::RAMMAP and handle it in every mapping-program match (command construction, index maintenance, parameter selection). - Map short reads with `rammap -x sr -a`, matching CoverM's default short-read use case, and expose `--rammap-params` for extra options. - Add check_for_rammap dependency/version check. - Register rammap in the CLI mapper list, help table, README dependency list, and pixi test environment; add a `make` smoke test. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D4S2TfmfT9BsYgJF5VDz81
rammap, like bwa-mem2 and strobealign, is only installed on linux-64 (it is not available for osx via bioconda). The macOS CI jobs already skip the bwa_mem2 and strobealign tests for this reason; add rammap to that skip list so test_make_rammap does not fail for a missing executable. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D4S2TfmfT9BsYgJF5VDz81
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b6170576b1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| bwa-mem2 = "*" | ||
| dashing = ">=0.4.0,<1.0" # dashing 1.0 build gives illegal instruction errors | ||
| strobealign = ">=0.14.0" # tests generate the strobealign index at runtime | ||
| rammap = ">=1.1.1" |
There was a problem hiding this comment.
Commit rammap into the frozen Pixi lockfile
Line 31 adds the new dependency, but pixi.lock still has no rammap entry (rg rammap pixi.lock). The locked Linux workflow runs pixi run --frozen cargo test in .github/workflows/test-coverm.yml line 28, and Pixi documents --frozen as installing from the lockfile without updating it, so the new test_make_rammap runs in an environment without the binary and check_for_rammap fails. Please regenerate and commit pixi.lock with rammap included.
Useful? React with 👍 / 👎.
| } | ||
|
|
||
| #[test] | ||
| fn test_make_rammap() { |
There was a problem hiding this comment.
Skip the rammap test where rammap is unavailable
This test is unconditional, but the macOS workflows still run cargo test -- --skip bwa_mem2 --skip strobealign in .github/workflows/test-coverm.yml lines 87 and 120, while rammap was added only under [target.linux-64.dependencies]. In those jobs, selecting --mapper rammap reaches parse_mapping_program and check_for_rammap, so the test fails before mapping because the binary is absent. Please either add a macOS rammap dependency or skip/gate this test on platforms without rammap.
Useful? React with 👍 / 👎.
| MappingProgram::STROBEALIGN => "strobealign".to_string(), | ||
| // rammap is a minimap2-compatible aligner; map short reads with | ||
| // the 'sr' preset and emit SAM with -a. | ||
| MappingProgram::RAMMAP => "rammap -x sr -a".to_string(), |
There was a problem hiding this comment.
Disable rammap fragment mode for single-end reads
When CoverM users choose --single with --mapper rammap, this command still forces -x sr; in the upstream rammap CLI source, the sr preset sets FRAG_MODE, and the CLI derives pe_mode = two_file_pe || frag_mode, then reads the second mate from the same iterator when only one query file is supplied. That makes a single-end FASTQ get consumed as interleaved pairs, with an odd final read dropped, instead of being mapped as single-end reads. Please add --frag no/--pairing no for ReadFormat::Single or otherwise vary the rammap options by read format.
Useful? React with 👍 / 👎.
rammap's `sr` preset enables fragment mode, which pulls read pairs from a single input file (this is how rammap maps interleaved reads). For genuinely single-end input (`--single`) that would incorrectly consume the file as interleaved pairs and drop an odd trailing read. Pass `--frag no` for ReadFormat::Single so single-end reads are mapped individually, while coupled and interleaved input keep the default fragment-mode behaviour. Add a single-end rammap smoke test covering this path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D4S2TfmfT9BsYgJF5VDz81
Commit the rammap linux-64 conda package (1.1.1, build hfa8f182_0) into the frozen lockfile so `pixi run --frozen` installs it in the locked CI job, matching how strobealign and bwa-mem2 are pinned. Package hash and metadata taken from the bioconda repodata and verified against the downloaded artifact (sha256 4e03e5..., 885279 bytes). Its only non-system dependency, libgcc >=14, is already satisfied by libgcc 15.1.0 in the lock. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D4S2TfmfT9BsYgJF5VDz81
Summary
This PR adds support for rammap, a minimap2-compatible read aligner, as a mapping option in CoverM alongside existing mappers like bwa-mem, minimap2, and strobealign.
Key Changes
-x srpresetrammap -x sr -a(short-read preset with SAM output)--rammap-paramsCLI option to allow users to specify additional parameters, with the same security warnings as other mapping toolsMappingProgram::RAMMAP) and updated all relevant match statements across the codebasecheck_for_rammap()functiontest_make_rammap) to verify rammap mapping functionality works end-to-endImplementation Details
https://claude.ai/code/session_01D4S2TfmfT9BsYgJF5VDz81