Skip to content

Migrate from BioExt/bealign to cawlign for sequence alignment#116

Merged
stevenweaver merged 1 commit intomasterfrom
cawlign-migration
Oct 14, 2025
Merged

Migrate from BioExt/bealign to cawlign for sequence alignment#116
stevenweaver merged 1 commit intomasterfrom
cawlign-migration

Conversation

@stevenweaver
Copy link
Member

Summary

This PR migrates the HIV-TRACE alignment workflow from BioExt/bealign to cawlign, simplifying the alignment process and removing the BioExt dependency.

Changes Made

  • Replaced alignment workflow: Single cawlign call instead of two-step bealign + bam2msa process
  • Removed BAM intermediate: cawlign outputs FASTA directly, eliminating the need for BAM file conversion
  • Added CLI arguments:
    • --cawlign: Path to cawlign executable (defaults to 'cawlign' in PATH)
    • --score-matrix: Score matrix for alignment (defaults to 'HIV_BETWEEN_F')
  • Added validation: validate_cawlign() function warns if cawlign is not found
  • Updated dependencies: Removed bioext >= 0.21.8 from install_requires
  • Simplified phase tracking: Removed BAM_FASTA_CONVERSION phase, renumbered remaining phases

Technical Details

The cawlign command uses:

  • -s SCORE_MATRIX: Alignment scoring matrix
  • -t codon: Codon-aware alignment mode (required for HIV_BETWEEN_F)
  • -I: Include reference sequence in output (equivalent to bealign's -K)
  • -r reference: Specify reference sequence file

Testing

All 14 existing tests pass with the new implementation:

  • ✅ Alignment tests with custom references
  • ✅ Env gene alignment tests
  • ✅ Contaminant screening tests
  • ✅ DRAM stripping tests
  • ✅ Pre-made alignment tests

Dependencies

  • Required: cawlign v1.0.3+
  • Removed: BioExt (no longer needed)

Breaking Changes

None. The changes are backward compatible - existing functionality is preserved with the new alignment tool.

Replace the two-step bealign+bam2msa alignment workflow with a single
cawlign call. This migration simplifies the alignment process and removes
the BioExt dependency.

Key changes:
- Replace bealign and bam2msa with cawlign for sequence alignment
- Remove BAM intermediate file format, cawlign outputs FASTA directly
- Add optional --cawlign CLI argument (defaults to 'cawlign' in PATH)
- Add optional --score-matrix CLI argument (defaults to 'HIV_BETWEEN_F')
- Add validate_cawlign() function to warn if cawlign is not found
- Remove BioExt from install_requires in setup.py
- Update phase numbering after removing BAM_FASTA_CONVERSION phase
- Document cawlign v1.0.3+ as required non-PyPI dependency

The cawlign command uses:
- '-s SCORE_MATRIX' for alignment scoring
- '-t codon' for codon-aware alignment (required for HIV_BETWEEN_F)
- '-I' flag to include reference sequence in output
- '-r reference' to specify reference sequence

All existing tests pass with the new implementation.
@stevenweaver stevenweaver merged commit 2b3dc79 into master Oct 14, 2025
4 of 5 checks passed
@stevenweaver stevenweaver deleted the cawlign-migration branch October 14, 2025 23:04
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