Does readDGE work with data frames?
Hi, I have been trying to make a DGEList out of a dataframe (‘readCounts’) I have imported to Rstudio. The dataframe has 13 columns, one with gene IDs, and twelve with the read counts for each of the genes identified in twelve RNA-seq samples.
The edgeR bio conductor documentation says that
The function readDGE makes a DGEList object directly. If the table of counts is already available as a matrix or a data.frame, x say, then a DGEList object can be made by
y <- DGEList(counts=x)
However, when I try to do that, I get a message back saying
Error in DGEList(counts = readCounts) :
The count matrix is a data.frame instead of a matrix and the first column is of class character
instead of being numeric. Was the first column intended to contain geneids?
This is exactly what the first column was intended to contain, so if I remove the first column with the gene ids, I will have a collection of unidentified read counts, and I’m not sure how I’ll be able to ‘re-connect’ them with their ‘gene of origin.’ Is there a workaround to this problem?
Many thanks in advance!
• 19 views
Read more here: Source link