Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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?

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


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


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


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

          Comment


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


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


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

                Comment


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

                  Comment


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


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


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

                        Comment


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


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


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

                              • seqadmin
                                Strategies for Sequencing Challenging Samples
                                by seqadmin


                                Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
                                03-22-2024, 06:39 AM
                              • seqadmin
                                Techniques and Challenges in Conservation Genomics
                                by seqadmin



                                The field of conservation genomics centers on applying genomics technologies in support of conservation efforts and the preservation of biodiversity. This article features interviews with two researchers who showcase their innovative work and highlight the current state and future of conservation genomics.

                                Avian Conservation
                                Matthew DeSaix, a recent doctoral graduate from Kristen Ruegg’s lab at The University of Colorado, shared that most of his research...
                                03-08-2024, 10:41 AM

                              ad_right_rmr

                              Collapse

                              News

                              Collapse

                              Topics Statistics Last Post
                              Started by seqadmin, Yesterday, 06:37 PM
                              0 responses
                              11 views
                              0 likes
                              Last Post seqadmin  
                              Started by seqadmin, Yesterday, 06:07 PM
                              0 responses
                              10 views
                              0 likes
                              Last Post seqadmin  
                              Started by seqadmin, 03-22-2024, 10:03 AM
                              0 responses
                              51 views
                              0 likes
                              Last Post seqadmin  
                              Started by seqadmin, 03-21-2024, 07:32 AM
                              0 responses
                              68 views
                              0 likes
                              Last Post seqadmin  
                              Working...
                              X