← Về thư mục
📄 / / profiles / r-and-d / raw_evidence / OpenAI4S / skills / bioskills / bio-methylation-analysis-array-preprocessing / references / usage-guide.md

Array Preprocessing

Overview

Illumina Infinium methylation BeadChips (450K, EPIC, EPICv2) are the dominant platform for human epigenetic epidemiology, but a raw beta value is a two-chemistry fluorescence ratio conditioned on a fixed manifest, not a methylation measurement. This skill guides an AI agent through turning raw IDAT files into a defensible beta/M matrix: reading the two-channel intensities, correcting the Type I vs Type II probe-design mismatch, removing dye and background bias, masking failed probes (detection-p / pOOBAH), and choosing a normalization keyed on the array version and whether global methylation differences are expected. It stops at the corrected matrix; probe filtering, EPICv2 replicate collapse, and sample-identity QC belong to array-qc-filtering.

Prerequisites

R with Bioconductor and the array-version-specific packages:

BiocManager::install(c('sesame', 'sesameData', 'minfi', 'ChAMP', 'wateRmelon'))
# 450K:    IlluminaHumanMethylation450kmanifest, IlluminaHumanMethylation450kanno.ilmn12.hg19
# EPICv1:  IlluminaHumanMethylationEPICmanifest, IlluminaHumanMethylationEPICanno.ilm10b4.hg19
# EPICv2:  requires sesame (mainstream minfi does not auto-detect it)
BiocManager::install(c('IlluminaHumanMethylation450kmanifest',
                       'IlluminaHumanMethylation450kanno.ilmn12.hg19',
                       'IlluminaHumanMethylationEPICmanifest',
                       'IlluminaHumanMethylationEPICanno.ilm10b4.hg19'))

Conceptual prerequisites:

Quick Start

Tell your AI agent what you want to do:

Example Prompts

EPICv2 preprocessing

"I have a directory of EPICv2 IDAT pairs. Cache the sesame data, run openSesame with the default QCDPB prep to mask failed probes and correct dye and channel bias, and return both a beta matrix and an M-value matrix."

Choosing a normalization

"My study compares tumor and adjacent-normal tissue on 450K arrays. I expect global hypomethylation. Read the IDATs with minfi, normalize in a way that does not erase the global difference, and extract beta and M."

Detection masking

"Process these EPIC IDATs, compute a detection p-value per probe, and set probes failing at p > 0.01 to NA before you hand me the matrix."

Diagnosing the Type I/II artifact

"After preprocessing, plot the beta density split by Infinium design type to confirm the Type I and Type II peaks now line up, and tell me whether a BMIQ step is still needed."

What the Agent Will Do

  1. Confirm the array version and genome build, and that raw IDAT pairs (not a beta matrix) are available.
  2. Choose the framework: sesame for EPICv2 or best detection masking; minfi for 450K/EPICv1 when the downstream ecosystem is needed.
  3. Read the IDATs into the raw object (sesame SigDF via openSesame, or minfi RGChannelSet via read.metharray.exp).
  4. Apply correction: channel inference, dye-bias, background (noob), and detection masking (pOOBAH or detection-p at 0.01).
  5. Select a normalization keyed on the scenario: funnorm for expected global differences, quantile/dasen for subtle no-global-difference designs, BMIQ/SWAN for strong Type I/II correction, ssNoob/openSesame for single-sample.
  6. Extract beta (for reporting, with offset 100) and M-values (logit, for testing).
  7. Record the array version, genome build, normalization method, and probe-masking outcome; hand off filtering and identity QC to array-qc-filtering.

Tips