Filter-first analysis of EPICv2 duplicate CpG probes.
Project description
betaSieve
EPICv2 probe designs analysis
betaSieve is a Python package that identifies HumanMethylationEPIC v2.0 BeadChip (EPICv2) probes that exhibit high variability between measurements of different probe designs. To do so, the package evaluates probe design agreement by analyzing beta-value differences for each (CpG site, sample) pair.
Why should I care?
EPICv2 can measure the same CpG site with several probe designs. Those designs appear as separate IlmnID rows, and we observed that their β-values can disagree for the same sample.
IlmnID naming and replicate definitions adapted from Peters et al. (2024), BMC Genomics 25:251, and Supplementary File 4 (doi:10.1186/s12864-024-10027-5).
betaSieve finds sites where design disagreement is larger than expected from exact technical replicates. It can thus help to refine downstream analyses.
Please have a look at the wiki for a more detailed explanation of the background and theory behind this package.
Features
- Analysis of EPICv2 IlmnIDs with different probe designs.
- Optional threshold sweep across user-defined beta-value differences.
- Identification of highly variable candidate IlmnIDs that should be flagged.
Installation
From GitHub
pip install betasieve
Dependencies are installed automatically.
Quick Start
Python API
from pathlib import Path
from betasieve import SieveArgs, run_beta_sieve
args = SieveArgs(
betas_path=Path("betas.csv"),
threshold_min=0.03,
threshold_max=0.07,
threshold_step=0.01,
)
results = run_beta_sieve(args)
n_candidates = (
0 if results.candidate_cpgs is None
else len(results.candidate_cpgs)
)
print(
f"Threshold: {results.threshold}, "
f"candidates: {n_candidates}"
)
Command Line
betasieve \
--betas betas.csv \
--threshold_min 0.03 \
--threshold_max 0.07 \
--threshold_step 0.01
Citation
If you use betaSieve in published work, please cite:
Streicher M. betaSieve: Filter-first analysis of EPICv2 duplicate CpG probes. GitHub repository. 2026.
For EPICv2 probe naming and replicate definitions (as used in the overview figure above), please also cite:
Peters TJ, Meyer B, Ryan L, Achinger-Kawecka J, Song J, Campbell EM, Qu W, Nair S, Loi-Luu P, Stricker P, Lim E, Stirzaker C, Clark SJ, Pidsley R. Characterisation and reproducibility of the HumanMethylationEPIC v2.0 BeadChip for DNA methylation profiling. BMC Genomics. 2024;25:251. https://doi.org/10.1186/s12864-024-10027-5
License
BSD 3-Clause License (see LICENSE).
Parameters
betaSieve can be configured either through the Python API (SieveArgs) or through the command-line interface.
Required Parameters
betas_path
Path to the input beta-value matrix.
Expected format:
- Rows correspond to CpG probes.
- Columns correspond to samples.
- Values must be beta values between 0 and 1.
Example:
betas_path=Path("betas.csv")
Threshold Selection
betaSieve requires either:
- A fixed threshold (
threshold) - An automatic threshold search (
threshold_min,threshold_max,threshold_step)
threshold
Fixed beta-value difference threshold used to determine whether duplicate probes are considered concordant.
Range:
(0, 1]
Example:
threshold=0.05
threshold_min
Minimum threshold evaluated during automatic threshold search.
Example:
threshold_min=0.03
threshold_max
Maximum threshold evaluated during automatic threshold search.
Example:
threshold_max=0.07
threshold_step
Increment between tested thresholds.
Example:
threshold_step=0.01
The above configuration evaluates:
0.03, 0.04, 0.05, 0.06, 0.07
Statistical Parameters
fdr
Method used for multiple-testing correction. betaSieve does not implement these procedures itself; it passes the chosen method to statsmodels.stats.multitest.multipletests from the statsmodels package (source).
Default:
fdr="fdr_bh"
Available methods (as supported by statsmodels.stats.multitest.multipletests):
| Method | Description |
|---|---|
| bonferroni | Bonferroni correction |
| sidak | Sidak correction |
| holm-sidak | Holm-Sidak procedure |
| holm | Holm procedure |
| simes-hochberg | Simes-Hochberg procedure |
| hommel | Hommel procedure |
| fdr_bh | Benjamini-Hochberg FDR |
| fdr_by | Benjamini-Yekutieli FDR |
| fdr_tsbh | Two-stage Benjamini-Hochberg |
| fdr_tsbky | Two-stage Benjamini-Krieger-Yekutieli |
confidence
Confidence level used for confidence interval calculations.
Default:
confidence=0.95
Typical values:
| Value | Interpretation |
|---|---|
| 0.90 | 90% confidence interval |
| 0.95 | 95% confidence interval |
| 0.99 | 99% confidence interval |
target_p0
Target false-positive rate used internally during threshold optimization.
Default:
target_p0=0.05
Output Parameters
out_dir
Directory where all results are written.
Default:
out_dir=Path("results")
Generated structure:
results/
├── csv/
├── figures/
├── report/
└── pkl/
report
Generate an HTML summary report.
Default:
report=True
Disable report generation:
report=False
pkl
Save intermediate Python objects as pickle files.
Default:
pkl=False
Examples
Fixed Threshold
args = SieveArgs(
betas_path=Path("betas.csv"),
threshold=0.05,
)
Automatic Threshold Search
args = SieveArgs(
betas_path=Path("betas.csv"),
threshold_min=0.03,
threshold_max=0.07,
threshold_step=0.01,
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file betasieve-0.2.0.tar.gz.
File metadata
- Download URL: betasieve-0.2.0.tar.gz
- Upload date:
- Size: 38.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae73f5ac68c795c7c2bcbb1aaf4a085080a777c7445e3a453307749dfde0c467
|
|
| MD5 |
1a2aec402c6eb112031107cc0afa24fc
|
|
| BLAKE2b-256 |
f3072be6aa140f662316f03a603df676bf34a2488bb819e1f32f58a8df0adbd4
|
Provenance
The following attestation bundles were made for betasieve-0.2.0.tar.gz:
Publisher:
publish-pypi.yaml on MarStreicher/betaSieve
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
betasieve-0.2.0.tar.gz -
Subject digest:
ae73f5ac68c795c7c2bcbb1aaf4a085080a777c7445e3a453307749dfde0c467 - Sigstore transparency entry: 2256132986
- Sigstore integration time:
-
Permalink:
MarStreicher/betaSieve@5d756b996c54d424617ebbf9934582405c1c5e2a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/MarStreicher
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yaml@5d756b996c54d424617ebbf9934582405c1c5e2a -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file betasieve-0.2.0-py3-none-any.whl.
File metadata
- Download URL: betasieve-0.2.0-py3-none-any.whl
- Upload date:
- Size: 38.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d14e4c458277fd629543511e3004035408b7a219ce9e9b09575fbe0e854eda0f
|
|
| MD5 |
816e4ed3b3e89007b1b9f7b7769a0756
|
|
| BLAKE2b-256 |
0f76d4bd08c3782ea9d46facc3ef04dd6ceda751736460530dd9ee965cf10b40
|
Provenance
The following attestation bundles were made for betasieve-0.2.0-py3-none-any.whl:
Publisher:
publish-pypi.yaml on MarStreicher/betaSieve
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
betasieve-0.2.0-py3-none-any.whl -
Subject digest:
d14e4c458277fd629543511e3004035408b7a219ce9e9b09575fbe0e854eda0f - Sigstore transparency entry: 2256132990
- Sigstore integration time:
-
Permalink:
MarStreicher/betaSieve@5d756b996c54d424617ebbf9934582405c1c5e2a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/MarStreicher
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yaml@5d756b996c54d424617ebbf9934582405c1c5e2a -
Trigger Event:
workflow_dispatch
-
Statement type: