[BioC] Help needed with topGene function of RankProd package
Steve Lianoglou
mailinglist.honeypot at gmail.com
Wed Sep 7 04:04:43 CEST 2011
Hi,
On Tue, Sep 6, 2011 at 8:48 PM, Gaurav Kumar <gaurav.kumar at mq.edu.au> wrote:
> Hello,
>
> I'm using RankProd package to see the differential gene expression in
> two class of samples
> as given below:
>
> library(RankProd)
> RP.out <- RP(matrix,class.label,logged=TRUE,num.perm=100,rand=123)
> #print(RP.out)
> gene.list <- topGene(RP.out,gene.names=rownames(matrix),
> logged=TRUE,logbase=2,cutoff=0.05,method="pfp", num.gene=100)
> upRegulated <- file("./test.txt", open="wt")
> writeLines(gene.list$Table1,upRegulated)
> close(upRegulated)
>
> I can see the $Table1 result in R console but i can't print the same
> as an output file,
> showing
> Error in writeLines(gene.list$Table1, upRegulated) :
> invalid 'text' argument
It seems gene.list$Table1 is a matrix, with rownames having gene id's
in some fashion (I'm going from the example code in ?topGene)
I'd turn this into a data.frame and add a gene.id column to it, then
write it out "as usual." Let's say the result of topGene() is stored
in a var called gene.list, eg:
R> x1 <- transform(as.data.frame(gene.list$Table1),
gene.id=rownames(gene.list$Table1))
R> write.table(x1, '~/top.gene.1.txt', sep="\t", quote=FALSE, row.names=FALSE)
You should have the txt file in your home directory after that.
HTH,
-steve
--
Steve Lianoglou
Graduate Student: Computational Systems Biology
| Memorial Sloan-Kettering Cancer Center
| Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact
More information about the Bioconductor
mailing list