This document provides an overview of DNA methylation analysis. It begins with background on DNA methylation functions and diseases. It then discusses methods for measuring DNA methylation status, including bisulfite sequencing. The document reviews steps for DNA methylation data analysis using tools like methylKit in R. It presents a case study example of analyzing DNA methylation data from human stem cells and fibroblasts. Alignment, quality control, differential methylation analysis and visualization are discussed.
12
Genomic DNA
Deep Sequencing
Techniques for Enrichmentof Methylated
or Target Regions Prior to BS-Seq
Lister, R. & Ecker, J.R. Finding the
fifth base: genome-wide sequencing
of cytosine methylation. Genome
Res 19, 959-66 (2009).
WGBS Coverage Depth vs Replicates
• For DMR identification
• Per-sample coverage in the range of 5–15×, depending on the magnitude of methylation differences
between the groups and whether a smoothing or single CpG-based DMR identification strategy is
used
•To identify long DMRs with large methylation differences, we find that reducing coverage down to 1×
or 2× per sample is acceptable
• Biological replicates should be analyzed separately to increase power, as opposed to being pooled
together for analysis
• Strongly argue for the use of at least two separate biological replicates for DMR analysis
• Choosing an appropriate number of biological replicates is a complex issue influenced by the degree
of within-group heterogeneity, the magnitude of between-group differences and the presence of
confounding factors such as batch effects.
18Ziller, M. J., Hansen, K. D., Meissner, A. & Aryee, M. J. Coverage recommendations for methylation analysis by whole-genome bisulfite
sequencing. Nat Methods 12, 230-232, 231 p following 232, doi:10.1038/nmeth.3152 (2015).
Required Software in Your Laptop
• Mac OS X Terminal
• Application àUtilities à Terminal (終端機)
• Linux console
• Putty:
http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe
• SCP/SFTP/FTP client
• Winscp: http://winscp.net/download/winscp556.zip
• PDF viewer
• http://get.adobe.com/tw/reader/
• R
• https://cran.r-project.org/
29
30.
Required R Packages
• Bioconductor
• http://www.bioconductor.org/install/#install-
bioconductor-packages
•methylKit:
• https://github.com/al2na/methylKit
30
> R
# dependencies
> install.packages( c("data.table","devtools"))
> source("http://bioconductor.org/biocLite.R")
> biocLite(c("GenomicRanges","IRanges"))
# install the development version from github
> library(devtools)
> install_github("al2na/methylKit",build_vignettes=FALSE)
31.
Analysis Pipeline
31
Allele-specific Methylated Regions
amrfinder allelicmeth
Differential Methylation Region
dmr
Large Hypo/Hyper-Methylation Domains
pmd
Hypo/Hyper-Methylation Regions
hmr hyperhmr pmr
Methylation Calling
methcounts
Bisulfite Conversion Rate
bsrate
Remove Duplicate Reads
duplicate-remover
Mapping
walt
Quality Trimming
fastq_masker
Cross-species Comparison of Methylomes
liftOver
Calculating Methylation Ratio for Regions
bigWigAverageOverBed roimethstat bwtools
Generate Methylation BED file
Bedtools bedGraphToBigWig
fastx toolkit: http://hannonlab.cshl.edu/fastx_toolkit/
MethPipe: http://smithlabresearch.org/software/methpipe/
Bedtools: https://github.com/arq5x/bedtools2
Programs from UCSC Genome Browser:
http://hgdownload.cse.ucsc.edu/admin/exe/linux.x86_64
bwtool: https://github.com/CRG-Barcelona/bwtool/wiki
Sorting mr files
Sorting mr files
http://smithlabresearch.org/downloads/methpipe-manual.pdf
32.
Public BS-Seq Datasets
32
http://smithlabresearch.org/software/methbase/
Other species in NCBI GEO Database
• Glycine max (Soy beans)
•Schistocerca gregaria (Locust)
• Rattus norvegicus (Rat)
• Danio rerio (Zebra fish)
• Drosophila melanogaster (Fruit fly)
• Oryza sativa (Rice)
• Macaca mulatta (Rhesus monkey)
• Mus musculus domesticus (Western Europen house mouse)
• Xenopus (Silurana) tropicalis (Frog)
• Cynoglossus semilaevis (Tongue sole, bony fish)
• Bombyx mori (Silkworm)
• Harpegnathos saltator (Jerdon's jumping ant)
• Camponotus floridanus (Florida carpenter ant)
DEMO Files
> cd /work3/LSLNGSDNAMETH
>ls -alh
total 12G
drwxr-xr-x 4 u00gel00 u00ycm02 4.0K Nov 16 00:29 .
drwxrwxrwt 109 root root 4.0K Nov 15 14:10 ..
-rwxr-xr-x 1 u00gel00 u00ycm02 65K Nov 15 17:22 h1.chrX.hmr
-rwxr-xr-x 1 u00gel00 u00ycm02 4.6G Nov 15 14:51 h1.chrX.mr.dremove
-rwxr-xr-x 1 u00gel00 u00ycm02 9.8K Nov 15 17:22 h1.chrX.pmd
-rwxr-xr-x 1 u00gel00 u00ycm02 34M Nov 15 17:39 h1.chrX_CpG.meth
-rwxr-xr-x 1 u00gel00 u00ycm02 39M Nov 15 23:52 h1.chrX_CpG.meth.for.methylKit
-rwxr-xr-x 1 u00gel00 u00ycm02 161K Nov 15 17:22 h1_gt_imr90.chrX.dmr
-rwxr-xr-x 1 u00gel00 u00ycm02 45M Nov 15 17:22 h1_imr90.chrX.methdiff
-rwxr-xr-x 1 u00gel00 u00ycm02 55K Nov 15 17:22 h1_lt_imr90.chrX.dmr
-rwxr-xr-x 1 u00gel00 u00ycm02 194K Nov 15 17:22 imr90.chrX.hmr
-rwxr-xr-x 1 u00gel00 u00ycm02 7.3G Nov 15 14:52 imr90.chrX.mr.dremove
-rwxr-xr-x 1 u00gel00 u00ycm02 5.6K Nov 15 17:22 imr90.chrX.pmd
-rwxr-xr-x 1 u00gel00 u00ycm02 35M Nov 15 17:39 imr90.chrX_CpG.meth
-rwxr-xr-x 1 u00gel00 u00ycm02 40M Nov 15 23:52 imr90.chrX_CpG.meth.for.methylKit
drwxr-xr-x 6 u00gel00 u00ycm02 4.0K Nov 15 14:28 methpipe-3.3.1
drwxr-xr-x 4 u00gel00 u00ycm02 4.0K Nov 15 14:46 methpipe-data
35
36.
Quality Trimming and Split FASTQ Files into Smaller
Files (Example ONLY)
#e.g. SRR018975.fastq.gz
>for f in *.gz;
do
b=`basename $f .gz`;
echo $f
bsub -q 4G -o $f.stdout -e $f.stderr "
gzip -dc $f|
fastq_masker -q 30 -Q33|
split -dl 6000000 - $b- ";
done
> ls
SRR018975.fastq-00
SRR018975.fastq-01
SRR018975.fastq-02
… 36
#e.g. SRR018975.fastq.gz
# listing all gzip files one by one
# SRR018975.fastq
#uncompressing gzip file and out to stdout
#masking low quality reads as Ns
#spliting fastq file into smaller ones
37.
Mapping BS-Seq
FASTQ Files
(Example ONLY)
> export AdapterTrich=AATGATACGGCGACCACCGAGATCTACACTCTTTCCCTACACGACGCTCTTCCGATCT
>export AdapterArich=CAAGCAGAAGACGGCATACGAGCTCTTCCGATCT
> bsub -q 4G -o rmapbs.stdout -e rmapbs.stderr "
/work3/LSLNGSDNAMETH/methpipe-3.3.1/bin/rmapbs-pe
-c /work3/LSLNGSDNAMETH/methpipe-data/data/genome
-o /work3/USERNAME/Output/test.mr
-m 3 -L 400 -C $AdapterTrich:$AdapterArich
/work3/LSLNGSDNAMETH/methpipe-data/data/snippet_1.fq
/work3/LSLNGSDNAMETH/methpipe-data/data/snippet_2.fq"
37
> /work3/LSLNGSDNAMETH/methpipe-3.3.1/bin/rmapbs-pe
Usage: rmapbs-pe [OPTIONS] <fastq-reads-file>
Options:
-o, -output output file name
-c, -chrom chromosomes in FASTA file or dir
-T, -start index of first read to map
-N, -number number of reads to map
-s, -suffix suffix of chrom files (assumes dir provided)
-m, -mismatch maximum allowed mismatches
-M, -max-map maximum allowed mappings for a read
-C, -clip clip the specified adaptor
-L, -fraglen max fragment length
-suffix-len Suffix length of reads name
-v, -verbose print more run info
Help options:
-?, -help print this help message
-about print about message
38.
Example Output of imr90 chrX
38
> head -n30 /work3/LSLNGSDNAMETH/imr90.chrX.mr.dremove |column
MR Format
•RNAME (chromosome name)
•SPOS (start position, 0-based)
•EPOS (end position, 0-based)
•QNAME (read name)
•MISMATCH (number of mismatches)
•STRAND (forward or reverse strand)
•SEQ
•QUAL
39.
Remove Duplicates (Example ONLY)
> export PATH=$PATH:/pkg/biology/methpipe/methpipe-3.3.1/bin/
>bsub -q 16G -o stdout -e stderr "
LC_ALL=C sort -S 14G -k 1,1 -k 2,2n -k 3,3n -k 6,6
-o /work3/USERNAME/h1.chrX.mr.sorted_start
/work3/LSLNGSDNAMETH/h1.chrX.mr;
duplicate-remover -S /work3/USERNAME/h1.chrX_dremove_stat.txt
-o /work3/USERNAME/h1.chrX.mr.dremove
/work3/USERNAME/h1.chrX.mr.sorted_start "
> cat stdout
Successfully completed.
Resource usage summary:
CPU time : 343.80 sec.
Max Processes : 3
Max Threads : 4 39
> cat/work3/USERNAME/h1.chrX_dremove_stat.txt
TOTAL READS IN: 24350707
GOOD BASES IN: 1987943796
TOTAL READS OUT: 22884736
GOOD BASES OUT: 1867152730
DUPLICATES REMOVED: 1465971
READS WITH DUPLICATES: 1219174
R Packages: methylKit
The following examples were adopt from the tutorials of methylKit
• Akalin, A. et al.methylKit: a comprehensive R package for the
analysis of genome-wide DNA methylation profiles. Genome Biol
13, R87, doi:10.1186/gb-2012-13-10-r87 (2012).
• Tutorial:
http://methylkit.googlecode.com/files/methylKitTutorial_feb2012.
pdf
• Tutorial Slide: http://methylkit.googlecode.com/files/
methylKitTutorialSlides_2013.pdf
48
49.
Convert MethPipe mr Format to methylKit
Format
Idchr base strand coverage freqC freqT
Chr21.9764539 chr21 9764539 R 12 25.00 75.00
Chr21.9764513 chr21 9764513 R 12 0.00 100.00
Chr21.9820622 chr21 9820622 F 13 0.00 100.00
Chr21.9837545 chr21 9837545 F 11 0.00 100.00
Chr21.9849022 chr21 9849022 F 124 72.58 27.42
Chr21.9853326 chr21 9853326 F 17 70.59 29.41
49
> awk -F $'t' -v OFS=$'t’ '$6>0{$5=int($5*100); print $1"."$2, $1,
$2, "F", $6, $5, (100-$5)}' /work3/LSLNGSDNAMETH/h1.chrX_CpG.meth >
/work3/USERNAME/Output/h1.chrX_CpG.meth.for.methylKit
> awk -F $'t' -v OFS=$'t' '$6>0{$5=int($5*100); print $1"."$2, $1,
$2, "F", $6, $5, (100-$5)}' /work3/LSLNGSDNAMETH/imr90.chrX_CpG.meth >
/work3/USERNAME/Output/imr90.chrX_CpG.meth.for.methylKit
50.
Read Methylation Files into methylKit Objects
> library(methylKit)
#load methylation files (change to your datasets)
> file.list=list(
system.file("extdata", "test1.myCpG.txt", package = "methylKit"),
system.file("extdata", "test2.myCpG.txt", package = "methylKit"),
system.file("extdata", "control1.myCpG.txt", package = "methylKit"),
system.file("extdata", "control2.myCpG.txt", package = "methylKit") )
# read the files to a methylRawList object: myobj
> myobj=read( file.list, sample.id=list("test1", "test2","ctrl1","ctrl2"),
assembly="hg18",treatment=c(1,1,0,0))
> head(myobj)
50
Get bases covered by all samples and cluster
samples
# merge allsamples to one table by using base-pair locations that are covered in all samples
> meth=unite(myobj)
# cluster all samples using correlation distance and plot hierarchical clustering
> png("cluster.png", width=600, height=600)
> hc = clusterSamples(meth, dist="correlation", method="ward", plot=T)
> dev.off()
> png("pca.png", width=600,height=600)
> PCASamples(meth)
> dev.off()
53
54.
Calculate differential methylation
# calculate differentialmethylation p-values and q-values
> myDiff=calculateDiffMeth(meth)
# get differentially methylated regions with 25% difference and qvalue < 0.01
> myDiff25p=get.methylDiff(myDiff,difference=25,qvalue=0.01)
# get differentially hypo methylated regions with 25% difference and qvalue<0.01
> myDiff25pHypo =get.methylDiff(myDiff,difference=25,qvalue=0.01,type="hypo")
# get differentially hyper methylated regions with 25% difference and qvalue<0.01
> myDiff25pHyper=get.methylDiff(myDiff,difference=25,qvalue=0.01,type="hyper")
54