Skip to content

Fix 173 cram support#174

Merged
ravibandaru-lab merged 6 commits into
mainfrom
fix-173-cram-support
May 26, 2026
Merged

Fix 173 cram support#174
ravibandaru-lab merged 6 commits into
mainfrom
fix-173-cram-support

Conversation

@jamesli124
Copy link
Copy Markdown
Collaborator

@jamesli124 jamesli124 commented May 26, 2026

Fix for Issue #173 delfi claims CRAM support

Summary

  • Add CRAM support for delfi using existing reference_file argument, which now accepts FASTA file format.
  • Threads reference_file (FASTA) through all frag module functions
    (coverage, frag_length, frag_length_bins, frag_length_intervals,
    wps, multi_wps, cleavage_profile, multi_cleavage_profile) so CRAM
    files can be decoded correctly. Previously frag_generator was never passed
    the reference needed by htslib.
  • Adds --reference-file CLI flags to frag-length-bins,
    frag-length-intervals, wps, and cleavage-profile subcommands.
  • ReferenceWrapper now auto-creates a missing .fai index and recognises
    .fna/.fna.gz extensions, so FASTA files work out of the box for DELFI
    GC correction without manual indexing.
  • Corrects CLI help text for delfi, end-motifs, interval-end-motifs,
    breakpoint-motifs, and interval-breakpoint-motifs to reflect that FASTA
    is accepted alongside .2bit.
  • Adds tests/test_cram.py with equality tests (CRAM matches BAM) for
    single_coverage, frag_length_bins, wps, and delfi, plus smoke tests
    for all remaining functions. All tests skip automatically when samtools is
    not on PATH.

Notes

CRAM input requires a FASTA reference_file. .2bit cannot be used since
htslib requires FASTA for CRAM decoding.

    - waiting for PR #172 to clear before addressing DELFI
    - update docstrings and help texts to indicate 2bit and FASTA are accepted for reference file
    - remove erroneous docustrings claiming 2bit support for CRAM
Copy link
Copy Markdown
Collaborator

@ravibandaru-lab ravibandaru-lab left a comment

Choose a reason for hiding this comment

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

gr8!

@ravibandaru-lab ravibandaru-lab merged commit 60e649e into main May 26, 2026
8 checks passed
@jamesli124 jamesli124 deleted the fix-173-cram-support branch May 28, 2026 16:08
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.

Help for delfi claims CRAM support, but the subcommand does not actually support CRAM

2 participants