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.
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.
- 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.
pip install betasieveDependencies are installed automatically.
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}"
)betasieve \
--betas betas.csv \
--threshold_min 0.03 \
--threshold_max 0.07 \
--threshold_step 0.01If 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
BSD 3-Clause License (see LICENSE).
betaSieve can be configured either through the Python API (SieveArgs) or through the command-line interface.
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")betaSieve requires either:
- A fixed threshold (
threshold) - An automatic threshold search (
threshold_min,threshold_max,threshold_step)
Fixed beta-value difference threshold used to determine whether duplicate probes are considered concordant.
Range:
(0, 1]
Example:
threshold=0.05Minimum threshold evaluated during automatic threshold search.
Example:
threshold_min=0.03Maximum threshold evaluated during automatic threshold search.
Example:
threshold_max=0.07Increment between tested thresholds.
Example:
threshold_step=0.01The above configuration evaluates:
0.03, 0.04, 0.05, 0.06, 0.07
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 level used for confidence interval calculations.
Default:
confidence=0.95Typical values:
| Value | Interpretation |
|---|---|
| 0.90 | 90% confidence interval |
| 0.95 | 95% confidence interval |
| 0.99 | 99% confidence interval |
Target false-positive rate used internally during threshold optimization.
Default:
target_p0=0.05Directory where all results are written.
Default:
out_dir=Path("results")Generated structure:
results/
├── csv/
├── figures/
├── report/
└── pkl/
Generate an HTML summary report.
Default:
report=TrueDisable report generation:
report=FalseSave intermediate Python objects as pickle files.
Default:
pkl=Falseargs = SieveArgs(
betas_path=Path("betas.csv"),
threshold=0.05,
)args = SieveArgs(
betas_path=Path("betas.csv"),
threshold_min=0.03,
threshold_max=0.07,
threshold_step=0.01,
)