VariantAlleleFractionGateChecker

Variant Allele Fraction Gate

Liquid Biopsy жидкостная биопсия cfDNA ctDNA CTC exosomes NGS qPCR
Open selection

Utility description: Variant Allele Fraction Gate

Variant Allele Fraction Gate Checker — Context-Aware VAF Validation

ℹ️  Utility performs adaptive allele fraction verification according to AMP/ASCO/CAP, FDA NGS guidance and liquid biopsy standards:
     • LOD/LOQ Comparison: Comparison of observed VAF with validated limits of detection and quantification.
     • Purity-Adjusted Expectation: Correction of expected minimum VAF for tumor purity and ploidy.
     • Statistical Significance: Binomial test to assess significance of supporting read count.
     • Artifact Detection: Integration of strand bias, homopolymer context, and other technical flags.
     • Germline Suspicion Flag: Identification of variants with VAF ~50%/~100% in somatic samples.
     • Known Hotspot Exception: Relaxed filters for known driver mutations with statistical support.

⚠️  IMPORTANT: 
     • At 20% tumor purity, heterozygous somatic mutation has expected VAF ~10%, not 50%.
     • Fixed VAF=5% threshold will discard true variants in low-purity samples.
     • In liquid biopsy, VAF 0.1% may be true with sufficient depth and statistical support.
     • Binomial p-value > 0.05 means alt reads may be explained by sequencing error.

Usage:
  VariantAlleleFractionGateChecker.exe                            → demo mode (console output)
  VariantAlleleFractionGateChecker.exe input.csv output.json      → evaluate your data

Input format:
SampleID,VariantID,Gene,VariantType,Context,ObservedVAF_Percent,TotalDepth,AltReads,TumorPurity_Percent,Ploidy,AssayLOD_Percent,AssayLOQ_Percent,ExpectedMinVAF_PurityAdjusted,BinomialPValue,MaxBinomialPValue,IsKnownHotspot,HasStrandBias,IsInHomopolymer,GnomAD_AF,IsGermlineByVAF

Example:
  TUMOR-001,KRAS:c.35G>A,KRAS,SNV,Somatic_Tissue,8.5,450,38,20,2.0,5.0,10.0,7.5,1.2E-12,0.05,true,false,false,0.00001,false

📍 Scope of Application (Usage Where):
     • Clinical Oncogenomics: Filtering somatic variants in FFPE samples with variable purity.
     • Liquid Biopsy: Validation of ultra-rare variants (VAF <1%) in cfDNA.
     • MRD Monitoring: Distinguishing true signal from noise at sensitivity limit.
     • Tumor Heterogeneity Research: Identification of subclonal variants.

— WHY IS THIS NEEDED?
VAF is not an absolute value but a function of sample biology and technology.
Naive fixed-threshold filtering loses true variants in low-purity samples and passes artifacts in high-depth data.
Context-aware gate adapts decision to each specific sample and variant.
This is critically important for liquid biopsy sensitivity and tissue testing specificity.

⚠️  CRITICAL:
• Purity Adjustment: MANDATORY for tissue somatic samples. Without it = systematic variant loss.
• Binomial P ≤ 0.05: Without statistical significance, VAF is meaningless regardless of absolute value.
• Alt Reads ≥ 3: Absolute minimum for any call. 1-2 reads = artifact.
• Known Hotspot Exception: Applied ONLY with statistical support. Does not open door to noise.
• Germline Suspicion: VAF ~50% in somatic sample requires paired normal verification.
• Homopolymer Indels: Require increased stringency or orthogonal confirmation.

Key features:
• Adaptive VAF thresholds by context and purity
• Integrated statistical verification (binomial test)
• Multi-factor artifact detection
• Special handling of known hotspots
• Four-tier classification (Pass / Warning / Below LOD / Artifact)
• Compliance with AMP/ASCO/CAP and FDA NGS guidance

Critical parameters:
• Observed VAF vs Assay LOD: Context-dependent
• Purity-Adjusted Expected VAF: Calculated per sample
• Binomial P-Value: ≤ 0.05
• Alt Read Count: ≥ 3
• Artifact Flags: Minimized
• Germline Suspicion: Flagged if applicable

💡 Usage tips:
1. Tumor Purity: Estimate by independent method (pathologist, bioinformatics, flow cytometry).
2. LOD/LOQ: Use validated values for EACH sample type and panel.
3. Hotspots: Maintain current list of known driver mutations (COSMIC, OncoKB).
4. Liquid Biopsy: For VAF <0.5%, always require UMI support and binomial p-value.
5. Germline Findings: Configure automatic germline confirmation referral when VAF >40% in somatics.

⚠️ Note: This utility verifies STATISTICAL AND TECHNICAL reliability of VAF. It does not determine clinical significance. Biological interpretation is performed downstream (VariantClassificationGateChecker, BiomarkerResultGateChecker).

input.csv

SampleID,VariantID,Gene,VariantType,Context,ObservedVAF_Percent,TotalDepth,AltReads,TumorPurity_Percent,Ploidy,AssayLOD_Percent,AssayLOQ_Percent,ExpectedMinVAF_PurityAdjusted,BinomialPValue,MaxBinomialPValue,IsKnownHotspot,HasStrandBias,IsInHomopolymer,GnomAD_AF,IsGermlineByVAF
TUMOR-001,KRAS:c.35G>A,KRAS,SNV,Somatic_Tissue,8.5,450,38,20,2.0,5.0,10.0,7.5,1.2E-12,0.05,true,false,false,0.00001,false
LB-001,EGFR:c.2573T>G,EGFR,SNV,Somatic_LiquidBiopsy,0.25,25000,62,100,2.0,0.5,1.0,0.5,3.5E-8,0.05,true,false,false,0.0,false
TUMOR-002,PTEN:c.388C>T,PTEN,Indel,Somatic_Tissue,6.2,180,11,45,2.0,5.0,10.0,18.0,0.08,0.05,false,true,true,0.0001,false
TUMOR-003,BRCA2:c.5946del,BRCA2,Indel,Somatic_Tissue,48.0,320,154,60,2.0,5.0,10.0,25.0,0.0,0.05,false,false,false,0.0003,true

URS & FS — User Requirements and Functional Specification

This document describes the controlled interface and behaviour of VariantAlleleFractionGateChecker for Variant Allele Fraction Gate Checker.

Domain limits and critical parameters

Key fragments from the source description are shown below. Before production use, limits must be verified against the approved specification, registration dossier and local SOPs.
  • • LOD/LOQ Comparison: Comparison of observed VAF with validated limits of detection and quantification.
  • • Purity-Adjusted Expectation: Correction of expected minimum VAF for tumor purity and ploidy.
  • • Germline Suspicion Flag: Identification of variants with VAF ~50%/~100% in somatic samples.
  • • At 20% tumor purity, heterozygous somatic mutation has expected VAF ~10%, not 50%.
  • • Fixed VAF=5% threshold will discard true variants in low-purity samples.
  • • Binomial p-value > 0.05 means alt reads may be explained by sequencing error.
  • SampleID,VariantID,Gene,VariantType,Context,ObservedVAF_Percent,TotalDepth,AltReads,TumorPurity_Percent,Ploidy,AssayLOD_Percent,AssayLOQ_Percent,ExpectedMinVAF_PurityAdjusted,BinomialPValue,MaxBinomialPValue,IsKnownHotspot,HasStrandBias,IsInHomopolymer,GnomAD_AF,IsGermlineByVAF
  • TUMOR-001,KRAS:c.35G>A,KRAS,SNV,Somatic_Tissue,8.5,450,38,20,2.0,5.0,10.0,7.5,1.2E-12,0.05,true,false,false,0.00001,false
  • • Clinical Oncogenomics: Filtering somatic variants in FFPE samples with variable purity.
  • • Liquid Biopsy: Validation of ultra-rare variants (VAF <1%) in cfDNA.
  • • MRD Monitoring: Distinguishing true signal from noise at sensitivity limit.
  • Naive fixed-threshold filtering loses true variants in low-purity samples and passes artifacts in high-depth data.
  • This is critically important for liquid biopsy sensitivity and tissue testing specificity.
  • ⚠️ CRITICAL:
  • • Purity Adjustment: MANDATORY for tissue somatic samples. Without it = systematic variant loss.
  • • Binomial P ≤ 0.05: Without statistical significance, VAF is meaningless regardless of absolute value.
  • • Alt Reads ≥ 3: Absolute minimum for any call. 1-2 reads = artifact.
  • • Germline Suspicion: VAF ~50% in somatic sample requires paired normal verification.

URS — User Requirements Specification

IDRequirementCriticalityAcceptance criterion
URS-001The utility shall accept an input.csv file for Variant Allele Fraction Gate Checker with headers defined in the data contract.HighThe file is processed without manual header editing.
URS-002The utility shall perform deterministic QC evaluation without machine learning and without probabilistic conformance decisions.HighIdentical input data, rule version and configuration produce reproducible results.
URS-003The utility shall validate mandatory fields, data types, ranges, units and domain plausibility.HighSchema, conversion and range errors are explicitly reported.
URS-004The utility shall apply domain limits and rules from the description, approved specification, registration dossier and local SOPs.HighEach check has PASS/WARNING/FAIL and a clear message.
URS-005The utility shall generate output.json with machine-readable results, source values, warnings, failures and critical findings.HighJSON is suitable for LIMS/ELN/MES integration and QA/QC review.
URS-006The utility shall preserve traceability between batch/sample, input file, applied rules and final status.HighOutput contains identifiers, checked parameters and audit metadata.
URS-007The documentation shall support IQ/OQ/PQ, CSV/CSA and review by internal QA or inspectors.MediumURS, FS, input/output contract and test scenarios are supplied with the utility.
URS-008The utility shall be used as a QC decision-support tool and not as a substitute for approved specifications and QA/QP release decision.MediumDocumentation states change control and limit-verification expectations.

input.csv contract

#FieldTypeSamplePurpose
1SampleIDstring / controlled vocabularyTUMOR-001Sample or laboratory specimen identifier.
2VariantIDstring / controlled vocabularyKRAS:c.35G>AControlled input parameter for deterministic QC rules.
3Genestring / controlled vocabularyKRASControlled input parameter for deterministic QC rules.
4VariantTypestring / controlled vocabularySNVControlled input parameter for deterministic QC rules.
5Contextstring / controlled vocabularySomatic_TissueControlled input parameter for deterministic QC rules.
6ObservedVAF_Percentdecimal8.5Controlled input parameter for deterministic QC rules.
7TotalDepthdecimal450Controlled input parameter for deterministic QC rules.
8AltReadsdecimal38Controlled input parameter for deterministic QC rules.
9TumorPurity_Percentdecimal20Purity or impurity profile; key QC parameter.
10Ploidystring / controlled vocabulary2.0Controlled input parameter for deterministic QC rules.
11AssayLOD_Percentdecimal5.0Controlled input parameter for deterministic QC rules.
12AssayLOQ_Percentdecimal10.0Controlled input parameter for deterministic QC rules.
13ExpectedMinVAF_PurityAdjusteddecimal7.5Purity or impurity profile; key QC parameter.
14BinomialPValuedecimal1.2E-12Controlled input parameter for deterministic QC rules.
15MaxBinomialPValuedecimal0.05Controlled input parameter for deterministic QC rules.
16IsKnownHotspotstring / controlled vocabularytrueControlled input parameter for deterministic QC rules.
17HasStrandBiasstring / controlled vocabularyfalseControlled input parameter for deterministic QC rules.
18IsInHomopolymerstring / controlled vocabularyfalseControlled input parameter for deterministic QC rules.
19GnomAD_AFdecimal0.00001Controlled input parameter for deterministic QC rules.
20IsGermlineByVAFstring / controlled vocabularyfalseControlled input parameter for deterministic QC rules.
SampleID,VariantID,Gene,VariantType,Context,ObservedVAF_Percent,TotalDepth,AltReads,TumorPurity_Percent,Ploidy,AssayLOD_Percent,AssayLOQ_Percent,ExpectedMinVAF_PurityAdjusted,BinomialPValue,MaxBinomialPValue,IsKnownHotspot,HasStrandBias,IsInHomopolymer,GnomAD_AF,IsGermlineByVAF
TUMOR-001,KRAS:c.35G>A,KRAS,SNV,Somatic_Tissue,8.5,450,38,20,2.0,5.0,10.0,7.5,1.2E-12,0.05,true,false,false,0.00001,false
LB-001,EGFR:c.2573T>G,EGFR,SNV,Somatic_LiquidBiopsy,0.25,25000,62,100,2.0,0.5,1.0,0.5,3.5E-8,0.05,true,false,false,0.0,false
TUMOR-002,PTEN:c.388C>T,PTEN,Indel,Somatic_Tissue,6.2,180,11,45,2.0,5.0,10.0,18.0,0.08,0.05,false,true,true,0.0001,false

Input validation rules

IDFieldRuleCriticality
VR-001SampleIDThe field shall match an approved dictionary or accepted string representation.High
VR-002VariantIDThe field shall match an approved dictionary or accepted string representation.High
VR-003GeneThe field shall match an approved dictionary or accepted string representation.High
VR-004VariantTypeThe field shall match an approved dictionary or accepted string representation.Medium
VR-005ContextThe field shall match an approved dictionary or accepted string representation.Medium
VR-006ObservedVAF_PercentThe field shall match an approved dictionary or accepted string representation.Medium
VR-007TotalDepthThe field shall match an approved dictionary or accepted string representation.Medium
VR-008AltReadsThe field shall match an approved dictionary or accepted string representation.Medium
VR-009TumorPurity_PercentThe field shall match an approved dictionary or accepted string representation.Medium
VR-010PloidyThe field shall match an approved dictionary or accepted string representation.Medium
VR-011AssayLOD_PercentThe field shall match an approved dictionary or accepted string representation.Medium
VR-012AssayLOQ_PercentThe field shall match an approved dictionary or accepted string representation.Medium
VR-013ExpectedMinVAF_PurityAdjustedThe field shall match an approved dictionary or accepted string representation.Medium
VR-014BinomialPValueThe field shall match an approved dictionary or accepted string representation.Medium
VR-015MaxBinomialPValueThe field shall match an approved dictionary or accepted string representation.Medium
VR-016IsKnownHotspotThe field shall match an approved dictionary or accepted string representation.Medium
VR-017HasStrandBiasThe field shall match an approved dictionary or accepted string representation.Medium
VR-018IsInHomopolymerThe field shall match an approved dictionary or accepted string representation.Medium
VR-019GnomAD_AFThe field shall match an approved dictionary or accepted string representation.Medium
VR-020IsGermlineByVAFThe field shall match an approved dictionary or accepted string representation.Medium

FS — Functional Specification

IDFunctionImplementation
FS-001CLI executionSupport execution modes: demo mode without arguments and production mode input.csv output.json.
FS-002CSV importRead input.csv in UTF-8/CSV-compatible format and validate header and expected columns.
FS-003Schema validationCheck mandatory fields, column count, unknown key fields and empty mandatory values.
FS-004Type conversionConvert numeric, flag and text values; invalid format is recorded as a row-level error.
FS-005Domain rule engineApply rules for Variant Allele Fraction Gate Checker, including critical limits from the description and approved specification.
FS-006Status aggregationProduce final status: FAIL for critical failure, WARNING for non-critical deviation, PASS for conformance.
FS-007JSON exportWrite output.json with detailed checks, source values, warnings, failures and critical findings.
FS-008Audit supportKeep result structure suitable for review, deviation investigation and calculation reproduction.
FS-009Integration contractSupport the scenario LIMS/ELN/MES → input.csv → utility → output.json → portal/admin review.
FS-010Error handlingReturn explicit messages for missing file, empty CSV, invalid schema, output write failure and invalid format.

Example output.json

{
  "utilityId": "variantallelefractiongatechecker",
  "utilityFolder": "VariantAlleleFractionGateChecker",
  "package": "LiquidBiopsy",
  "overallStatus": "PASS|WARNING|FAIL",
  "sourceFile": "input.csv",
  "processedAtUtc": "2026-06-10T00:00:00Z",
  "checks": [
    {
      "parameter": "SampleID",
      "value": "TUMOR-001",
      "status": "PASS|WARNING|FAIL",
      "message": "Deterministic rule-based check result",
      "ruleReference": "FS-RULE-001"
    },
    {
      "parameter": "VariantID",
      "value": "KRAS:c.35G>A",
      "status": "PASS|WARNING|FAIL",
      "message": "Deterministic rule-based check result",
      "ruleReference": "FS-RULE-002"
    },
    {
      "parameter": "Gene",
      "value": "KRAS",
      "status": "PASS|WARNING|FAIL",
      "message": "Deterministic rule-based check result",
      "ruleReference": "FS-RULE-003"
    },
    {
      "parameter": "VariantType",
      "value": "SNV",
      "status": "PASS|WARNING|FAIL",
      "message": "Deterministic rule-based check result",
      "ruleReference": "FS-RULE-004"
    },
    {
      "parameter": "Context",
      "value": "Somatic_Tissue",
      "status": "PASS|WARNING|FAIL",
      "message": "Deterministic rule-based check result",
      "ruleReference": "FS-RULE-005"
    },
    {
      "parameter": "ObservedVAF_Percent",
      "value": "8.5",
      "status": "PASS|WARNING|FAIL",
      "message": "Deterministic rule-based check result",
      "ruleReference": "FS-RULE-006"
    },
    {
      "parameter": "TotalDepth",
      "value": "450",
      "status": "PASS|WARNING|FAIL",
      "message": "Deterministic rule-based check result",
      "ruleReference": "FS-RULE-007"
    },
    {
      "parameter": "AltReads",
      "value": "38",
      "status": "PASS|WARNING|FAIL",
      "message": "Deterministic rule-based check result",
      "ruleReference": "FS-RULE-008"
    },
    {
      "parameter": "TumorPurity_Percent",
      "value": "20",
      "status": "PASS|WARNING|FAIL",
      "message": "Deterministic rule-based check result",
      "ruleReference": "FS-RULE-009"
    },
    {
      "parameter": "Ploidy",
      "value": "2.0",
      "status": "PASS|WARNING|FAIL",
      "message": "Deterministic rule-based check result",
      "ruleReference": "FS-RULE-010"
    },
    {
      "parameter": "AssayLOD_Percent",
      "value": "5.0",
      "status": "PASS|WARNING|FAIL",
      "message": "Deterministic rule-based check result",
      "ruleReference": "FS-RULE-011"
    },
    {
      "parameter": "AssayLOQ_Percent",
      "value": "10.0",
      "status": "PASS|WARNING|FAIL",
      "message": "Deterministic rule-based check result",
      "ruleReference": "FS-RULE-012"
    }
  ],
  "criticalFindings": [],
  "warnings": [],
  "audit": {
    "inputHash": "sha256:<calculated at runtime>",
    "rulesVersion": "<utility executable version>",
    "documentation": "VariantAlleleFractionGateChecker.documentation.html"
  }
}

Traceability matrix

URSFSTestEvidence
URS-001FS-001, FS-002OQ-001Verify execution and import of valid input.csv.
URS-002FS-005, FS-006OQ-004Repeat the same dataset and compare output.json.
URS-003FS-003, FS-004, FS-010OQ-002, OQ-003Verify missing columns and invalid types.
URS-004FS-005, FS-006OQ-004, PQ-001Verify critical deviations on real/boundary data.
URS-005FS-007, FS-009OQ-005Verify JSON schema and downstream-system suitability.
URS-006FS-008OQ-006Verify identifiers and audit metadata.
URS-007FS-008, FS-010IQ-001, OQ-007Verify documentation completeness and control evidence.
URS-008FS-005, FS-008PQ-002Verify review workflow and no replacement of QA decision.

IQ/OQ/PQ test scenarios

IDScenarioExpected result
IQ-001Verify executable, input.csv, documentation and checksum availability.Delivery set is complete; version is recorded.
OQ-001Valid sample row from input.csv.PASS or acceptable WARNING according to rules.
OQ-002Remove a mandatory CSV column.Schema error or FAIL with missing-column reference.
OQ-003Place a non-numeric value into a numeric field.Type-conversion error with row/field reference.
OQ-004Set a critical parameter outside the limit.FAIL and critical finding.
OQ-005Verify output.json structure.All mandatory sections are present and JSON is valid.
OQ-006Verify batch/sample traceability.Input and result identifiers match.
PQ-001Verify 3–5 real user batches/samples.Result is confirmed by QC/QA review.
PQ-002Verify deviation workflow and manual QA decision.Utility supports review but does not replace approved decision.

QA/QC and change control

  • Do not rename columns without updating validator, documentation and test set.
  • Retain input.csv, output.json, executable version and checksum.
  • Before production use, perform IQ/OQ/PQ or equivalent CSV/CSA verification.
  • Critical limits shall be verified against the approved specification, registration dossier and local SOPs.
  • The utility provides structured QC decision support; final release decision remains with QA/QP and approved procedures.

Included in packages

Liquid Biopsy QC Suite

QC and pre-analytical control package for liquid biopsy workflows: cfDNA/ctDNA, CTC, EV/exosomes, methylation, NGS/qPCR/ddPCR, sample quality, contamination, sensitivity and reporting checks.

Open