2013-07-23 92 views
2

我有一個表,這裏的開始:R:如何更改嵌入在nbinomTest()函數中的默認FDR值?

WE1_counts WE2_counts M1_counts M2_counts M3_counts 
YAL008W 465 291 911 926 946 
YBR255W 1040 1357 1428 1304 1112 
YGR131W 95 170 230 113 138 
YNL003ßC 1800 3107 3979 3012 2899 
YBR135W 1094 2143 936 860 561 

的目標是找到條件「W」與「M」之間的差異表達的基因。這裏是我的代碼,這樣做:

source("http://bioconductor.org/biocLite.R") 
biocLite("DESeq") 

library("locfit") 
library("lattice") 
library("DESeq") 

condition= c("W", "W", "M", "M", "M") 
#data = table given above 
cds1 = newCountDataSet(data, condition) 

#Normalization 
cds1=estimateSizeFactors(cds1) 
sizeFactors(cds1) 
head(counts(cds1, normalized=TRUE)) 

#Estimate dispersion 
cds1 = estimateDispersions(cds1) 
dev.new() 
plotDispEsts(cds1) 
head(fData(cds1)) 

# Plotting mean vs log2FoldChange 
res = nbinomTest(cds1, "W", "M") 
dev.new() 
plotMA(res) 

我的問題是這樣的:nbinomTest()函數給了我回來基礎上10%的FDR差異表達的基因。有沒有辦法改變這個數字?我可以在例如5%FDR檢查差異表達的基因嗎?

+0

你的問題是沒有重複的。 '錯誤:找不到函數「newCountDataSet」'。請添加您使用的軟件包。 –

+0

哎呀sry忘了包括他們。該代碼現已完成。 – zfz

回答

0

nbinomTest僅針對多重比較進行調整,然後您自己應用截斷值。

counts(cds1)[which(res$padj < my.fdr),]

如果在另一方面,你wan't來控制截止(具體而言,α\alpha)的FDR過程本身,那麼你可能需要this(have'nt使用壽)

PS:順便說一句,而R中的編碼,請使用考慮使用<-代替=