Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • lynn012
    Junior Member
    • Sep 2010
    • 9

    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?
  • chadn737
    Senior Member
    • Jan 2009
    • 392

    #2
    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.

    Comment

    • kopi-o
      Senior Member
      • Feb 2008
      • 319

      #3
      (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.

      Comment

      • jwfoley
        Senior Member
        • Jun 2009
        • 183

        #4
        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.

        Comment

        • lynn012
          Junior Member
          • Sep 2010
          • 9

          #5
          kopi-o,
          Thank you very much!
          That means I should make my data integers.

          Comment

          • ksullivan
            Junior Member
            • Jan 2013
            • 1

            #6
            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!

            Comment

            • rajarapupriya
              Member
              • Oct 2013
              • 18

              #7
              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

              Comment

              • dpryan
                Devon Ryan
                • Jul 2011
                • 3478

                #8
                Just apply() is.numeric() to the rows to determine which one or ones aren't working.

                Comment

                • rajarapupriya
                  Member
                  • Oct 2013
                  • 18

                  #9
                  Hi Devon, Thanks for your quick reply. But, just wondering if the command is "is.numeric()"

                  Comment

                  • dpryan
                    Devon Ryan
                    • Jul 2011
                    • 3478

                    #10
                    Yeah, it is. Just type "help(is.numeric)" for details. Something like
                    Code:
                    which(apply(ExpCountTable, 1, is.numeric) == F)
                    will probably work.

                    Comment

                    • rajarapupriya
                      Member
                      • Oct 2013
                      • 18

                      #11
                      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.

                      Comment

                      • dpryan
                        Devon Ryan
                        • Jul 2011
                        • 3478

                        #12
                        Of course row and column names will never be numeric, that's not relevant to anything.

                        Comment

                        • rajarapupriya
                          Member
                          • Oct 2013
                          • 18

                          #13
                          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

                          Comment

                          • varenkardz
                            Junior Member
                            • Feb 2015
                            • 2

                            #14
                            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:
                            Last edited by varenkardz; 03-20-2015, 11:58 AM.

                            Comment

                            • dpryan
                              Devon Ryan
                              • Jul 2011
                              • 3478

                              #15
                              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))

                              Comment

                              Latest Articles

                              Collapse

                              • SEQadmin2
                                From Collection to Sequencing: Why Sample Preparation and Preservation Define Sequencing Data
                                by SEQadmin2


                                Data variability is still an issue in sequencing technologies despite the advances in reproducibility and accuracy of these platforms. But the problem does not originate in the sequencing itself, but in the previous steps, before the sample reaches the sequencer.


                                The first step is collection, followed by preservation and sample preparation for analysis. Most scientists overlook those steps, but not being careful might just be skewing the experiment’s results.
                                ...
                                06-02-2026, 10:05 AM
                              • SEQadmin2
                                Single-Cell Sequencing at an Inflection Point: Early Impacts of New Platforms and Emerging Trends
                                by SEQadmin2


                                With the launch of new single-cell sequencing platforms in 2026, the field stands at an exciting inflection point. This article surveys the most impactful advances in the field and discusses how they’re reshaping research in cancer, immunology, and beyond.


                                Introduction

                                Single-cell sequencing technologies have undergone remarkable advances over the past decade, transitioning from low-throughput experimental approaches to highly scalable platforms capable of...
                                05-22-2026, 06:42 AM
                              • SEQadmin2
                                Environmental Genomics in the Age of NGS: From Microbes to Conservation Strategies
                                by SEQadmin2

                                Studying ecosystems means dealing with complex, multi-species communities that are hard to observe at scale. This complexity, however, hides many important questions to be answered, from how biogeochemical cycles work and how climate change can affect species distribution to how conservation strategies can work best.


                                Genomics, particularly since the expansion of NGS, has transformed ecosystem ecology. By sequencing environmental DNA, we can now assess biodiversity without direct...
                                05-06-2026, 09:04 AM

                              ad_right_rmr

                              Collapse

                              News

                              Collapse

                              Topics Statistics Last Post
                              Started by SEQadmin2, Today, 08:59 AM
                              0 responses
                              7 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 06-02-2026, 12:03 PM
                              0 responses
                              21 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 06-02-2026, 11:40 AM
                              0 responses
                              14 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 05-28-2026, 11:40 AM
                              0 responses
                              29 views
                              0 reactions
                              Last Post SEQadmin2  
                              Working...