This tool takes a BAM file containing CIGAR strings, reads, and MD
tags,
and outputs a .seq
file containing pairs of reads and reconstructed references.
Install directly with cargo from crates.io:
cargo install bam2seq
Simply clone the repository, and optionally install the binary.
git clone https://github.com/ragnargrootkoerkamp/bam2seq.git cd bam2seq cargo install --path .
cargo run --release -- <input.bam> [<output.seq>] [--no-clip] [--min-len <len>]
input.bam
- The input BAM file.
output.seq
- The output
.seq
file. Defaults toinput.seq
. --no-clip
- Disable trimming of soft clipped regions from the read.
--min-len <len>
- Only output (clipped) reads of at least this length.
This outputs a .seq
file, which looks like this:
>ACTGATGA <ACAGATG >read 2 <reference 2 ...
- This is quite similar to sam2pairwise but writes a simpler output format.
- All the work in the implementation is done by the BAM crate.