100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > TCGA数据库ceRNA网络构建(二)差异分析

TCGA数据库ceRNA网络构建(二)差异分析

时间:2020-06-10 16:21:50

相关推荐

TCGA数据库ceRNA网络构建(二)差异分析

在下载好TCGA的mRNA,lncRNA和miRNA的表达谱数据后,首先需要对他们进行差异分析:主要是使用R语言的edgeR包来做

#首先设置筛选条件

foldChange=2

padj=0.01

#设置工作目录

setwd("")

#加载edgeR包

library(“edgeR”)

#读取文件

rt=read.table(“mRNA_symbol.txt”,sep="\t",header=T,check.names=F)

#转化

rt=as.matrix(rt)

#设置行名

rownames(rt)=rt[,1]

#将表达数据单独存入变量exp

exp=rt[,2:ncol(rt)]

dimnames=list(rownames(exp),colnames(exp))

data=matrix(as.numeric(as.matrix(exp)),nrow=nrow(exp),dimnames=dimnames)

#将相同的ID取均值

data=avereps(data)

#过滤

data=data[rowMeans(data)>1,]

#设置分组,一组为正常组有3个样本,一组为肿瘤组有306个样本

group=c(rep(“normal”,3),rep(“tumor”,306))

design <- model.matrix(~group)

y <- DGEList(counts=data,group=group)

y <- calcNormFactors(y)

y <- estimateCommonDisp(y)

y <- estimateTagwiseDisp(y)

et <- exactTest(y,pair = c(“normal”,“tumor”))

topTags(et)

ordered_tags <- topTags(et, n=100000)

allDiff=ordered_tags t a b l e a l l D i f f = a l l D i f f [ i s . n a ( a l l D i f f table allDiff=allDiff[is.na(allDiff tableallDiff=allDiff[is.na(allDiffFDR)==FALSE,]

diff=allDiff

newData=y$pseudo.counts

write.table(diff,file=“edgerOut.xls”,sep="\t",quote=F)

diffSig = diff[(diffKaTeX parse error: Expected 'EOF', got '&' at position 12: FDR < padj &̲ (difflogFC>foldChange | diffKaTeX parse error: Expected 'EOF', got '\t' at position 70: …fSig.xls",sep="\̲t̲",quote=F) diff…FDR < padj & (diffKaTeX parse error: Expected 'EOF', got '\t' at position 61: …="up.xls",sep="\̲t̲",quote=F) diff…FDR < padj & (diff$logFC<(-foldChange))),]

write.table(diffDown, file=“down.xls”,sep="\t",quote=F)

normalizeExp=rbind(id=colnames(newData),newData)

#输出所有基因校正后的表达值(normalizeExp.txt)

write.table(normalizeExp,file=“normalizeExp.txt”,sep="\t",quote=F,col.names=F)

diffExp=rbind(id=colnames(newData),newData[rownames(diffSig),])

#输出差异基因校正后的表达值(diffmRNAExp.txt)

write.table(diffExp,file=“diffmRNAExp.txt”,sep="\t",quote=F,col.names=F)

#筛选差异的结果,后面利用差异的结果建ceRNA网络

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。