Editing
Dinh/Dinh 2012/NOTES/2012-1-26
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Applied HMM== * install R package "RHmm" * Let the hiddden states be UMR, LMR, and HMR for a sequence of CpG sites * Let the observed sequence be the fractional methylation level (0-1) * Let the emission probability be a normal distribution with mean and standard deviation for each state. * First, to build the HMM, the '''Baum-Welch''' algorithm is used to estimate the transition and emission probabilities myFit = HMMFit(obs=myObs, nStates=3, control=list(verbose=1, init="KMEANS"), asymptCov=TRUE, asymptMethod='optim') **To better build the model, I will use estimates from the entire chromosome 20 and from multiple tissue types. sort -k2,2n /home/nplongth/Noi_scratch/HMM-LMRs_2012_01_25/wgbs.BED/h1.wgbs.chro20.BED.txt | awk '{print $2"\t"$4}' > h1.seq (repeat for other tissue types, then remove the first header line for every *.seq file). **R script to run HMM: [[File:calculateHMM.R.txt]] **First start R with increased ppsize to avoid stack overflow error. R --max-ppsize=500000 **Then run: >source("calculateHMM.R") **Outputs from R: [[File:calculateHMM.Rout.txt]]]] **Script to create BED files: [[File:combineStatesandPos.txt]] ./combineStatesandPos.pl ads.seq ads.states | sed 's/S1/HMR/g' | sed 's/S2/LMR/g' | sed 's/S3/UMR/g' | sed 's/C1/210,0,0/g' | sed 's/C2/120,120,0/g' | sed 's/C3/0,240,0/g' > ads.combo.BED Result from genome browser: track: ads.seq = HMM track, with bright green (UMR), dark green (LMR), and red (HMR) track: Sample = CpG methylation level green (0) to red (1) [[File:hmm_ads.png]]
Summary:
Please note that all contributions to ZhangLabWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
ZhangLabWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main Page
Current events
Recent changes
Random page
Investigators
Matt Cai
Song Chen
Eric Chu
Dinh Diep
Elizabeth Duong
Shicheng Guo
Alan Fung
Daniel Jacobsen
Blue Lake
Huy Lam
Alice Li
Andrew Richards
Brandon Sos
Chris Wei
Yan Wu
Kun Zhang
Tools
What links here
Related changes
Special pages
Page information