bramble 🌿🫐

Usage

Input BAMs should be collated by read name (e.g. samtools collate) so that all alignments of a read are processed together.

Quick start

C++

# Genome-aligned, name-collated BAM + annotation -> transcriptome-coordinate BAM.
# The input BAM is positional; -G/--guide is the annotation, -o/--out the output.
bramble genome.bam -G annotation.gtf -o transcriptome.bam

# Long reads: enable long-read evaluation (--lr), and pass the genome FASTA
# (-S/--genome) to recover soft-clipped ends.
bramble genome.bam -G annotation.gtf -o transcriptome.bam \
   --lr -S genome.fa -p 16

Rust

# Genome-aligned, name-collated BAM + annotation -> transcriptome-coordinate BAM.
# The input BAM is positional; -G/--guide is the annotation, -o/--out the output.
bramble-rs genome.bam -G annotation.gtf -o transcriptome.bam

# Long reads: enable long-read evaluation (--lr), and pass the genome FASTA
# (-S/--genome) to recover soft-clipped ends.
bramble-rs genome.bam -G annotation.gtf -o transcriptome.bam \
    --lr -S genome.fa -p 16

Full option reference

bramble <in.bam> [-G <annotation.gtf>] [-o <out.bam>] [-p <UINT>] [-S <genome.fa>]
 [--help] [--version] [--quiet] [--fr] [--rf] [--lr] [--lr-hq] [--strict]
 [--max-soft-clip <UINT>] [--max-junction-insertion <UINT>] [--max-junction-deletion <UINT>]
 [--max-error-exon <UINT>] [--similarity-threshold <FLOAT>]
OptionDescription
--helpprint the usage message and exit
--versionprint just the version and exit
--quietturn off verbose mode (log bundle processing details)
--frassume stranded library (first-strand, read2 sense)
--rfassume stranded library (second-strand, read1 sense)
--lrpreset: alignments are from long reads
--lr-hqpreset: alignments are from high-quality long reads
--strictforce strict boundary adherence
--max-soft-clipmaximum added soft clip
--max-junction-insertionmaximum allowed insertion at any splice junction
--max-junction-deletionmaximum allowed deletion at any splice junction
--max-error-exonmaximum allowed size of an insertion or deletion of an entire exon, for sequencing technologies that produce long indels
--similarity-thresholdcandidate transcripts with similarity scores above this threshold are kept
-G, --guide <file>reference annotation for guiding alignment projection (GTF/GFF)
-S, --genome <file>genome sequence file for long-read clip rescue (FASTA format)
-o, --out <file>output path/file name for the projected alignments (default: stdout)
-p <int>number of threads (CPUs) to use (default: 1)

Rust library

bramble-rs is the Rust library at the core of bramble. This crate is I/O-free: it has no dependency on htslib / rust-htslib. You bring the alignments (from rust-htslib, noodles, minimap2-rs, etc.) as plain structs, and bramble returns projected alignments as plain structs. The companion bramble-cli crate wraps this library in a BAM-in/BAM-out command-line tool (the bramble-rs executable).

See the bramble-rs README for usage examples.