SEQanswers

Go Back   SEQanswers > Applications Forums > RNA Sequencing



Similar Threads
Thread Thread Starter Forum Replies Last Post
DESeq without replicates austinpa Bioinformatics 43 07-15-2014 06:38 PM
DESeq problems janec Bioinformatics 17 08-05-2013 04:44 AM
DESeq different version elisadouzi Bioinformatics 0 10-03-2011 01:10 PM
DESeq package(1.5.24) elisadouzi Bioinformatics 1 10-01-2011 02:02 AM
DESeq: publications crh Bioinformatics 1 12-18-2010 09:58 PM

Reply
 
Thread Tools
Old 10-19-2011, 05:03 AM   #1
lynn012
Junior Member
 
Location: china

Join Date: Sep 2010
Posts: 9
Default DESeq-newCountDataSet

When I use DESeq, I don't seem to be able to get the newCountDataSet to work. I get this error:
> cds <- newCountDataSet(mydata,conds)
Error in round(countData) : Non-numeric argument to mathematical function

> head(mydata)
V1 V2 V3
1 zhu1_Ghi#S28631427 8.9990205 10.5918948
2 zhu1_Ghi#S28631527 0.4181748 0.3937552
3 zhu1_Ghi#S28631546 7.4275293 24.3262365
4 zhu1_Ghi#S28631624 11.5885114 9.8558116
5 zhu1_Ghi#S28631691 0.8391944 10.7992493
6 zhu1_Ghi#S28631709 3.8783566 4.2137042

> str(mydata)
'data.frame': 18634 obs. of 3 variables:
$ V1: Factor w/ 18634 levels "zhu1_Ghi#S28631416",..: 2 4 5 6 7 8 9 10 11 12 ...
$ V2: num 8.999 0.418 7.428 11.589 0.839 ...
$ V3: num 10.592 0.394 24.326 9.856 10.799 ...

How can I solve this problem?
lynn012 is offline   Reply With Quote
Old 10-19-2011, 07:08 AM   #2
chadn737
Senior Member
 
Location: US

Join Date: Jan 2009
Posts: 392
Default

I am not certain, but my guess is that the problem is how you named your gene-name column. V1 is probably not a good choice when your other columns are named V2 and V3. DESeq is probably thinking V1 is a sample. Try renaming that column to something else.
chadn737 is offline   Reply With Quote
Old 10-19-2011, 07:33 AM   #3
kopi-o
Senior Member
 
Location: Stockholm, Sweden

Join Date: Feb 2008
Posts: 319
Default

(1) You're supposed to feed DESeq integer counts. (this doesn't answer your question, I'm just saying)

(2) Your first column is not numeric, so it can't be a count, and DESeq correctly protests. What you want is probably

cds <- newCountDataSet(mydata[,2:3],conds)

Or, better yet, when you import your data into R, use something like

mydata <- read.table(myfile, row.names=1)

Then your rows will be named according to what is now in the first column, and columns 1 and 2 will be numeric.

But again, you may be doing this wrong because DESeq works with counts, not fractions.
kopi-o is offline   Reply With Quote
Old 10-19-2011, 01:42 PM   #4
jwfoley
Senior Member
 
Location: Stanford

Join Date: Jun 2009
Posts: 181
Default

DESeq is missing an appropriate error message but that's what it does when your input data are not formatted correctly. None of the variables in your input are integers, but all of them need to be.
jwfoley is offline   Reply With Quote
Old 10-19-2011, 11:21 PM   #5
lynn012
Junior Member
 
Location: china

Join Date: Sep 2010
Posts: 9
Default

kopi-o,
Thank you very much!
That means I should make my data integers.
lynn012 is offline   Reply With Quote
Old 08-01-2013, 06:15 AM   #6
ksullivan
Junior Member
 
Location: Colorado

Join Date: Jan 2013
Posts: 1
Default

I have previously had success using DESeq, but have recently run into the error message:
Error in round(countData) : non-numeric argument to mathematical function

What I have used looks like this:

> datafile <- "DMSO_Exp3_Single_ID.txt"
> ExpCountTable = read.table (datafile, header=TRUE, row.names=1)
> head (ExpCountTable)
DMSO1 DMSO2 DMSO3 Exp3_1 Exp3_2 Exp3_3
ID0000000001 1871 680 869 839 276 421
ID0000000002 171 4 195 140 131 215
ID0000000003 0 0 0 4 35 0
ID0000000004 4 65 126 179 52 105
ID0000000005 612 566 967 733 452 263
ID0000000006 0 0 0 1 0 0
> ExpDesign = data.frame(row.names = colnames(ExpCountTable), condition = c("DMSO1", "DMSO2", "DMSO3", "Explin24h1", "Explin24h2", "Explin24h3"), libType = c("single-end", "single-end", "single-end", "single-end", "single-end", "single-end") )
> ExpDesign
condition libType
DMSO1 DMSO1 single-end
DMSO2 DMSO2 single-end
DMSO3 DMSO3 single-end
Exp3_1 Explin24h1 single-end
Exp3_2 Explin24h2 single-end
Exp3_3 Explin24h3 single-end
> condition = factor (c("untreated", "untreated", "untreated", "treated", "treated", "treated"))
> cds = newCountDataSet(ExpCountTable,condition)
Error in round(countData) : non-numeric argument to mathematical function

Any help would be greatly appreciated!
ksullivan is offline   Reply With Quote
Old 01-17-2014, 07:12 AM   #7
rajarapupriya
Member
 
Location: OH, USA

Join Date: Oct 2013
Posts: 18
Default

I have the same issue and I've also worked previously with DESeq. I checked if my text file has any empty rows or columns, but of no use. Any suggestions would be greatly appreciated.
Thanks
rajarapupriya is offline   Reply With Quote
Old 01-17-2014, 07:24 AM   #8
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480
Default

Just apply() is.numeric() to the rows to determine which one or ones aren't working.
dpryan is offline   Reply With Quote
Old 01-17-2014, 07:28 AM   #9
rajarapupriya
Member
 
Location: OH, USA

Join Date: Oct 2013
Posts: 18
Default

Hi Devon, Thanks for your quick reply. But, just wondering if the command is "is.numeric()"
rajarapupriya is offline   Reply With Quote
Old 01-17-2014, 07:32 AM   #10
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480
Default

Yeah, it is. Just type "help(is.numeric)" for details. Something like
Code:
which(apply(ExpCountTable, 1, is.numeric) == F)
will probably work.
dpryan is offline   Reply With Quote
Old 01-17-2014, 07:34 AM   #11
rajarapupriya
Member
 
Location: OH, USA

Join Date: Oct 2013
Posts: 18
Default

Hi Devon,

> is.numeric(rownames(counts))
[1] FALSE
> is.numeric(colnames(counts))
[1] FALSE
Here is the output for the command. I guess, my dataframe is right as my first row and column have row names and column names.
rajarapupriya is offline   Reply With Quote
Old 01-17-2014, 07:40 AM   #12
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480
Default

Of course row and column names will never be numeric, that's not relevant to anything.
dpryan is offline   Reply With Quote
Old 01-17-2014, 07:41 AM   #13
rajarapupriya
Member
 
Location: OH, USA

Join Date: Oct 2013
Posts: 18
Default

Yayy !! It worked. I was giving the wrong order of dataframe and input file in cds command line. Thanks a lot for your time Devon !!
Priya
rajarapupriya is offline   Reply With Quote
Old 03-20-2015, 11:55 AM   #14
varenkardz
Junior Member
 
Location: Baltimore,MD

Join Date: Feb 2015
Posts: 2
Default

Hi I am having the same issue!
(ddsMat <- DESeqDataSetFromMatrix(countData =test4 ,colData = sampleTable,design = ~Cell ))
Error in round(assay(se)) : non-numeric argument to mathematical function

> dim(test4)
[1] 25368 136
> dim(sampleTable)
[1] 136 4
This is not a fault of rownames which I have checked.

I essentially have a counts data frame from featurecounts (Rsubread) and its giving me the error seen above.....
Does anyone know how I can check input counts file "test4", find if it needs reformating and how to fix it.

I found this person with similar problem:
http://cbtngs.blogspot.com/

Last edited by varenkardz; 03-20-2015 at 11:58 AM.
varenkardz is offline   Reply With Quote
Old 03-21-2015, 09:00 AM   #15
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480
Default

You probably have an NA somewhere or you somehow have strings in one column. A quick way to check would be to:

Code:
class(test4)
table(is.na(test4))
dpryan is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 12:13 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO