PIE
PIE (Phasing all-In-one Evaluator) is a command-line tool for evaluating haplotype phasing.
Installation
Currently, the prebuilt wheel supports Python 3.8 on Linux x86_64.
Option1. Install through pip
Due to name conflict on PyPI, we have to use pie-phasing-eval for pip installation. It is just a name change, won't affect the command line.
conda create -n pie python=3.8
conda activate pie
pip install pie-phasing-eval
Option2. Install through Conda
conda create -n pie -y
conda activate pie
conda install -c bioconda pie
Option3. Local installation
conda create -n pie python=3.8
conda activate pie
# Download and decompress PIE release, enter the directory containing setup.py
pip install .
Usage
Required arguments
| Parameters | Description | Format or example |
|---|---|---|
-i or --input |
file for evaluation | .vcf / .vcf.gz / .bcf |
-c or --compare |
ground truth file | .vcf / .vcf.gz / .bcf |
-r or --ref |
reference file | .fa / .fasta / .fai |
-o or --output |
Output file prefix | exmaple: ./test/output_name |
Recommend flag
Use --verbose to monitor the running process and enable detailed logging.
Full usages
Usage: pie [OPTIONS]
Options:
-i, --input TEXT Input vcf/vcf.gz file for evaluation [required]
-n, --name TEXT User defined sample name, [default: Sample]
-c, --compare TEXT Ground truth vcf/vcf.gz file for comparison
[required]
-r, --ref TEXT Reference file fasta file (.fasta or .fa) or fasta
index file (.fai) [required]
-o, --output TEXT Output file prefix, such as -o ./test/output_name
[required]
-t, --threads INTEGER Maximum number of parallel threads [default: 24]
-m, --max-len INTEGER Maximum variant distance for pairwise calculation
[default: 2473538]
-b, --bed TEXT .bed file specifying genomic regions to include
[default: None]
--min-sv INTEGER Minimal length threshold of Structural Variant
[default: 30, ALT length > 30 bp is SV]
--chrom TEXT Chromosome to evaluate,use comma to join chromosome
name e.g. --chrom chr1,chr2,chr3
[default:chr1,chr2,chr3,...,chr22]
--sexchrom TEXT Sex chromosome,use comma to join chromosome name e.g.
--sexchrom chrX,chrY [default: chrX,chrY]
--mincount INTEGER Minimum number of phased sites in a phase block
[default: 2]
--block Output phasing block start and end positions in a BED
file
--no-sex Ignore sex chromosome
--canonical Canonical mode, only evaluate single mutation SNV
ignore double heterozygous site
--only-snv Only evaluate single nucleotide variation
--only-indel Only evaluate insertion and deletion
--only-sv Only evaluate structural variant
--no-snv Ignore single nucleotide variation
--no-indel Ignore insertion and deletion
--no-sv Ignore structural variant
--no-double Ignore double heterozygous site
--no-sort Do not sort chromosome or regions, directly use the
input order
--verbose Enable verbose mode, printing parameters and progress
to standard output
--version Show the version and exit.
--help Show this message and exit.
Examples
Suppose phase.vcf is the sample VCF file to be evaluated against the ground truth VCF file (truth.vcf).
- (Comprehensive) Evaluate all autosomes
pie --verbose -i phase.vcf -c truth.vcf -r ref.fa -o ./output/comprehensive
- (Chromosome specific) Restrict evaluation to selected chromosome
pie --verbose --chrom chr6 -i phase.vcf -c truth.vcf -r ref.fa -o ./output/chr6
- (Region specific) Focus only on regions defined in a BED file.
pie --verbose -i phase.vcf -c truth.vcf -r ref.fa --bed mhc.bed -o ./output/mhc
- (Filter) Exclude Structural Variants (SV) from the analysis
pie --verbose -i phase.vcf -c truth.vcf -r ref.fa --no-sv -o ./output/no_sv
- (More output) Output raw phasing block start and end positions to a BED file
pie --verbose -i phase.vcf -c truth.vcf -r ref.fa --block -o ./output/more
- (Miscellaneous) Evaluate only SNVs on chromosome 6 and output raw block start and end positions to a BED file.
pie --verbose -i phase.vcf -c truth.vcf -r ref.fa --chrom chr6 --only-snv --block -o ./output/misc
Test data
Small query and truth test files are provided in here including three formats:
| Filename | Format | Description |
|---|---|---|
| small_query.vcf | VCF | Uncompressed VCF |
| small_query.vcf.gz | VCF.GZ | Compressed VCF |
| small_query.bcf | BCF | Binary VCF |
small_truth.vcf is provided as the truth.
The VCF format follows the VCF v4.1 specification https://samtools.github.io/hts-specs/VCFv4.1.pdf
Output file
| Output suffix | Description | Condition |
|---|---|---|
.variant.stats.csv |
Genotype evaluation result and phased percentage | Always generated |
.perchrom.csv |
Per chromosome phasing evaluation result | Always generated |
.overall.csv |
Overall sample evaluation result | Always generated |
.blocks.bed |
Raw phasing block start and end in -i or --input file |
with --block set |
Resource consumption
Pie is expected to complete evaluation within minutes with the default 24 threads on an x86_64 platform.
The actual performance may vary depending on factors such as size of vcf, I/O speed, memory speed, and CPU capabilities.
Acknowledgements
Pie is dependent on the following libraries, we are grateful to all the developers/maintainers:
- click: Python command line
- cyvcf2: VCF/BCF processing
- pyfastx: Reference FASTA processing
- numba: JIT acceleration
- sortedcontainers: Python Sorted Container Types
Metadata
Release files for pie-phasing-eval 0.12.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pie_phasing_eval-0.12.0.tar.gz | 22.1 kB | Without provenance | Details for pie_phasing_eval-0.12.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pie_phasing_eval-0.12.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl | CPython 3.8 | CPython 3.8 | Linux glibc 2.5+ x86-64 | Details for pie_phasing_eval-0.12.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
Total release size: 49.4 kB
Release files / pie_phasing_eval-0.12.0.tar.gz
| Download URL | pie_phasing_eval-0.12.0.tar.gz |
|---|---|
| Size | 22.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dd57e0b67f26ae3696fbfa4e9ab813256631954019cda3d0617e182db9851dcc
|
|
BLAKE2b-256 checksum How to use checksums |
5b042908458834e7ce81dad20127011ebc7a17927de563fdacb4fb0a42ec4b8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.8.20
|
Release files / pie_phasing_eval-0.12.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | pie_phasing_eval-0.12.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 27.3 kB |
| Tags | CPython 3.8 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
15711af8c4df0cddd732738f869b896c8e98bd45383ca207dc99d4da3d78adc1
|
|
BLAKE2b-256 checksum How to use checksums |
ce131e14cfa28644f3db79a2d671ddc0f1ec5d5139dbf20a8638b88fb1ee10a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.8.20
|
Security for pie-phasing-eval 0.12.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.