I have generated results from DESeq2 wihch is a S4 type R-object. I want to add new columns to it containing geneNames, contig and start position.
There is method using BioMart to do it, but I won't be using the BioMart method; instead I have the geneDatabase as a textfile,
I have tried merging these two databases by `matching rownames` using merge, cbind, but no success.
- The merge method won't more because it can't bind data.frame to DESeqResults.
- With `cbind` I can't bind because I have differing number of rows. The `DeSeqResults` have less number of rows/rownames because several rows were filtered, but it's rownames are subset of `geneMap` rownames.
I have tried using this and several other methods explained in stackoverflow, but success yet.
> merge(result.ASE_Data, geneMap) Error in as(merge(as(x, "data.frame"), y, ...), class(x)) : no method or default for coercing “data.frame” to “DESeqResults”
> do.call(rbind.fill, list(result.ASE_Data, geneMap)) Error: All inputs to rbind.fill must be data.frames
> do.call(cbind.data.frame, list(result.ASE_Data, geneMap)) Error in data.frame(..., check.names = FALSE) : arguments imply differing number of rows: 1761, 1865
> cbind(result.ASE_Data, geneMap) Error in DataFrame(...) : different row counts implied by arguments
Hi Steve,
I knew about this method, but the problem is that if you convert the
S4-object
usingas.data.frame
you are loosing valuable metadata information that are used downstream in the workflow.Any other ideas.