Editing
Dinh/Dinh 2012/NOTES/2012-3-21
(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!
=Sequence dependent test on HAPMAP data= * Working directory (genome-miner): /home/nplongth/Noi_scratch/ASM_HAPMAP1362-1454_2012_02_03/DD_SequenceDependentTest * Discussed this with Noi and Dr. Zhang Sequence dependent means that there is a consistent preference of methylation on one allele versus another across multiple individuals. * Binomial test * Procedure for the binomial test: 1. Using all data from *cpg.txt file generated from Robert's pipeline (ignoring p-value) 2. Ignore data where the two alleles have exactly the same methylation fraction (no preference) 3. Identify the favored allele in each individual, and increment count for the favored allele at a SNP:CpG set. 4. Do not consider sites where there are more than 2 different favored alleles 5. Let x = the count for the least favored allele 6. Use Math::CDF qw(pbinom) with x, n = number of data, p = probability of preference on allele = 0.5 Null hypothesis is that the sample prefer allele 1 and allele 2 both with probability 0.5 Reject null if the p-value is low (more samples prefer one allele over the other) 7. Accept null if p value is greater than 0.05 (5%) 8. Resulted in 117 SNP:CPG (Sequence dependent ASM) / Tested 71,441 SNP:CPG IMPORTANT UPDATE: As set up before, the binomial test would return p-value = 1 for when all the sites have preference toward 1 allele. Added in line: $p_value = 0 if($p_value == 1); Now the analysis for the Binomial test needs to be repeated. 8. Resulted in 45,022 SNP:CPG (Sequence dependent ASM) / Tested 71,441 SNP:CPG * Command: dinh@genome-miner:/home/nplongth/Noi_scratch/ASM_HAPMAP1362-1454_2012_02_03$ DD_SequenceDependentTest/asmBinomialTest.pl MFASM.QValues-cpg.list.txt > DD_SequenceDependentTest/binomialtest.SequenceDependent * Noi suggested the T-test * Procedure for the t-test: 1. Using all data from *cpg.txt file generated from Robert's pipeline (ignoring p-value) 2. Get the difference in methylation level between the two alleles, making sure that the difference is always relative to the same allele. 3. Require minimum 5 data points 4. Calculate the t-statistic: (mean difference)/SEM (use Statistics::Descriptive) Null hypothesis is that the average of the differences is 0. Reject null if the p-value is low (the average of the differences is not 0) 5. Calculate the p-value using Math::CDF qw(pt) with t-stat, df = number of data - 1, and centered at 0. 6. Accept null if p value is greater than 0.05 (5%) 7. Resulted in 1244 SNP:CPG (Sequence dependent ASM) / Tested 17,525 SNP:CPG * Command: dinh@genome-miner:/home/nplongth/Noi_scratch/ASM_HAPMAP1362-1454_2012_02_03$ DD_SequenceDependentTest/asmTTest.pl MFASM.QValues-cpg.list.txt > DD_SequenceDependentTest/ttest.SequenceDependent ==Gene ontology: GREAT== * Used '''awk''' and '''sort -u''' commands to get BED files of unique CpG sites with sequence dependent ASM. binomialTest.cpgs = 113 (background have 64,030 CpGs) tTest.cpgs = 1187 (background have 16,430 CpGs) * changed chr23/24/25 to chrX/Y/M with '''sed''' * Uploaded BED files to GREAT (default settings) and checked biological process. * Binomial test GO (NOTE: after repeating with bigger 45,022 SNP:CPG set, there are no significant enrichment! *TTest GO [[File:TtestGO.png]] ==Discussion== * Binomial test is too stringent, higher number of data is required for counting while we cannot use data with difference = 0. The t-test allows us to use data with difference = 0. * Ttest is more powerful but have higher false discovery (type I error plus bias when there are outliers) * Binomial test seems to have lower type I error but also lower power. * A larger sample size will perform better with the binomial test. * A larger sample size will allow more sites to pass minimum 5 data points for the t-test. ==Double check Binomial test with OpenOffice Math== {| {{table}} border=1 | align="center" style="background:#f0f0f0;"|'''10:127584276:127584265''' | align="center" style="background:#f0f0f0;"|'''3:2796414:2796339''' | align="center" style="background:#f0f0f0;"|'''17:21220301:21220322''' |- | AG|0.271|0.591||AG|0.786|0.417||CG|0.865|0.000 |- | AG|0.228|0.629||AG|0.562|0.468||CG|0.733|0.000 |- | AG|0.296|0.439||AG|0.906|0.825||CG|0.816|0.027 |- | NA||AG|0.850|0.040||CG|0.455|0.000 |- | AG|0.267|0.613||AG|0.632|0.340||CG|0.600|0.000 |- | AG|0.427|0.513||AG|0.644|0.246||CG|0.125|0.146 |- | AG|0.178|0.534||AG|0.661|0.769||CG|0.688|0.000 |- | AG|0.436|0.548||AG|0.475|0.452||CG|0.784|0.013 |- | AG|0.302|0.706||NA||NA |- | AG|0.145|0.681||AG|0.532|0.529||CG|1.000|0.074 |- | AG|0.411|0.403||NA||CG|0.194|0.000 |- | AG|0.214|0.695||AG|0.842|0.577||CG|0.827|0.012 |- | p=0.005859375||p=0.0107421875||p=0.005859375 |} * First and last SNP:CPG have n=11 and k=1 (n is number of data and k is the least favored allele count) * Middle SNP:CPG have n=10 and k=1 {| {{table}} border = 1 | align="center" style="background:#f0f0f0;"|'''''' | align="center" style="background:#f0f0f0;"|'''n''' | align="center" style="background:#f0f0f0;"|'''11''' | align="center" style="background:#f0f0f0;"|'''10''' |- | ||k||1||1 |- | P(k=0)||0||0.0004882813||0.0009765625 |- | P(k=1)||1||0.0053710938||0.009765625 |- | SUM||---||0.005859375||0.0107421875 |} *probabilities were calculated using: =(FACT(n)/(FACT(k)*FACT(n-k)))*0.5^k*(0.5)^(n-k) ==Double check Ttest with OpenOffice Math== {| {{table}} border=1 | align="center" style="background:#f0f0f0;"|'''4:7319795:7319781''' | align="center" style="background:#f0f0f0;"|'''14:95874397:95874396''' | align="center" style="background:#f0f0f0;"|'''13:38445196:38445195''' |- | NA||NA||TG|0.000|0.714 |- | AG|0.000|0.303||AG|0.000|0.952||TG|0.000|0.700 |- | NA||NA||NA |- | AG|0.750|0.975||AG|0.009|0.981||TG|0.000|0.933 |- | NA||AG|0.005|0.950||TG|0.048|0.867 |- | AG|0.292|0.851||NA||TG|0.000|0.970 |- | NA||AG|0.000|0.947||TG|0.000|0.361 |- | NA||NA||NA |- | NA||NA||NA |- | AG|0.718|0.930||NA||NA |- | AG|0.571|1.000||AG|0.000|0.977||NA |- | NA||NA||NA |- | p=0.039493696||p=1.71390437762721e-07||p=0.009553314 |} *Calculate the differences then t-statistics and pvalue {| {{table}} border=1 | align="center" style="background:#f0f0f0;"|'''''' | align="center" style="background:#f0f0f0;"|'''4:7319795:7319781''' | align="center" style="background:#f0f0f0;"|'''14:95874397:95874396''' | align="center" style="background:#f0f0f0;"|'''13:38445196:38445195''' |- | diff||0.303||0.952||0.714 |- | diff||0.225||0.972||0.7 |- | diff||0.559||0.945||0.933 |- | diff||0.212||0.947||0.819 |- | diff||0.429||0.977||0.97 |- | diff||||||0.361 |- | mean||0.3456||0.9586||0.7495 |- | SEM||0.1472270356||0.0148425065||0.2198933833 |- | T-stat||2.3473949515||64.584778741||3.4084699999 |- | P-value||0.0393695698||1.72149891022281E-007||0.0095374811 |}
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