Rlimma包GEO多晶元差異基因分析

2021-10-24 15:54:59 字數 3486 閱讀 5504

geo多晶元差異基因分析時候出現以下錯誤:error in rt[as.vector(diffsig[, 1]), ] :

only 0』s may be mixed with negative subscripts。合併了兩個資料,資料數值都小於10,應該是已經取了log的。但是為什麼會出現這個情況,求大神告知!!!!!!!!

logfoldchange=

1> adjustp=

0.05

>

> library(limma)

> setwd(

"c:\\users\\acer\\desktop\\degs\\07.diff"

)> rt=read.table(

"normalize.txt"

,sep=

"\t"

,header=t,check.names=f)

> rt=as.matrix(rt)

> rownames(rt)

=rt[,1

]> exp=rt[,2

:ncol(rt)

]> dimnames=list(rownames(exp)

,colnames(exp)

)> rt=matrix(as.numeric(as.matrix(exp)

),nrow=nrow(exp)

,dimnames=dimnames)

>

>

#differential

> modtype=c(rep(

"normal",6

),rep(

"endometrium",6

),rep(

"normal",4

),rep(

"endometrium",4

),rep(

"normal",9

),rep(

"endometrium",9

))> design <- model.matrix(~0

+factor(modtype)

)> colnames(design)

<- c(

"con"

,"treat"

)> fit <- lmfit(rt,design)

> cont.matrix<-makecontrasts(treat-con,levels=design)

> fit2 <- contrasts.fit(fit, cont.matrix)

> fit2 <- ebayes(fit2)

>

> alldiff=toptable(fit2,adjust=

'fdr'

,number=

200000

)> write.table(alldiff,file=

"limmatab.xls"

,sep=

"\t"

,quote=f,row.names=f)

>

>

#write table

> diffsig <- alldiff[with(alldiff,

(abs(logfc)

>logfoldchange & adj.p.val < adjustp )),

]> write.table(diffsig,file=

"diff.xls"

,sep=

"\t"

,quote=f,row.names=f)

> diffup <- alldiff[with(alldiff,

(logfc>logfoldchange & adj.p.val < adjustp )),

]> write.table(diffup,file=

"up.xls"

,sep=

"\t"

,quote=f,row.names=f)

> diffdown <- alldiff[with(alldiff,

(logfc<

(-logfoldchange)

& adj.p.val < adjustp )),

]> write.table(diffdown,file=

"down.xls"

,sep=

"\t"

,quote=f,row.names=f)

>

>

#write expression level of diff gene

> hmexp=rt[as.vector(diffsig[,1

]),]

**error in rt[as.vector(diffsig[,1

]),]

: only 0's may be mixed with negative subscripts*

*> diffexp=rbind(id=colnames(hmexp)

,hmexp) 找不到物件

> write.table(diffexp,file=

"diffexp.txt"

,sep=

"\t"

,quote=f,col.names=f) 找不到物件

>

>

#volcano

> pdf(file=

"vol.pdf"

)> xmax=max(

-log10(alldiff$adj.p.val)

)> ymax=max(abs(alldiff$logfc)

)> plot(

-log10(alldiff$adj.p.val)

, alldiff$logfc, xlab=

"-log10(adj.p.val)"

,ylab=

"logfc"

,+ main=

"volcano"

, xlim=c(

0,xmax)

,ylim=c(

-ymax,ymax)

,yaxs=

"i",pch=

20, cex=

0.8)

> diffsub=subset(alldiff, adj.p.vallogfoldchange)

> points(

-log10(diffsub$adj.p.val)

, diffsub$logfc, pch=

20, col=

"red"

,cex=

0.8)

> diffsub=subset(alldiff, adj.p.val(-logfoldchange)

)> points(

-log10(diffsub$adj.p.val)

, diffsub$logfc, pch=

20, col=

"green"

,cex=

0.8)

> abline(h=

0,lty=

2,lwd=3)

> dev.off(

)

一種常規的四芯或多芯排線的線序檢測電路

下面直接上原理圖 由圖可知,四芯排線由紅 綠 藍 黑四根線組成。4芯線兩端分別固定在專用的夾具上。第一路紅線兩端電阻分別是r5和r9都是330歐姆。p10 p11 p12 p13分別是4路ad分壓想好採集。當沒有導線接入時,p10到p13採集到的電壓均為0v,即四路都不導通。當四路連線線都導通時,p...

多繼承 模組和包

多繼承 1.為什麼使用多繼承?為了隔離多個維度的變化 2.同名方法解析順序?繼承列表從左向右 廣度優先 class a def func01 self print a func01 class b a def func01 self print b func01 建立d物件,執行c 建立b物件,執行...

Go 多檔案程式設計,包

src main.go 主函式所在的檔案 package main 主函式必須在main包中 多檔案程式設計,可以通過命令列進行編譯 go build main.go myfunc.go 將多個檔案當成乙個整體進行編譯 go build src 多檔案程式設計,將指定目錄下的所有檔案整體進行編譯 f...