Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Schisto
    Junior Member
    • May 2016
    • 3

    DEseq2 - some values in assay are negative

    Dear all,

    I am a first time DEseq2 user, and I am already stuck with importing my dataset.

    My RNAseq data has been going through the Hisat2 - StringTie pipeline and I have created a gene counts file using the python script provided with StringTie.

    As far as I can tell, my gene count data set looks just fine, except that there is something weird going on with negative values, and I have no idea what.

    I am trying to import the data into DEseq2 with the DESeqDataSetFromMatrix function.

    Here's a step-by-step version of what I have done so far:

    # Import data file that contains gene counts
    countdata <- as.matrix(read_excel("DEseqcounts.xlsx"),header=TRUE)
    # take row names from the first column
    rownames(countdata) <- countdata[ , 1]
    # first column is now duplicated, so remove
    countdata <- countdata[,-1]

    # Import data file that contains phenotype data in columns
    coldata=as.matrix(read_excel("coldata.xlsx"),header=TRUE)
    # take row names from the first column
    rownames(coldata) <- coldata[ , 1]
    # first column is now duplicated, so remove
    coldata <- coldata[,-1]

    (I have visually checked that the files are imported correctly, and I can't seem to find anything that looks wrong)

    I would like to run the DESeqDataSetFromMatrix as follows:

    DESeqDataSetFromMatrix(countData = countdata, colData = coldata, design = ~ treatment, tidy = FALSE, ignoreRank = FALSE)

    which returns this error message:
    Error in DESeqDataSet(se, design = design, ignoreRank) : some values in assay are negative

    Indeed, there seem to be values in my "countdata" object that are somehow classified as negative:

    countdata["" < 0] omitted 1280373 entries, which look like this:

    [1] " 0" " 0" " 0" " 0" " 5" " 0" " 26" " 104" " 10" " 24"
    [11] " 22" " 3" " 22" " 0" " 226" " 0" " 152" " 2" " 153" " 178"
    [21] " 0" " 2" " 427" " 153" " 0" " 475" " 0" " 0" " 16" " 101"
    [31] " 78" " 26" " 71" " 372" " 35" " 17" " 108" " 100" " 43" " 0"

    I have no ideas where that comes from. I couldn't find any negative, empty or NA cells in my count data file, nor are there any spaces in the cells.

    Does anyone have a solution, or an idea on what went wrong?

    Any help is highly appreciated,

    Thanks so much!
  • dpryan
    Devon Ryan
    • Jul 2011
    • 3478

    #2
    It looks like you have an extra space in front of all of your numbers and that's screwing everything up. Fix how the values are imported and ensure they're actually numbers and not strings.

    Comment

    • Michael.Ante
      Senior Member
      • Oct 2011
      • 127

      #3
      I'm not so familiar with the stringtie pipeline, but I recommend avoiding Excel for most NGS related analyses (see Zeeberg et al. 2004: Mistaken Identifiers: Gene name errors can be introduced inadvertently when using Excel in bioinformatics)

      Can you use the python script to get simple csv/tsv output?
      [Update]
      The prepDE.py script produces csv files. Import these directly R; any selection and computation you've done with Excel can be done there as well.
      Last edited by Michael.Ante; 11-29-2016, 12:15 AM.

      Comment

      • Schisto
        Junior Member
        • May 2016
        • 3

        #4
        I have double checked and there is no extra space in each of my cells,
        that is actually the reason I later saved this file as excel.

        The python script gives me the gene counts in csv format, I have of course tried that too and it gives the same error.

        Using the same file in edgeR for example works without issues.

        Comment

        • Michael.Ante
          Senior Member
          • Oct 2011
          • 127

          #5
          Try as a first solution:
          countdata <- as.matrix(read_excel("DEseqcounts.xlsx"),header=TRUE, row.names=1)

          And check then
          summary(is.numeric(countdata[,1]))

          Maybe there are some empty lines at the end, which lead to the fact that R is reading it as factors rather than numbers. This can be checked by tail(countdata) .

          Comment

          • Schisto
            Junior Member
            • May 2016
            • 3

            #6
            The class of countdata[,1] is "character"

            summary(is.numeric(countdata[,1]))
            Mode FALSE NA's
            logical 1 0

            class(countdata[,1])
            [1] "character"

            That should be the issue I guess?

            Thanks for your help!

            Comment

            Latest Articles

            Collapse

            • SEQadmin2
              Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
              by SEQadmin2


              Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

              The systematic characterization of the human proteome has
              ...
              07-20-2026, 11:48 AM
            • SEQadmin2
              Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
              by SEQadmin2



              Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
              ...
              07-09-2026, 11:10 AM
            • SEQadmin2
              Cancer Drug Resistance: The Lingering Barrier to Rising Survival
              by SEQadmin2



              Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

              There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
              07-08-2026, 05:17 AM

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by SEQadmin2, 07-24-2026, 12:17 PM
            0 responses
            25 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 07-23-2026, 11:41 AM
            0 responses
            20 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 07-20-2026, 11:10 AM
            0 responses
            28 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 07-13-2026, 10:26 AM
            0 responses
            38 views
            0 reactions
            Last Post SEQadmin2  
            Working...