How brentp/bwa-meth works
This project is a command-line tool designed specifically for aligning bisulfite sequencing (BS-Seq) reads. Its purpose is to wrap and streamline the operation of existing aligners (BWA-MEM or BWA-MEM2) by converting reads in silico (changing C→T) and then “piping” them to the underlying aligner. The provided directory structure and README indicate that, in addition to the core alignment functionality (bwameth.py), the repository contains additional directories for benchmarking (compare), usage examples (example), visualization and documentation (paper), and auxiliary scripts (scripts).
Main Components
• Core Alignment Module: Represented by the bwameth.py script which serves as the primary entry point for running the alignment.
• In-Silico Conversion Process: The module/process where C’s are converted to T’s in both reference and reads before alignment.
• External Alignment Engines: BWA-MEM and BWA-MEM2 are the engines that perform the actual sequence alignment.
• Data Input/Output: FASTQ files for sequencing reads as input, reference FASTA for the genome, and SAM/BAM output files.
• Dependency and Environment: External tools such as samtools (for SAM/BAM conversion), python dependencies (toolshed), and shell scripts.
• Supporting Scripts & Benchmarks: The compare directory contains benchmarking scripts and data to compare performance with other aligners. The example directory provides sample datasets and minimal usage examples.
• Documentation & Publication: The paper directory contains LaTeX files and figures for academic publication, indicating broader documentation and evaluation.
Relationships and Interactions
• A Documentation component (paper directory) which, while not directly part of the runtime, plays an important role in communicating the design and results.
Important Architectural Patterns or Design Principles
• Streaming Data Pipeline: Emphasize that the conversion output is piped directly to the external aligner without intermediate file writes.
• Modularity: The project is segregated into clearly defined directories (core tool, example usage, benchmarking, publication) to maintain separation of concerns.
• Extensibility: The use of shell scripts in the compare folder and additional scripts (in scripts/) for post-alignment processing (like methylation tabulation) shows an extensible and modular design.
Emphasizing Detail
• Examples or callouts from subdirectories (e.g., use a note that “compare” contains benchmarking scripts that test different alignment parameters).