Hello there,
I am trying to use roast in combination with edgeR glmTreat and an average RPKM filter, but I am not sure how to correctly implement this. Hope someone can help with this.
So our strategy is to use glmTreat for at least 1.5 FC, and subsequently we are only interested in genes that have at least 8 RPKM in at least one group of the pairwise contrast.
My script works as follows:
library(edgeR) DGE1 <- DGEList(counts,group=Group) keep <- rowSums(cpm(DGE1)>1) >= 3 DGE2 <- DGE1[keep,] y1 <- calcNormFactors(DGE2) y <- estimateGLMCommonDisp(y1,design,verbose=TRUE) y <- estimateGLMTrendedDisp(y, design, verbose=TRUE) y <- estimateGLMTagwiseDisp(y, design) fit <- glmFit(y, design) # Treat 1.5FC tr <- glmTreat(fit, contrast=c(-1,0,0,0,0,0,1,0),lfc=log2(1.5)) # Subsequent average RPKM filter RPKM_A <- rowMeans(RPKM[,c(13,21)]) RPKM_B <- rowMeans(RPKM[,c(6,14,22)]) Ave_RPKM <- cbind(RPKM_A, RPKM_B) at_least_RPKM8 <- rownames(Ave_RPKM[Ave_RPKM[,1] > 8 | Ave_RPKM[,2] > 8,]) Top <- topTags(tr,n=length(y1$counts), adjust.method="BH", sort.by="p.value") TopTable <- Top[at_least_RPKM8,]
So I have selected my genes with at least 8 RPKM in one group from my TopTable. And now if I want to go for roast I have to use the fit again, but I don't know how to get the treat 1.5 FC in there nor the > 8 RPKM filter. Can anyone suggest a better way to do this?
# ROAST roast_res <- roast(y,index=geneSet,design=design,contrast=c(-1,0,0,0,0,0,1,0))
Many thanks in advance for your thoughts and ideas!
Ben
Thanks for your explanation and advice, it's really appreciated!
I think I am gonna give roast a try on the raw results then, the ones without TREAT and RPKM filter.