Unconfigured Ad

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

    #1

    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
                                Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
                                by SEQadmin2



                                Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

                                Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
                                ...
                                10-14-2026, 09:55 AM
                              • SEQadmin2
                                New Genomics Technologies Take Aim at Long-Standing Limits
                                by SEQadmin2


                                Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

                                We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
                                ...
                                09-28-2026, 10:25 AM

                              ad_right_rmr

                              Collapse

                              News

                              Collapse

                              Topics Statistics Last Post
                              Started by SEQadmin2, 10-22-2026, 11:13 AM
                              0 responses
                              26 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 10-22-2026, 10:48 AM
                              0 responses
                              20 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 10-15-2026, 10:52 AM
                              0 responses
                              36 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 10-14-2026, 05:39 AM
                              0 responses
                              43 views
                              0 reactions
                              Last Post SEQadmin2  
                              Working...