gbcms¶
Get Base Counts Multi-Sample — High-performance variant counting from BAM files
What It Does¶
GBCMS extracts allele counts and variant metrics at specified positions in BAM files:
flowchart LR
subgraph Input
VCF[VCF/MAF]
BAM[BAM Files]
end
subgraph Output
Counts[Allele Counts]
Metrics[VAF, Strand Bias]
end
VCF --> Engine[gbcms]
BAM --> Engine
Engine --> Counts
Engine --> Metrics
Use mouse to pan and zoom
Visual Overview¶
Detailed Overview (PDF)¶
Key Metrics¶
| Metric | Formula | Description |
|---|---|---|
| VAF | AD / (RD + AD) |
Variant Allele Frequency |
| Strand Bias | Fisher's exact test | Detect sequencing artifacts |
| Fragment Counts | Deduplicated pairs | PCR-aware counting |
Quick Start¶
# Install
pip install gbcms
# Run
gbcms run --variants variants.vcf --bam sample.bam --fasta ref.fa --output-dir results/
→ Full Installation Guide | → CLI Examples
Choose Your Workflow¶
flowchart TD
Start[How many samples?] --> Few{1-10 samples}
Start --> Many{10+ samples}
Few --> CLI([Use CLI]):::cli
Many --> HPC{HPC cluster?}
HPC --> |Yes| Nextflow([Use Nextflow]):::nf
HPC --> |No| CLI
classDef cli fill:#4caf50,color:white,stroke:#388e3c,stroke-width:2px;
classDef nf fill:#2196f3,color:white,stroke:#1565c0,stroke-width:2px;
Use mouse to pan and zoom
| Workflow | Best For | Guide |
|---|---|---|
| CLI | 1-10 samples, local/single server | Quick Start |
| Nextflow | 10+ samples, HPC/SLURM | Nextflow Guide |
Architecture¶
Python/Rust hybrid for maximum performance:
flowchart TB
subgraph Python [🐍 Python]
CLI[CLI] --> Pipeline[Orchestration]
Pipeline --> IO[VCF/MAF I/O]
end
subgraph Rust [🦀 Rust]
Counter[BAM Counting]
Stats[Fisher Test]
end
Pipeline --> Counter
Counter --> Stats
classDef pythonStyle fill:#3776ab,color:#fff,stroke:#2c5f8a,stroke-width:2px;
classDef rustStyle fill:#dea584,color:#000,stroke:#c48a6a,stroke-width:2px;
class Python pythonStyle;
class Rust rustStyle;
Use mouse to pan and zoom
→ Technical Details | → How It Works
Documentation¶
| Section | Description |
|---|---|
| Getting Started | Installation and first run |
| CLI Reference | Command-line usage |
| Nextflow Pipeline | HPC workflow |
| How It Works | Architecture, algorithms, and formats |
| Development | Contributing guide |
abbreviations