第四次生物统计作业

编程入门 行业动态 更新时间:2024-10-10 21:32:43

第四次生物统计<a href=https://www.elefans.com/category/jswz/34/1771149.html style=作业"/>

第四次生物统计作业

Q1

研究者检测了6位胃癌病人的肿瘤样本和对应的癌旁正常组织样本中的TP53的表达量,试分别用wilcoxon signed-rank test和signed test,检测TP53的表达量在胃癌患者的肿瘤与正常样本中是否存在差异。

 

表1 胃癌患者的肿瘤样本和正常样本中TP53的表达量(FPKM)

肿瘤样本

30.09

18.68

19.90

5.13

39.69

30.87

正常样本

30.25

17.14

25.79

8.64

36.42

31.93

1) Wilcoxon signed-ranktest
> t=c(30.09,18.68,19.90,5.13,39.69,30.87)
> n=c(30.25,17.14,25.79,8.64,36.42,31.93)
> wilcox.test(t,n,paired=TRUE,exact=FALSE)


p>0.05,没有显著差异

1) signed-ranktest
> a=t-n
> a
[1] -0.16  1.54 -5.89 -3.51  3.27 -1.06
> n=6
> c=2
> pvalue=2*pbinom(2,6,0.5)
> pvalue
[1] 0.6875
#样本量大的话近似为正态分布用下面这种。
> miu=(c+0.5-n/2)
> xgm=sqrt(n/4)
> z=miu/xgm
> p=2*pnorm(z)
> p
[1] 0.6830914
p>0.05,没有显著差异


Q2

今测得某单位10名青年男性员工的体脂率和10名中年男性员工的体脂率,如表2,试用wilcoxon rank sum test分析中年男性员工的体脂率是否比青年男性员工的体脂率高?

表2 两组员工的体脂率(%)

青年男性

15

17

21

14

18

16

20

13

20

17

中年男性

20

16

19

18

17

22

21

18

19

16

> x=c(15,17,21,14,18,16,20,13,20,17)
> y=c(20,16,19,18,17,22,21,18,19,16)
> wilcox.test(x,y,exact=FALSE)

p>0.05,没有显著差异

 

Q3:

Alzheimer's Disease (AD) is the most commoncause of dementia, a group of brain disorders that results in the loss ofintellectual and social skills. These changes are severe enough to interferewith day-to-day life. AD is characterized by the presence of senile plaques andneurofibrillary tangles in cortical regions of the brain. These pathologicalmarkers are thought to be responsible for the massive corticalneurodegeneration and concomitant loss of memory, reasoning, and after aberrantbehaviors that are seen in patients with AD.

Here we have a gene expression data fromnormal neurons and neurons containing neurofibrillary tangles of 14 mid-stageAD cases. It can be found in “expression_data.txt”. Column 1-7 of“expression_data.txt” are normal neurons and column 8-14 are neurons withneurofibrillary tangles. Use the information mentioned above to answer thefollowing questions:

a)    Uset-test to find significantly differential expression genes between normal andtangle neuron sample (p-value < 0.01). Give the number of differentialexpressed genes and give the names of top 10 significantly differentialexpression genes.

Hint1: two types of t-test with equalvariance and unequal variance are different.

Hint2: “names()” or “rownames()” can beused to extract names of differentially expressed genes.

Hint3: “apply(data,1,function(x){…})” can apply function to every row in data more quickly than “for{}”, so try to use“apply”.

b)    Adjustthe p-values in question a) with both “bonferroni” and “fdr” method to find differentially expressed genes (adjusted p-value < 0.01). Give the number ofdifferential expressed genes.

Hint: you can do the adjustment accordingto the formula, or use “p.adjust()” instead

a)
> a=read.csv("expression_data.txt",header=TRUE,sep="\t")
> vartest=apply(a,1,function(x){var.test(x[1:7],x[8:14])$p.value})
> data=cbind(a,vartest)
> ttest=apply(data,1,function(x){
+     if(x[15]>=0.05){
+         t.test(x[1:7],x[8:14],var.equal=T)$p.value}
+     else{t.test(x[1:7],x[8:14],var.equal=F)$p.value}})
> diff=ttest[which(ttest<0.01)]
> length(diff)
[1] 2124
> diffsort=sort(diff,decreasing = FALSE)
> names(diffsort)[1:10][1] "TECPR2"       "ZMAT2"        "NT5DC3"       "SIN3A"        "HYOU1"        "UBE2Z"        "SDR39U1"     [8] "GNL2"         "VIPAS39"      "LOC100505584"
有2124个基因差异表达显著。其中最高的10个是"TECPR2", "ZMAT2", "NT5DC3", "SIN3A", "HYOU1", "UBE2Z", "SDR39U1", "GNL2", "VIPAS39", "LOC100505584"
 
b)
> aj1=p.adjust(ttest,method = "fdr")
> ajj1=which(aj1<=0.01)
> length(ajj1)
[1] 1049> aj2=p.adjust(ttest,method = "bonferroni")
> ajj2=which(aj2<=0.01)
> length(ajj2)
[1] 364

用FDR和Bonferroni校正p值分别有1049个和364个基因差异表达。

更多推荐

第四次生物统计作业

本文发布于:2024-03-12 23:39:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1732690.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:作业   第四次   生物

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!