Skip to main content

Filter-first analysis of EPICv2 duplicate CpG probes.

Project description

betaSieve logo

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.

EPICv2 IlmnID naming: one CpG site, multiple probe designs, and suffix encoding

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

  1. Analysis of EPICv2 IlmnIDs with different probe designs.
  2. Optional threshold sweep across user-defined beta-value differences.
  3. 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:

  1. A fixed threshold (threshold)
  2. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

betasieve-0.2.0.tar.gz (38.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

betasieve-0.2.0-py3-none-any.whl (38.4 kB view details)

Uploaded Python 3

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

Hashes for betasieve-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ae73f5ac68c795c7c2bcbb1aaf4a085080a777c7445e3a453307749dfde0c467
MD5 1a2aec402c6eb112031107cc0afa24fc
BLAKE2b-256 f3072be6aa140f662316f03a603df676bf34a2488bb819e1f32f58a8df0adbd4

See more details on using hashes here.

Provenance

The following attestation bundles were made for betasieve-0.2.0.tar.gz:

Publisher: publish-pypi.yaml on MarStreicher/betaSieve

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for betasieve-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d14e4c458277fd629543511e3004035408b7a219ce9e9b09575fbe0e854eda0f
MD5 816e4ed3b3e89007b1b9f7b7769a0756
BLAKE2b-256 0f76d4bd08c3782ea9d46facc3ef04dd6ceda751736460530dd9ee965cf10b40

See more details on using hashes here.

Provenance

The following attestation bundles were made for betasieve-0.2.0-py3-none-any.whl:

Publisher: publish-pypi.yaml on MarStreicher/betaSieve

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page