Metadata-Version: 2.4
Name: vcf-audit
Version: 0.1.1
Summary: A transparent and reproducible framework for integrated quality auditing of Variant Call Format files.
Author: Samson A. Olofinsae
License-Expression: MIT
Keywords: bioinformatics,genomics,variant-calling,VCF,quality-control,quality-audit
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-cov>=5.0; extra == "dev"
Requires-Dist: ruff>=0.5; extra == "dev"
Requires-Dist: mypy>=1.10; extra == "dev"
Dynamic: license-file

# vcf-audit

A transparent and reproducible framework for integrated quality auditing of Variant Call Format (VCF) files.

**Development status:** v0.1.1 (pre-alpha) is the initial public release version. Historical scientific scope Version 1.0 is distinct from the package version.

## Purpose and scientific foundation

VCF quality assessment involves both integrity checks and descriptive measurements. vcf-audit integrates these forms of evidence in a single report, with explicit eligibility conditions, denominators and interpretation boundaries.

The 14 categorical rules are informed by the [VCF specification (v4.2)](https://samtools.github.io/hts-specs/VCFv4.2.pdf), including metadata requirements, field declarations, selected type and cardinality constraints, and structural consistency. Four framework-defined descriptive rules characterise FILTER status, QUAL scores, eligible INFO/DP depth and FORMAT/GT completeness. These measurement contracts do not impose universal quality thresholds.

## How it works

```mermaid
flowchart TD
    A[VCF input] --> B[Input validation and parsing]
    B -->|Failure| C[Diagnostic: no completed audit]
    B --> D[14 categorical rules]
    B --> E[4 descriptive rules]
    D --> F[Integrated audit report]
    E --> F
```

The report combines rule findings, descriptive metrics and overall severity. The software provides a command-line interface and structured Python interface.

In textual form: the input is validated and parsed; a failure produces a diagnostic without a completed audit. Successful parsing enables the categorical and descriptive rules, whose results are combined in the integrated audit report.

## Installation and quick start

The following instructions describe the v0.1.1
installation routes. PyPI installation requires
availability of the published package.

Create an isolated Python environment (Linux/WSL):

```bash
python3 -m venv .venv-vcf-audit
source .venv-vcf-audit/bin/activate
```

Install the versioned package from PyPI:

```bash
python -m pip install vcf-audit==0.1.1
```

Alternatively, after obtaining the release wheel:

```bash
python -m pip install vcf_audit-0.1.1-py3-none-any.whl
```

Verify installation:

```bash
vcf-audit --version
vcf-audit --help
```

To audit your own VCF:

```bash
vcf-audit tumour.vcf.gz
```

Replace the input filename with your own.

### Worked synthetic examples

After obtaining the public source repository, run these
commands from its root:

```bash
vcf-audit examples/ordinary.vcf
status=0
vcf-audit examples/defective.vcf || status=$?
printf 'Exit code: %s\n' "$status"
```

The ordinary example is expected to complete with PASS
(exit 0). The defective example is expected to complete
with ERROR (exit 1), identifying three deliberately
introduced integrity defects.

Both contain five records. The eligible INFO/DP mean
changes from 30 to 16 because the defects alter measurement
eligibility, not biological coverage.

The examples are separate source-repository resources;
their presence in the installed wheel is not required.

Python >=3.10 is declared; clean-environment qualification
used Python 3.12.3 on WSL/Linux. No mandatory runtime
dependencies; source builds may require build dependencies.
Supported inputs: plain `.vcf`, gzip `.vcf.gz`, sequential
BGZF `.vcf.bgz`. BCF is unsupported. No tabix index is
required for sequential input.

| Exit | Meaning |
| --- | --- |
| 0 | Completed PASS audit or successful help/version |
| 1 | Completed adverse audit |
| 2 | Input, parser, unsupported-format or argument error |

PASS means no WARNING or ERROR findings under the
implemented rules. INFORMATION findings do not escalate
severity. See the [user guide](https://github.com/samson-olofinsae/vcf-audit/blob/v0.1.1/docs/user_guide.md) for
report capture and Python usage.

## Practical application

| Example | Records | Findings | Outcome |
| --- | ---: | ---: | --- |
| Ordinary synthetic VCF | 5 | 27 | PASS |
| Deliberately defective synthetic VCF | 5 | 27 | ERROR (expected) |
| HG002 germline subset | 193 | 124 | PASS |
| Tumour–normal somatic VCF | 124 | 176 | PASS |

The somatic example contained 79.03% records with failing FILTER states and 100% missing QUAL scores, yet completed with audit PASS. This illustrates the distinction between descriptive quality evidence and integrity violations. See [practical examples](https://github.com/samson-olofinsae/vcf-audit/blob/v0.1.1/examples/README.md) for interpretation and provenance.

## Validation and reproducibility

Controlled validation covered 124 physical synthetic specimens. Following a targeted parser correction, 476 source tests passed; 123 historical specimen observations remained identical and one changed as prospectively specified. The installed v0.1.1 wheel reproduced all 124 corrected-source observations (106 reports, 18 parser exceptions). Selected somatic descriptive measurements agreed with independent calculations across 37 quantitative fields. See [reproducibility](https://github.com/samson-olofinsae/vcf-audit/blob/v0.1.1/docs/reproducibility.md) for historical results and qualifications.

## Scope and limitations

The framework does not establish biological truth, clinical suitability, exhaustive VCF conformance or universal quality thresholds. It does not call, filter or rewrite variants. INFO/DP is not interchangeable with FORMAT/DP. Called genotype representation does not establish genotype accuracy. Records are retained in memory; large-file scalability and cross-platform qualification have not been established. Practical applications demonstrate bounded applicability, not diagnostic validation.

## Documentation

- [User guide](https://github.com/samson-olofinsae/vcf-audit/blob/v0.1.1/docs/user_guide.md)
- [Scientific rule reference](https://github.com/samson-olofinsae/vcf-audit/blob/v0.1.1/docs/rule_reference.md)
- [Reproducibility](https://github.com/samson-olofinsae/vcf-audit/blob/v0.1.1/docs/reproducibility.md)
- [Examples](https://github.com/samson-olofinsae/vcf-audit/blob/v0.1.1/examples/README.md)
- [Changelog](https://github.com/samson-olofinsae/vcf-audit/blob/v0.1.1/CHANGELOG.md)
- [Provisional citation](https://github.com/samson-olofinsae/vcf-audit/blob/v0.1.1/CITATION.cff)

## Citation, licence and contributions

Software citation metadata is provisional; DOI and release date are pending. Scientific feedback and reproducibility evaluations are welcome. Attribution reflects actual contributions.

Author: Dr Samson A. Olofinsae. [MIT licence](https://github.com/samson-olofinsae/vcf-audit/blob/v0.1.1/LICENSE).
