Is there a way to sort topTags output for up and down regulated genes separately? i.e. I want the top 20 up regulated and top 20 downregulated:
x <- read.delim("counts.txt",row.names="geneid")
group <- factor(c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2))
y <- DGEList(counts=x,group=group)
y <- calcNormFactors(y)
design <- model.matrix(~group)
y <- estimateDisp(y,design)
fit <- glmQLFit(y,design)
qlf <- glmQLFTest(fit,coef=2
topTags(qlf,n=20,sort.by="logFC")
This only gives the upregulated genes. I want the full table of results, not just a gene list. Is there a way to make sort.by sort up and down? Also is there a way to ouput the toptags table as tab delimited instead of the painful spaced table that is printed?
Thanks very much,
S.
Indeed, I would be inclined to do:
This sorts on significance, rather than the log-fold change, which gives you more reliable results.
Also, to elaborate on Ryan's comment, set
sep="\t"
inwrite.table
to get tab-delimited output.