Skip to content

Converts a BAM file to reads and reconstructed references using the CIGAR and MD tag.

Notifications You must be signed in to change notification settings

pairwise-alignment/bam2seq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bam2Seq

https://img.shields.io/crates/v/bam2seq.svg https://img.shields.io/crates/d/bam2seq.svg

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.

Installation

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 .

Usage

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 to input.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
...

Links

  • This is quite similar to sam2pairwise but writes a simpler output format.
  • All the work in the implementation is done by the BAM crate.

About

Converts a BAM file to reads and reconstructed references using the CIGAR and MD tag.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages