Skip to content
clintvalPublic

About

Group BAM records into read groups by the value of a tag.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

14 Commits

Folders and files

Repository files navigation

Banner for bamby


Install with bioconda Anaconda Version Build Status Coverage Status License: MIT Language

Group BAM records into read groups by the value of a tag.

Install with mamba, conda, or run directly with pixi:

pixi exec \
    --channel conda-forge \
    --channel bioconda \
    bamby --help

Introduction

The tool bamby gives every distinct value of a SAM tag its own read group, so any tool that works per read group or per sample sees one sample per value. Group single-cell reads by cell barcode, pooled reads by sample barcode, or consensus reads by molecule, all in one BAM instead of one file per value.

Quick Start

Give every cell barcode in the CB tag its own read group:

bamby --tag CB --output 'grouped.bam' 'cells.bam'

Per-Cell Variant Calling Example

Call every cell at once, with no per-cell BAMs to split and merge:

bamby \
    --tag CB \
    --untagged drop \
    --compression-level 0 \
    'cells.bam' \
| samtools sort --output-fmt BAM,level=0 - \
| bcftools mpileup \
    --fasta-ref 'ref.fa' \
    --annotate AD,DP \
    --max-depth 1000000 \
    --per-sample-mF \
    - \
| bcftools call \
    --multiallelic-caller \
    --variants-only \
    --group-samples - \
    --output-type z \
    --output 'cells.vcf.gz'

Development and Testing

See the contributing guide for more information.

About

Group BAM records into read groups by the value of a tag.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages