DNA methylation preprocessing#
This mini-protocol converts Illumina methylation-array IDAT files into an analysis-ready probe-by-sample phenotype matrix for mQTL analysis.
Miniprotocol Timing#
Timing: TBD
Overview#
Choose either SeSAMe or minfi to preprocess paired red/green IDAT intensities. Both workflows produce beta-value and M-value matrices, convert probe coordinates to BED phenotype files, and annotate probes with nearby genes. M values are generally used as the quantitative phenotype for association testing, whereas beta values remain useful for interpretation.
After calling, phenotype imputation removes probes above the missingness threshold and imputes the remaining missing values. Steps 1 and 2 are alternative starting routes; run only one, then run step 3 on its M-value BED output.
Steps#
Analysis goal |
Commands to run, in order |
Inputs |
|---|---|---|
Process IDAT files with SeSAMe |
1 → 3 |
|
Process IDAT files with minfi |
2 → 3 |
|
Run the commands for the selected route in numerical order.
1. Call methylation levels with SeSAMe#
What it does: sesame performs probe- and sample-level detection filtering, calculates beta and M values, and formats both matrices as coordinate-sorted BED files.
sos run pipeline/methylation_calling.ipynb sesame --sample-sheet input/methylation/protocol_example.methylation.sample_sheet_int.csv --sample-sheet-header-rows 0 --cwd output/methylation
2. Call methylation levels with minfi#
What it does: minfi applies detection-p-value filtering and functional normalization, then writes beta and M values in the same downstream-compatible BED format.
sos run pipeline/methylation_calling.ipynb minfi --sample-sheet input/methylation_minfi/protocol_example.methylation.sample_sheet.csv --cwd output/methylation_minfi
3. Filter and impute the M-value matrix#
What it does: bed_filter_na removes probes exceeding the missingness threshold and uses soft-impute for the remaining missing entries.
sos run pipeline/phenotype_imputation.ipynb bed_filter_na --phenoFile output/methylation/protocol_example.methylation.sample_sheet_int.sesame.M.bed.gz --cwd .
Output Files#
Route/step |
Output filename and relative path |
Description |
|---|---|---|
SeSAMe |
|
Serialized SeSAMe result object |
SeSAMe |
|
Per-sample quality-control summary |
SeSAMe |
|
Probe-by-sample beta- and M-value tables |
SeSAMe |
|
Indexed BED phenotype matrices |
SeSAMe |
|
Probe-to-gene annotation |
minfi |
|
Serialized minfi result object |
minfi |
|
Probe-by-sample beta- and M-value tables |
minfi |
|
Indexed BED phenotype matrices |
minfi |
|
Probe-to-gene annotation |
Step 3 |
|
Filtered and imputed M-value phenotype matrix |
For the minfi route, give step 3 the minfi M-value BED path instead; the output keeps the minfi filename prefix.
Anticipated Results#
The selected calling route produces beta- and M-value matrices with probes in rows and samples in columns, together with sample QC and probe annotation files. After step 3, the M-value BED contains only retained probes and has no missing phenotype values, making it suitable for covariate preprocessing and methylation-QTL association testing.
Command interface#
sos run pipeline/methylation_calling.ipynb -h
sos run pipeline/phenotype_imputation.ipynb -h