Skip to content

Add rammap as a supported read mapping program#297

Merged
wwood merged 4 commits into
mainfrom
claude/rammap-mapper-integration-2k6yvi
Jul 6, 2026
Merged

Add rammap as a supported read mapping program#297
wwood merged 4 commits into
mainfrom
claude/rammap-mapper-integration-2k6yvi

Conversation

@wwood

@wwood wwood commented Jul 2, 2026

Copy link
Copy Markdown
Owner

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

  • Added rammap to the mapping software list in CLI configuration with appropriate help text describing it as "a minimap2-compatible aligner" with the -x sr preset
  • Implemented rammap command building with the command template rammap -x sr -a (short-read preset with SAM output)
  • Added --rammap-params CLI option to allow users to specify additional parameters, with the same security warnings as other mapping tools
  • Integrated rammap into the mapping program enum (MappingProgram::RAMMAP) and updated all relevant match statements across the codebase
  • Added rammap version checking (requires v1.1.1+) via check_for_rammap() function
  • Updated mapping index handling to skip pre-indexing for rammap (not yet supported) with appropriate logging
  • Added test case (test_make_rammap) to verify rammap mapping functionality works end-to-end
  • Updated documentation in README.md and pixi.toml to include rammap as a dependency

Implementation Details

  • Rammap is treated similarly to minimap2 in terms of read format handling (auto-detects interleaved input based on read names)
  • Like strobealign, rammap does not require separate log file handling for minimap2 compatibility
  • The implementation follows the existing pattern for adding new mapping programs, ensuring consistency with the codebase architecture
  • Rammap requires the reference to be specified (consistent with other mappers)

https://claude.ai/code/session_01D4S2TfmfT9BsYgJF5VDz81

claude added 2 commits July 2, 2026 09:52
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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread pixi.toml
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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread tests/test_cmdline.rs
}

#[test]
fn test_make_rammap() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread src/bam_generator.rs
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(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

claude added 2 commits July 2, 2026 10:05
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
@wwood wwood merged commit 5222aba into main Jul 6, 2026
8 checks passed
@wwood wwood deleted the claude/rammap-mapper-integration-2k6yvi branch July 6, 2026 01:46
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.

2 participants