---
title: "The minfi User's Guide"
author: "Kasper D. Hansen, Jean-Phillipe Fortin"
date: "`r doc_date()`"
package: "`r pkg_ver('minfi')`"
bibliography: minfi.bib
abstract: >
  A comprehensive guide to using the minfi package for analyzing
  DNA methylation microarrays from Illumina.vignettes.
vignette: >
  %\VignetteIndexEntry{minfi User's Guide}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
output: 
  BiocStyle::pdf_document:
    keep_tex: true
    number_sections: false
---

# Introduction

The `r Biocpkg("minfi")` package provides tools for analyzing Illumina's Methylation arrays, specifically the 450k and EPIC (also known as the 850k) arrays.  We have partial support for the older 27k array.

The tasks addressed in this package include preprocessing, QC assessments, identification of interesting methylation loci and plotting functionality.  Analyzing these types of arrays is ongoing research in ours and other groups.

The input data to this package are IDAT files, representing two different color channels prior to normalization.  This is the most complete data type, because IDAT files includes measurements on control probes.  It is possible to use Genome Studio files together with the data structures contained in this package, but only some functionality is available because Genome Studio output does not contain control probe information.  In addition, usually Genome Studio output is normalized using the methods implemented in Genome Studio and these are generally considered inferior.

## Citing the minfi package

The MINFI package contains methods which are described across multiple manuscripts, by different non-overlapping authors.  This makes citing the package a bit difficult, so here is a guide.

- If you are using MINFI in a publication, please cite [@minfi].  This publication includes details on sex estimation using `getSex()`, quality control using `getQC()`, quantile normalization using `preprocessQuantile()`, bump hunting using `bumphunter()` and block finding using `blockFinder()`.
- If you are using `preprocessQuantile()`, it would be considerate to also cite [@Touleimat:2012], since this publication describes a method essentially identical to `preprocessQuantile()`.
- If you are using `bumphunter()`, you should also cite the original bump hunter publication [@bumphunter].
- If you are using SWAN normalization as implemented in `preprocessSWAN()` please cite [@Maksimovic:2012].
- If you are using noob background correction as implemented in `preprocessNoob()`, please cite [@noob].
- If you are using functional normalization as implemented in `preprocessFunnorm()`, please cite [@funnorm]. The default in `preprocessFunnorm()` is to do noob background correction. If this is used, please also cite [@noob].
- If you are estimating A/B compartments as implemented in `compartments()` and `extractAB()`, please cite [@compartments].

# minfi classes

# Reading data

# Manifest / annotation



# Quality control

- use shinyMethyl
- minfiQC
- getSex checks
- mds plots
- plot conversion probes

# Preprocessing

- preprocessRaw
- preprocessIllumina
- preprocessSWAN
- preprocessQuantile
- preprocessNoob
- preprocessFunnorm

# SNPs and other issues

- SNPs
- cross reactive probes
- remove bad probes
- detection P
- Gap Hunting

# Identifying differentially methylated regions

- DMP finding
- Bump hunting
- Block finding
- plot DMRs with annotation. 

# Correcting for cell type heterogenity

- estimateCellTypes
- reference packages

# Other stuff

- Horvath age estimation
- other packages


# Sessioninfo

```{r sessionInfo, results='asis', echo=FALSE}
toLatex(sessionInfo())
```

# References


