How can I correct this error in creating DGElist Object???
> library(edgeR)
> y <- DGEList(counts=rawdata[,4:9], genes=rawdata[,1:3])
## Error in colSums(counts) : 'x' must be numeric
How can I correct this error in creating DGElist Object???
> library(edgeR)
> y <- DGEList(counts=rawdata[,4:9], genes=rawdata[,1:3])
## Error in colSums(counts) : 'x' must be numeric
Well, the error message pretty much tells you what the problem is. The raw data you are inputting to DGEList
as counts contain entries that are not numbers. This might occur, for example, if rawdata
is a data.frame that you have read from a file and the file contains annotation columns as well as counts. The code you are using assumes that the first 3 columns are annotation but apparently you actually have more than 3 annotation columns.
I am guessing that you have copied code from page 44 of the edgeR User's Guide. It is good that you are using the example case study as a guide for your own analysis, but you have to adapt the code to your own data rather than use it verbatim. If your data has more than 3 columns of annotation, then you have to change the column numbers appropriately.
Having a look at rawdata
would immediately show which columns are counts and which are not. You have chosen not to respond to my question of 13 hours ago but I encourage you to have a closer look at your data input yourself even if you don't want to show it on a public web site.
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Can you please run the following command and show us the output: