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 --helpThe 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.
Give every cell barcode in the CB tag its own read group:
bamby --tag CB --output 'grouped.bam' 'cells.bam'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'See the contributing guide for more information.