# Architecture
Source: https://docs.theminos.ai/architecture
How the Minos subnet operates — miners, validators, and the scoring loop
## Subnet Overview
Minos (SN107) is a **merit-based competition** for genomic variant calling on the Bittensor network. The system has two roles:
Share their hyperparameter configuration for running variant-calling tools (GATK, DeepVariant, FreeBayes, or BCFtools). Compete on **call accuracy**.
Distribute tasks, benchmark results against truth sets, and assign **scores that determine ALPHA rewards**.
***
## The Scoring Loop
A validator selects a genomic region with a known truth set. It sends the miner aligned reads (BAM) and a reference genome for that region.
The miner runs their chosen variant caller with their tuned hyperparameters. The output they share with the validator is their **hyperparameter config**.
The validator uses the miner's config to generate a VCF, then compares it against the truth set using standard metrics:
* **Precision** — what fraction of called variants are real
* **Recall** — what fraction of real variants were found
* **F1-score** — harmonic mean of precision and recall
Miners are ranked by accuracy. Higher accuracy earns more ALPHA. The system is **purely meritocratic** — only call quality matters.
***
## Why Hyperparameters Matter
Every variant caller has dozens of tunable parameters that control sensitivity, specificity, and how the algorithm processes data. The default settings are general-purpose — **they are not optimized for any specific benchmark.**
Miners who understand and tune these parameters gain a competitive edge:
| Lever | Effect |
| -------------------------------- | -------------------------------------------------------------- |
| Lower quality thresholds | More sensitive — finds more variants but risks false positives |
| Higher confidence thresholds | More precise — fewer false calls but may miss real variants |
| Adjusted priors | Control the model's assumptions about variant frequency |
| Variant-type-specific parameters | Tune sensitivity per variant class |
| Contamination / PCR models | Model potential data artifacts |
The [Miner Guides](/guides/gatk) document every parameter for each supported tool.
***
## Supported Tools at a Glance
| Tool | Approach | Docker Image |
| --------------- | ---------------------------------------------------- | ------------------------------------- |
| **GATK** | Local de novo assembly + Pair-HMM genotyping | `broadinstitute/gatk:4.5.0.0` |
| **DeepVariant** | CNN image classification on pileup tensors | `google/deepvariant:1.5.0` |
| **FreeBayes** | Bayesian haplotype evaluation with toggleable priors | `staphb/freebayes:1.3.7` |
| **BCFtools** | Pileup-based genotype likelihoods + Bayesian caller | `quay.io/biocontainers/bcftools:1.20` |
# BCFtools
Source: https://docs.theminos.ai/guides/bcftools
Guide to mining with BCFtools mpileup/call on Minos
**Docker Image:** `quay.io/biocontainers/bcftools:1.20` + `samtools:1.20`
BCFtools is the variant calling component of the SAMtools/HTSlib ecosystem, maintained by the Wellcome Sanger Institute. It uses a classic **pileup-based approach**: for each genomic position, it stacks up all the reads, computes genotype likelihoods from the base and mapping qualities, then applies a Bayesian caller to determine genotypes.
BCFtools is fast, lightweight, and well-suited for straightforward variant calling. Its two-stage pipeline (mpileup → call) gives miners independent control over the data preparation (mpileup) and genotyping (call) stages.
| | |
| -------------- | --------------------------------------------------- |
| **Approach** | Pileup-based genotype likelihoods + Bayesian caller |
| **Strengths** | Speed, low memory, independent pipeline control |
| **Parameters** | 22 across 7 categories |
| **Compute** | Low |
## How It Works
The pipeline runs three stages:
### 1. bcftools mpileup
Reads the BAM file and constructs a pileup at each genomic position. For each position, it computes:
* **Base Alignment Quality (BAQ)**: Probabilistic realignment that adjusts base qualities near indels to reduce false SNP calls caused by misalignment
* **Genotype likelihoods**: Based on base qualities, mapping qualities, and an indel error model
* **Indel candidates**: Using a gap-aware model with configurable open/extension penalties
The mpileup stage outputs genotype likelihoods in BCF format.
### 2. bcftools call
Takes genotype likelihoods from mpileup and applies a caller model:
* **Multiallelic caller (`-m`)**: Uses a constrained likelihood framework that considers all alleles simultaneously. Controlled by the `prior` parameter (mutation rate). The BCFtools documentation recommends this as the standard caller.
* **Consensus caller (`-c`)**: Uses a simple consensus approach controlled by `pval_threshold`.
### 3. bcftools norm
Normalizes variants: left-aligns indels, splits multi-allelic sites, and ensures VCF consistency.
## Hyperparameters
### Base/Mapping Quality (mpileup)
| Parameter | Flag | Range | Default | Description |
| ----------- | ------------ | ----- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `min_MQ` | `-q` | 0-60 | 0 | Minimum mapping quality for a read to be included. The default of 0 includes **all reads**, even those mapping to multiple locations. **Higher values** filter ambiguously mapped reads. |
| `min_BQ` | `-Q` | 0-50 | 13 | Minimum base quality for a base to be considered. The default of 13 corresponds to roughly a 5% error rate. **Higher values** increase precision. **Lower values** increase sensitivity at the cost of more noise. |
| `max_BQ` | `--max-BQ` | 1-90 | 60 | Cap base qualities at this maximum value. Prevents overly optimistic quality scores from dominating the likelihood calculation. Useful when instrument base quality calibration is poor. |
| `delta_BQ` | `--delta-BQ` | 0-99 | 30 | Smoothing parameter: if a base's quality exceeds its neighbor's quality + delta\_BQ, it's reduced. Prevents isolated high-quality bases from having outsized influence. **Lower values** apply more aggressive smoothing. **99 effectively disables** this filter. |
| `adjust_MQ` | `-C` | 0-100 | 50 | Coefficient for downward-adjusting mapping quality. Reduces the effective mapping quality, making the caller slightly more conservative. **0 disables** the adjustment. If your BAMs are BWA-aligned, 50 is appropriate. |
### Depth Limits (mpileup)
| Parameter | Flag | Range | Default | Description |
| ------------ | ---- | ------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `max_depth` | `-d` | 0-10000 | 250 | Maximum read depth per file. Positions exceeding this depth are downsampled randomly. |
| `max_idepth` | `-L` | 1-10000 | 250 | Maximum depth for **indel calling** specifically. If depth exceeds this, indel calling is skipped at that position. Must be proportional to expected coverage. |
### BAQ — Base Alignment Quality (mpileup)
BAQ is a probabilistic realignment technique that adjusts base qualities near indels. It's one of BCFtools' key innovations for reducing false SNPs caused by indel-related misalignment.
| Parameter | Flag | Values | Default | Description |
| ---------- | ---- | ---------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `no_BAQ` | `-B` | true/false | false | **Disable BAQ entirely**. BAQ reduces false positive SNPs near indels but can also suppress real SNPs near real indels. |
| `full_BAQ` | `-D` | true/false | false | Apply BAQ on **all reads**, not just those in problematic regions. The default uses heuristics to decide when BAQ is needed. **Enabling** gives more thorough quality adjustment at the cost of some compute time. |
| `redo_BAQ` | `-E` | true/false | false | Recalculate BAQ from scratch, ignoring any existing BQ tags in the BAM. **Enable** if the BAM was processed by a pipeline that pre-computed BQ tags with different settings. |
### Indel Calling (mpileup)
These parameters control the indel error model in mpileup and directly affect indel calling behavior.
| Parameter | Flag | Range | Default | Description |
| -------------- | ---------------- | ------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `open_prob` | `-o` | 1-60 | 40 | **Phred-scaled gap open probability**. The value represents how unlikely the caller believes a gap opening (start of an indel) is due to sequencing error. **Lower values** mean the caller believes gap opens are more likely real (not errors), so it calls more indels. **Higher values** are more conservative. |
| `ext_prob` | `-e` | 1-60 | 20 | **Phred-scaled gap extension probability**. Controls how unlikely extending an existing gap is. **Lower values** make the caller more willing to call longer indels. **Higher values** penalize longer gaps. |
| `gap_frac` | `-F` | 0.0-1.0 | 0.002 | Minimum fraction of reads that must be gapped at a position for an indel candidate to be generated. **Lower values** increase indel sensitivity. **Higher values** reduce false positive indels. |
| `tandem_qual` | `-h` | 0-1000 | 500 | Coefficient for homopolymer error modeling. Given an l-long homopolymer run, the sequencing error of an indel of size s is modeled as `tandem_qual * s / l`. **Higher values** tell the caller that indels in homopolymers are more likely real (more calls). **Lower values** are more skeptical of homopolymer indels. The change from 100 (BCFtools 1.12) to 500 (1.20) significantly increased indel sensitivity. |
| `indel_bias` | `--indel-bias` | 0.1-5.0 | 1.0 | Global scaling factor for indel scores. Values below 1.0 reduce indel calling (favor precision). Values above 1.0 increase indel calling (favor recall). |
| `del_bias` | `--del-bias` | 0.1-2.0 | 1.0 | Relative likelihood bias between deletions and insertions. Values below 1.0 make the caller believe deletions are less likely to be real (more likely artifacts). Values above 1.0 favor deletions. The default of 1.0 treats them equally. PacBio CCS profiles use 0.4 because PacBio reads have systematic deletion artifacts. For Illumina data, 1.0 is typical. |
| `min_ireads` | `--min-ireads` | 1-100 | 1 | Minimum number of gapped reads to generate an indel candidate. **Higher values** require more evidence before considering an indel, reducing false positives. |
| `score_vs_ref` | `--score-vs-ref` | 0.0-1.0 | 0.0 | Controls whether indel quality is scored against the reference allele (1.0) or the next-best alternative (0.0). Values between 0 and 1 interpolate. **Higher values** make indel calling more stringent (must clearly beat the reference). PacBio CCS profiles use 0.7. |
### Read Filtering (mpileup)
| Parameter | Flag | Values | Default | Description |
| --------------- | ---- | ---------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `count_orphans` | `-A` | true/false | false | Include **anomalous read pairs** — reads that are paired but not "properly paired" (unexpected insert size or orientation). By default, these are discarded. **Enabling** adds more data but may introduce mapping artifacts. |
### Caller Mode (call)
| Parameter | Flag | Values | Default | Description |
| --------------------- | ---- | ---------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `multiallelic_caller` | `-m` | true/false | true | Use the **multiallelic caller**. When disabled, falls back to the consensus caller (`-c`). The multiallelic caller simultaneously evaluates all possible alleles at a site. |
| `variants_only` | `-v` | true/false | true | Only output variant sites. When disabled, all sites (including reference) are output. |
### Genotyping (call)
| Parameter | Flag | Range | Default | Description |
| ---------------- | ---------- | ------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `ploidy` | `--ploidy` | GRCh37 / GRCh38 / X / Y / 1 / 2 | GRCh38 | Predefined ploidy model. `GRCh38` applies diploid calling with appropriate sex chromosome handling. |
| `prior` | `-P` | 0.0-1.0 | 0.0011 | **Expected substitution (mutation) rate**. Only used with the multiallelic caller (`-m`). This is the Bayesian prior probability of observing a variant at any given position. **Higher values** increase sensitivity — the caller expects more variants. **Lower values** increase specificity. |
| `pval_threshold` | `-p` | 0.0-1.0 | 0.5 | P-value threshold for the **consensus caller (`-c`) only**. This parameter has no effect when using the multiallelic caller (`-m`). |
The `pval_threshold` parameter only applies when using the consensus caller (`-c`). It has **no effect** when using the multiallelic caller (`-m`), which is the default and recommended mode.
# DeepVariant
Source: https://docs.theminos.ai/guides/deepvariant
Guide to mining with Google DeepVariant on Minos
**Docker Image:** `google/deepvariant:1.5.0`
DeepVariant is Google's deep learning-based variant caller. Instead of using probabilistic models like GATK or FreeBayes, it treats variant calling as an **image classification problem**. It converts read pileups into images and uses a convolutional neural network (CNN) — specifically an Inception v3 architecture — to classify each candidate site as homozygous reference, heterozygous variant, or homozygous variant.
| | |
| -------------- | --------------------------------------------- |
| **Approach** | CNN image classification on pileup tensors |
| **Strengths** | SNPs, platform-aware accuracy, simpler tuning |
| **Parameters** | 15 across 6 categories |
| **Compute** | High — GPU optional but recommended |
## How It Works
DeepVariant operates in three stages:
### 1. make\_examples
Scans the BAM file and identifies candidate variant sites. For each candidate, it constructs a **pileup image** — a multi-channel tensor encoding read alignments, base qualities, mapping qualities, strand information, and other signals. This is where most quality-affecting parameters live (candidate thresholds, read quality filters, read processing options).
### 2. call\_variants
Feeds each pileup image through the pre-trained CNN model. The model outputs probabilities for three genotype classes: 0/0 (hom-ref), 0/1 (het), and 1/1 (hom-alt). The model was trained on truth sets and is specific to the sequencing platform (WGS, WES, PacBio, etc.).
### 3. postprocess\_variants
Converts model predictions to a VCF file. Applies quality filters (QUAL thresholds), handles multi-allelic sites, and computes genotype quality (GQ) scores.
Unlike GATK/FreeBayes where hyperparameters control the statistical model, DeepVariant parameters affect **what data the CNN sees** and **how outputs are filtered**. You cannot change the model itself — but you can significantly affect accuracy by controlling inputs and output filtering.
## Hyperparameters
### Model Selection (Top-level)
| Parameter | Values | Default | Description |
| ------------ | --------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `model_type` | WGS / WES / PACBIO / HYBRID\_PACBIO\_ILLUMINA | WGS | Selects the pre-trained model. Each model is trained on data from a specific sequencing platform. Using the wrong model for your data type will significantly degrade accuracy. |
### Candidate Variant Thresholds (make\_examples)
These control which genomic positions become candidates for the CNN to evaluate. Lowering thresholds = more candidates = higher sensitivity but more computation and potentially more false positives (though the CNN is the final arbiter).
| Parameter | Range | Default | Description |
| ------------------------- | ------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `vsc_min_fraction_snps` | 0.0-1.0 | 0.12 | Minimum fraction of reads supporting an alternate allele to consider a site as a SNP candidate. **Lower values** generate more candidates, increasing sensitivity for low-VAF variants. **Higher values** reduce candidates, potentially missing real het variants with skewed allele balance. |
| `vsc_min_fraction_indels` | 0.0-1.0 | 0.12 | Same as above but for indel candidates. Indels often have lower allele fractions due to alignment artifacts. |
| `vsc_min_count_snps` | 0-50 | 2 | Minimum absolute number of reads supporting an alternate allele for SNP candidates. Works alongside `vsc_min_fraction_snps` — both must be satisfied. |
| `vsc_min_count_indels` | 0-50 | 2 | Same as above but for indels. |
### Read Quality Filters (make\_examples)
| Parameter | Range | Default | Description |
| --------------------- | ----- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `min_mapping_quality` | 0-60 | 5 | Minimum mapping quality to include a read. Reads with mapQ below this are excluded from pileup images. **Higher values** ensure confidently mapped reads, reducing noise in the pileup image. **Lower values** include more reads. The default of 5 is very permissive — the CNN can typically handle some ambiguously mapped reads. |
| `min_base_quality` | 0-50 | 10 | Minimum base quality for counting alternate allele support. Bases below this quality are not counted toward the `vsc_min_count` and `vsc_min_fraction` thresholds (but may still appear in the pileup image). **Higher values** raise the bar for candidate generation. |
### Read Processing (make\_examples)
| Parameter | Values | Default | Description |
| ------------------------- | ---------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `realign_reads` | true/false | true | Perform local realignment of reads before constructing pileup images. Realignment corrects misalignments around indels, improving the pileup image quality. **Disabling** saves compute time but may reduce accuracy, especially for indels. Reads longer than 500bp are never realigned regardless. |
| `normalize_reads` | true/false | false | Left-align indels in each read within the allele counter. Can improve consistency of indel representation across reads. |
| `keep_duplicates` | true/false | false | Include reads marked as PCR duplicates. By default, duplicates are excluded. **Enabling** increases read depth (more data for the CNN) but introduces PCR bias. |
| `max_reads_per_partition` | 100-5000 | 1500 | Maximum number of reads per genomic partition. At high-coverage sites, reads are downsampled to this count. The DP and AD values in the output VCF are capped by this value. |
### Haplotype-Aware Calling (make\_examples)
| Parameter | Values | Default | Description |
| -------------------- | ---------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `sort_by_haplotypes` | true/false | false | Sort reads by haplotype (HP tag) in the pileup image. When enabled, reads from the same haplotype are grouped together, making it easier for the CNN to see variant phasing patterns. **Requires** either a pre-phased BAM or `phase_reads=true`. |
| `phase_reads` | true/false | false | Compute read phases on-the-fly and assign HP tags. Enables haplotype-aware calling without requiring pre-phased input. The DeepVariant 1.5.0 WGS model was trained with phasing enabled. This adds compute time. |
### Post-Processing (postprocess\_variants)
| Parameter | Range | Default | Description |
| --------------------------- | ---------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `qual_filter` | 0.0-50.0 | 1.0 | QUAL score threshold below which variants are marked as FILTERED (not PASS) in the output VCF. **Higher values** filter out more low-confidence calls, potentially improving precision. **Lower values** keep more calls, improving recall. |
| `multi_allelic_qual_filter` | 0.0-50.0 | 1.0 | Separate QUAL filter threshold for multi-allelic sites. These sites are inherently harder to call correctly. |
| `cnn_homref_call_min_gq` | 0.0-50.0 | 20.0 | Minimum genotype quality for homozygous-reference calls from the CNN. Calls with GQ below this are given an uncertain `./.` genotype. Affects reference confidence, not variant calls directly. |
| `use_multiallelic_model` | true/false | false | Use a specialized model for resolving multi-allelic genotypes (sites with 2+ alternate alleles). **Enabling** may improve accuracy at complex multi-allelic sites. |
# FreeBayes
Source: https://docs.theminos.ai/guides/freebayes
Guide to mining with FreeBayes on Minos
**Docker Image:** `staphb/freebayes:1.3.7`
FreeBayes is a Bayesian haplotype-based variant caller developed by Erik Garrison. FreeBayes uses a **direct haplotype evaluation** method — it considers all possible alleles at a locus simultaneously and computes Bayesian posterior probabilities for each genotype. It was designed to be fast, simple, and capable of calling SNPs, indels, MNPs (multi-nucleotide polymorphisms), and complex events in a single pass.
FreeBayes is notable for its rich set of Bayesian priors (population genetics, Hardy-Weinberg, allele balance) that can be individually toggled. This makes it the tool with the most "knobs" for controlling the statistical model.
| | |
| -------------- | ---------------------------------------------------- |
| **Approach** | Bayesian haplotype evaluation with toggleable priors |
| **Strengths** | Fine-grained prior control, MNPs, complex events |
| **Parameters** | 22 across 9 categories |
| **Compute** | Medium |
## How It Works
### 1. Candidate Identification
FreeBayes scans the BAM file in the target region and identifies positions where reads differ from the reference. It applies coverage and allele fraction filters to determine which sites are worth evaluating.
### 2. Haplotype Construction
At each candidate site, FreeBayes considers all observed alleles and constructs candidate haplotypes within a configurable window (`max_complex_gap`). Unlike GATK, it does not perform full local assembly — instead, it directly evaluates the alleles observed in reads.
### 3. Bayesian Genotyping
For each candidate site, FreeBayes calculates:
* **Data likelihood**: Probability of observing the reads given each possible genotype, using base quality and mapping quality
* **Prior probability**: Based on the Ewens Sampling Formula (controlled by `theta`), Hardy-Weinberg Equilibrium, allele balance expectations, and binomial observation model
* **Posterior probability**: Combined likelihood × prior, used to call the genotype
### 4. Output
Sites passing the posterior probability threshold (`pvar`) and quality filters are emitted as variant calls.
## Hyperparameters
### Quality Filtering
| Parameter | Range | Default | Description |
| --------------------- | ----- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `min_mapping_quality` | 0-60 | 1 | Minimum mapping quality for a read to be used. The default of 1 is permissive — it keeps almost everything except reads that map equally well everywhere (mapQ=0). **Higher values** filter ambiguously mapped reads and can reduce false positives in repetitive regions. |
| `min_base_quality` | 0-50 | 1 | Minimum base quality for an allele observation. The default of 1 is extremely permissive. **Higher values** filter low-quality bases that contribute noise. |
| `base_quality_cap` | 0-60 | 0 | Cap all base qualities at this value. 0 means disabled (no cap). Some instruments report overly optimistic quality scores. Setting a cap prevents any single base from having outsized influence. |
### Allele Detection Thresholds
| Parameter | Range | Default | Description |
| ------------------------ | ------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `min_alternate_fraction` | 0.0-1.0 | 0.05 | Minimum fraction of reads at a site supporting the alternate allele. **Lower values** increase sensitivity to mosaic or low-VAF variants. **Higher values** reduce noise. This is a critical sensitivity control. |
| `min_alternate_count` | 1-100 | 2 | Minimum absolute number of reads supporting the alternate allele. The hard floor for alt support. **Lower values** maximize sensitivity. **Higher values** provide stronger evidence requirements. |
| `min_alternate_qsum` | 0-10000 | 0 | Minimum sum of base qualities across all reads supporting the alternate allele. Acts as a **quality-weighted version** of `min_alternate_count`. Provides a smoother filter than a hard count threshold. |
### Coverage
| Parameter | Range | Default | Description |
| -------------- | ------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `min_coverage` | 0-1000 | 0 | Minimum total read depth to process a site. 0 means process everything. **Higher values** skip extremely low-coverage sites where calling is unreliable. |
### Read Filtering
| Parameter | Range | Default | Description |
| --------------------------------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `mismatch_base_quality_threshold` | 0-60 | 10 | Base quality threshold for counting mismatches in read-level filters. Only mismatches at bases with quality >= this value count toward `read_max_mismatch_fraction`. **Lower values** count more mismatches (stricter filtering). **Higher values** only count high-confidence mismatches. |
| `read_max_mismatch_fraction` | 0.0-1.0 | 1.0 | Maximum fraction of read bases that can be mismatches before excluding the read. The default of 1.0 **disables this filter** entirely. **Lower values** remove reads with a high proportion of mismatches, which strongly suggests misalignment or contamination. |
### Genotype Likelihood / Priors
These parameters control the Bayesian statistical model and affect how FreeBayes weighs evidence and applies priors.
| Parameter | Range | Default | Description |
| ------------------------ | ---------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `theta` | 0.0-0.1 | 0.001 | Population-scaled mutation rate, used as the parameter for the **Ewens Sampling Formula** prior. **Higher values** make the caller believe variants are more common, increasing sensitivity (more calls). **Lower values** make it more conservative. The default of 0.001 matches typical human nucleotide diversity. |
| `read_dependence_factor` | 0.0-1.0 | 0.9 | Scaling factor for successive observations from the same position/strand. Models the **non-independence** of reads (due to PCR amplification). A value of 1.0 treats all reads as independent. **Lower values** discount redundant evidence more aggressively, reducing false positives from PCR bias. **Higher values** trust all reads equally. Strongly affects the sensitivity/specificity tradeoff. |
| `pvar` | 0.0-1.0 | 0.0 | Minimum posterior probability to report a variant. At 0.0, all sites passing filters are reported. **Higher values** act as a Bayesian quality gate, only reporting variants the model is confident about. |
| `use_mapping_quality` | true/false | false | Incorporate mapping quality into data likelihood calculations. When enabled, reads with lower mapping quality contribute less to the genotype likelihood. **Enabling** can improve accuracy in regions with ambiguous mappings. |
| `harmonic_indel_quality` | true/false | false | Use the **harmonic mean** of flanking base qualities for indels instead of the minimum. The harmonic mean is more nuanced than the minimum and can provide better indel quality estimates. |
### Prior Model Toggles
FreeBayes applies several Bayesian priors by default. Turning them off removes assumptions about population genetics.
| Parameter | Values | Default | Description |
| --------------------------- | ---------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `hwe_priors_off` | true/false | false | Disable **Hardy-Weinberg Equilibrium** prior. HWE priors favor genotypes consistent with expected population frequencies (e.g., if alt allele frequency is 0.3, the prior favors het over hom-alt). |
| `binomial_obs_priors_off` | true/false | false | Disable **binomial observation priors**. These model the expected distribution of allele observations given a genotype (e.g., a het should show \~50% alt reads). Useful when observation distributions are systematically skewed. |
| `allele_balance_priors_off` | true/false | false | Disable **allele balance probability** prior. This prior penalizes genotypes where the observed allele balance doesn't match expectations. Similar to binomial priors but operates at the aggregate level. |
### Contamination
| Parameter | Range | Default | Description |
| -------------------- | ------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `prob_contamination` | 0.0-1.0 | 0.0 | Prior probability that a read comes from contaminating DNA. **Higher values** raise the bar for calling heterozygous variants, as low-frequency alleles might be attributed to contamination. |
### Population Genetics
| Parameter | Range | Default | Description |
| -------------------- | ----- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ploidy` | 1-10 | 2 | Assumed ploidy. 2 for diploid human calling on autosomes. Changing this fundamentally alters the genotyping model. |
| `use_best_n_alleles` | 0-20 | 0 | Limit evaluation to the N best SNP alleles. 0 means evaluate all observed alleles. **Lower values** can speed up calling at multi-allelic sites without losing accuracy for typical biallelic variants. |
### Haplotype / Complex Variants
| Parameter | Range | Default | Description |
| -------------------- | ----- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `max_complex_gap` | 0-100 | 3 | Maximum distance (in bp) between variants that can be grouped into a single complex allele (MNP or complex event). **Higher values** allow FreeBayes to call complex events spanning more bases. **Lower values** force variants to be called individually. |
| `min_repeat_entropy` | 0-4 | 1 | Minimum Shannon entropy (in bits) for a repeat to trigger repeat-aware calling. **Lower values** are more permissive (more regions treated as repeats). **Higher values** only flag highly repetitive regions. |
| `min_repeat_size` | 1-100 | 5 | Minimum total length (in bp) of a short tandem repeat region to trigger repeat-aware calling. **Lower values** apply repeat handling to shorter repeats. **Higher values** only activate for longer repeat tracts. Affects accuracy in homopolymer and STR regions. |
### Algorithm
| Parameter | Range | Default | Description |
| -------------------------- | ----- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `genotyping_max_banddepth` | 1-20 | 7 | Maximum depth of the banded genotype likelihood calculation. Controls how many alternative genotypes are evaluated per sample. **Higher values** allow more thorough exploration of the genotype space at multi-allelic sites. **Lower values** are faster but may miss the correct genotype at complex sites. |
# GATK HaplotypeCaller
Source: https://docs.theminos.ai/guides/gatk
Guide to mining with GATK HaplotypeCaller on Minos
**Docker Image:** `broadinstitute/gatk:4.5.0.0`
GATK (Genome Analysis Toolkit) HaplotypeCaller is the Broad Institute's flagship variant caller, part of the GATK4 suite. Unlike simple pileup-based callers, HaplotypeCaller performs **local de novo assembly** of haplotypes in active regions of the genome. This makes it particularly strong at detecting indels and complex variants that simpler callers miss.
| | |
| -------------- | ----------------------------------------------- |
| **Approach** | Local assembly + Pair-HMM + Bayesian genotyping |
| **Strengths** | Indels, complex variants, multi-allelic sites |
| **Parameters** | 22 across 9 categories |
| **Compute** | High — Pair-HMM is the bottleneck |
## How It Works
HaplotypeCaller operates in four main stages:
### 1. Active Region Determination
The caller scans the genome and identifies **active regions** — intervals where there's evidence of variation. Regions with no evidence of variants are skipped entirely. This is controlled by the `active_probability_threshold` — the minimum probability a site must have to be considered "active."
### 2. Local Assembly
Within each active region, HaplotypeCaller builds a **De Bruijn-like assembly graph** from the reads. This graph captures all possible haplotypes (sequences of variants) supported by the read data. The assembler uses configurable kmer sizes and pruning thresholds to balance sensitivity against noise.
### 3. Pairwise HMM (Pair-HMM)
Each read is realigned against every candidate haplotype using a **Pair Hidden Markov Model**. This computes the likelihood of observing each read given each haplotype, accounting for base quality scores, mapping quality, and gap penalties. This is the most computationally expensive step.
### 4. Genotyping
Using the Pair-HMM likelihoods as input, the caller applies **Bayesian genotyping** with configurable priors (heterozygosity, indel heterozygosity) to determine the most likely genotype at each variant site.
## Hyperparameters
### Quality Filtering
| Parameter | Range | Default | Description |
| ------------------------------ | ----- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `min_base_quality_score` | 0-50 | 10 | Minimum base quality to consider a base for calling. Bases below this are ignored entirely. **Lower values** increase sensitivity (more bases contribute) but may introduce noise from low-quality bases. **Higher values** improve specificity at the cost of losing some real signal. |
| `min_mapping_quality_score` | 0-60 | 20 | Minimum mapping quality for a read to be used. Reads with mapQ below this are discarded. mapQ 0 means the read maps equally well to multiple locations. **Higher values** ensure reads are confidently mapped, reducing false positives from mismapped reads. **Lower values** retain more data but risk noise in repetitive regions. |
| `base_quality_score_threshold` | 0-50 | 18 | Bases with quality below this threshold are "floored" to the minimum quality score. Acts as a soft filter — doesn't remove bases but reduces their influence. Works in tandem with `min_base_quality_score`. |
### Calling Confidence
| Parameter | Range | Default | Description |
| ----------------------------------------------- | ---------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `standard_min_confidence_threshold_for_calling` | 0-100 | 30.0 | Minimum phred-scaled confidence to emit a variant call. A value of 30 means 99.9% confidence. **Lower values** increase sensitivity — more variants called, but also more false positives. **Higher values** increase precision. |
| `emit_ref_confidence` | NONE / GVCF / BP\_RESOLUTION | NONE | Controls reference confidence output. `NONE` outputs only variant sites. `GVCF` emits reference blocks with confidence bands. `BP_RESOLUTION` emits every position. |
### PCR Error Model
| Parameter | Values | Default | Description |
| ----------------- | ------------------------------------------ | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `pcr_indel_model` | NONE / HOSTILE / AGGRESSIVE / CONSERVATIVE | CONSERVATIVE | Controls how aggressively the caller filters PCR-induced indel artifacts. `NONE` disables the model. `HOSTILE` is the most aggressive filter (assumes many indels are PCR artifacts). `CONSERVATIVE` applies light filtering. `AGGRESSIVE` is in between. |
### Assembly Graph
| Parameter | Range | Default | Description |
| ------------------------------------- | ---------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `min_pruning` | 1-10 | 2 | Minimum number of supporting reads for a path in the assembly graph to survive pruning. **Lower values** keep more paths, increasing sensitivity to low-frequency or low-coverage variants but also noise. **Higher values** require more evidence, improving precision. |
| `max_alternate_alleles` | 1-20 | 6 | Maximum number of alternate alleles to genotype at a single site. **Higher values** allow complex multi-allelic sites but increase compute. **Lower values** force the caller to pick the top alleles. |
| `min_dangling_branch_length` | 1-20 | 4 | Minimum length of a "dangling" branch (a path that doesn't connect back to the reference) to attempt recovery via Smith-Waterman alignment. **Lower values** recover more potential variants from partial read evidence, improving sensitivity. **Higher values** reduce noise from short, unreliable branches. |
| `recover_all_dangling_branches` | true/false | false | When enabled, attempts to recover ALL dangling branches regardless of length. Increases sensitivity but may introduce false positives from noise in the assembly graph. |
| `max_num_haplotypes_in_population` | 8-512 | 128 | Maximum number of candidate haplotypes from the assembly graph to evaluate. **Higher values** explore more possibilities, potentially finding rare or complex variants, but increase compute time significantly. **Lower values** are faster but may miss variants in complex regions. |
| `adaptive_pruning_initial_error_rate` | 0.0001-0.1 | 0.001 | Starting error rate for the probabilistic adaptive pruning model. This controls how aggressively low-support paths are pruned. **Higher values** assume more sequencing errors, pruning more aggressively (fewer false positives, potentially fewer true variants). **Lower values** are more permissive. |
| `pruning_lod_threshold` | 0.5-10.0 | 2.302585 | Log-odds threshold for adaptive pruning. Paths with support below this threshold (relative to the error model) are pruned. The default of \~2.3 corresponds to ln(10), or 10:1 odds. **Higher values** prune more aggressively. **Lower values** keep more paths. This interacts with `adaptive_pruning_initial_error_rate`. |
### Active Region Determination
| Parameter | Range | Default | Description |
| ------------------------------ | ----------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `active_probability_threshold` | 0.0001-0.05 | 0.002 | Minimum probability for a locus to be considered "active" (worth investigating for variants). Acts as an early filter in the pipeline. **Lower values** examine more sites, increasing sensitivity at the cost of runtime. **Higher values** skip marginal sites. |
| `min_assembly_region_size` | 1-300 | 50 | Minimum size (in bp) of an assembly region. Regions smaller than this are extended. **Smaller values** allow finer-grained analysis. **Larger values** provide more context for assembly but may dilute signal in isolated variant sites. |
| `max_assembly_region_size` | 100-1000 | 300 | Maximum size of an assembly region. Regions larger than this are split. **Larger values** capture more context for complex variants but increase memory and compute. **Smaller values** may miss variants that span region boundaries. |
| `assembly_region_padding` | 0-500 | 100 | Extra context bases added around each assembly region. Provides flanking sequence for the assembler. **Higher values** give more context, which helps with variants near region boundaries. **Lower values** reduce data processed per region. |
### Pair-HMM / Likelihood Computation
| Parameter | Range | Default | Description |
| ------------------------------------------ | ----- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `pair_hmm_gap_continuation_penalty` | 1-30 | 10 | Flat penalty (Phred-scale) for extending a gap in the Pair-HMM alignment. **Higher values** penalize longer indels more, reducing sensitivity to long indels but improving specificity. **Lower values** make the model more tolerant of long gaps. |
| `phred_scaled_global_read_mismapping_rate` | 10-60 | 45 | Global assumed probability that any read is mismapped (Phred-scaled). A value of 45 means \~1 in 30,000 reads is assumed mismapped. **Lower values** make the caller more skeptical of read evidence — useful in repetitive regions. **Higher values** trust reads more. |
### Genotyping Priors
| Parameter | Range | Default | Description |
| ---------------------------------- | ------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `heterozygosity` | 0.0001-0.01 | 0.001 | Prior probability of SNP heterozygosity. The default 0.001 matches average human SNP diversity (\~1 het per 1000 bases). **Higher values** make the caller more willing to call heterozygous SNPs (increased sensitivity). **Lower values** make it more conservative. |
| `indel_heterozygosity` | 0.00001-0.001 | 0.000125 | Prior probability of indel heterozygosity. Similar to `heterozygosity` but for indels. **Higher values** increase indel sensitivity. |
| `sample_ploidy` | 1-10 | 2 | Assumed ploidy. For human germline calling on autosomes, this should be 2 (diploid). Changing this fundamentally alters the genotyping model. |
| `contamination_fraction_to_filter` | 0.0-0.5 | 0.0 | Estimated fraction of reads from contaminating DNA. When set above 0, the caller downsamples reads supporting alternate alleles proportionally. Useful if you suspect cross-sample contamination is inflating false positives. |
### Downsampling
| Parameter | Range | Default | Description |
| ------------------------------- | ------ | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `max_reads_per_alignment_start` | 0-1000 | 50 | Maximum reads retained per alignment start position. 0 disables downsampling. At high coverage, many reads start at the same position. Downsampling reduces compute while retaining most information. |
### Read Filtering
| Parameter | Values | Default | Description |
| ----------------------------- | ---------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `dont_use_soft_clipped_bases` | true/false | false | When true, soft-clipped portions of reads are ignored. Soft clips often contain misaligned or adapter sequence that can create false variant calls. **Enabling** may improve precision in regions where reads have significant soft clipping. **Disabling** (default) uses all bases, which can help detect variants near read boundaries. |
# Overview
Source: https://docs.theminos.ai/overview
Minos — Decentralized Genomic Variant Calling on Bittensor Subnet 107
# The Foundational Layer of Genomics
Minos is a **decentralized genomic variant-calling network** running on [Bittensor Subnet 107](https://github.com/minos-protocol/minos_subnet). Miners compete to produce the most accurate variant calls from sequencing data. Validators score results against truth sets — **accuracy is the only thing that matters.**
**SN107** rewards miners based on the quality of their genomic variant calls.
***
## How Minos Works
Validators send miners a genomic region and aligned sequencing reads (BAM) to analyze.
Miners run one of the four supported variant callers with their own tuned hyperparameters to produce variant calls (VCF) and share their hyperparameter config with validators for scoring.
Validators generate the VCF using the miner's config and benchmark against a truth set using precision, recall, and F1-score.
***
## Supported Variant Callers
Minos supports **4 industry-standard tools**. Each guide covers the tool's algorithm, pipeline, and every tunable hyperparameter.
The Broad Institute's flagship caller. Performs **local de novo assembly** of haplotypes — Assembly-based approach for haplotype-aware calling.
Deep learning variant caller. Converts pileups into **CNN image classification** — platform-aware models for WGS, WES, and PacBio.
Bayesian haplotype-based caller with the **most tunable priors** — toggle HWE, allele balance, and contamination models independently.
The fastest caller. Classic **pileup-based approach** with a two-stage pipeline giving independent control over data prep and genotyping.
***
## Quick Links
How the subnet works end-to-end.
Get mining in under 10 minutes.
Source code and issue tracker.
# Quickstart
Source: https://docs.theminos.ai/quickstart
Get mining on Minos SN107 in under 10 minutes
## Prerequisites
Before you begin, make sure you have:
A registered Bittensor wallet with a hotkey registered on **Subnet 107**.
Docker installed and running. All variant callers run in containers.
***
## 1. Choose Your Variant Caller
Each tool has different strengths. Pick one to start with — you can switch later.
| Tool | Compute | Complexity |
| --------------- | ------------------- | ------------------- |
| **GATK** | High | Many parameters |
| **DeepVariant** | High (GPU optional) | Fewer parameters |
| **FreeBayes** | Medium | Most parameters |
| **BCFtools** | Low | Moderate parameters |
***
## 2. Pull the Docker Image
Pull the container for your chosen tool:
```bash GATK theme={null}
docker pull broadinstitute/gatk:4.5.0.0
```
```bash DeepVariant theme={null}
docker pull google/deepvariant:1.5.0
```
```bash FreeBayes theme={null}
docker pull staphb/freebayes:1.3.7
```
```bash BCFtools theme={null}
docker pull quay.io/biocontainers/bcftools:1.20
docker pull quay.io/biocontainers/samtools:1.20
```
***
## 3. Tune Your Hyperparameters
This is where you gain your competitive edge. Each guide documents every tunable parameter:
22 parameters across 9 categories.
15 parameters across 6 categories.
22 parameters across 9 categories.
22 parameters across 7 categories.
***
## 4. Start Mining
Register your miner on Subnet 107 and start processing tasks. The validator will send you genomic data, and your tuned caller will produce variant calls that get scored for accuracy.
## Next Steps
Understand how the scoring loop works end-to-end.
Clone the subnet repo and dig into the code.