Answers.Body: <p>The hint is here:</p>
  <p><code>duplicate 'row.names' are not allowed</code></p>
  <p><code>rownames(data)</code> should return a vector of only unique values, since it doesn't make sense to have the same gene/transcript in two different rows of your count matrix. How did you generate it?</p>
  <p>What does <code>which(duplicated(rownames(data)))</code> return? Maybe that'll give you a hint on what went wrong. In general, if you use <code>salmon</code> or <code>kallisto</code> for counting, you should use the excellent <code>tximport</code> package to get the counts into R, then create a DESeq dataset with <code>DESeqDataSetFromTximport()</code>.</p>
  <p>EDITS:</p>
  <p>The replies to my answer prompted me to re-read your post and I saw that you had set <code>tidy=TRUE</code>, which means the duplicates are actually in your first column of your <code>data</code>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-01T17:52:01.757Z
Answers.Text: I thought along the same lines, but `data` cannot have duplicate `row.names` - no object can have duplicate `row.names`, so this is some generated object that is being assigned duplicate row names owing to something wrong with `data` or `labelData` that has nothing to do with the row names of either object.
Answers.UserDisplayName: Ram RS
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-01T18:23:57.017Z
Answers.Text: Of course, they can. Here's a oneliner for you: `m <- matrix(0, nrow=3, ncol=3, dimnames=list(c('a', 'a', 'a'), c('b', 'b', 'b')))`. Anyway, I tried and DESeq2 handles this case semi-gracefully by appending numbers to the dupes. However, @Athanasia had set `tidy=TRUE`, which prompts DESeq2 to look for row names in the first column of the input, where duplicates trigger an error. I can post an MRE for this exact behavior if you'd like.
Answers.UserDisplayName: Bastian Schiffthaler
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-01T21:14:42.783Z
Answers.Text: Thank you, TIL.
Answers.UserDisplayName: Ram RS
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-31T19:10:05.693Z
Answers.LastActivityDate: 2020-11-01T18:21:06.297Z
Answers.LastEditDate: 2020-11-01T18:21:06.297Z
Answers.UserDisplayName: Bastian Schiffthaler
Body: <p>I am using DESEQ2 for RNAseq analysis but i do not understand why I get this error.</p>
  <pre><code>&gt; dds &lt;- DESeqDataSetFromMatrix(countData = data, 
  +                               colData = labeldata, 
  +                               design =~ subtype, tidy = TRUE)
  
  **Error** in `.rowNamesDF&lt;-`(x, value = value) : 
    duplicate 'row.names' are not allowed
  </code></pre>
  <p>I really do not know what is the issue. Could you please help?</p>
  <p>Thanks</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-10-31T15:25:02.550Z
Comments.Text: Hi @athanasia and thansk for your post. Members here do experience of DESEQ2 for transformation (I don't) and whilst the information could be enough, it is etiquette to provide as much detail as you can. For example, your data, size dimension, runs etc. ...
Comments.UserDisplayName: M__
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-10-31T18:49:58.237Z
Comments.Text: Please edit your question to include the output of ``dput(head(data))``. thanks
Comments.UserDisplayName: user438383
Tags: <r><rna-seq>
Title: DESEQ2:Error in rownames, what is the problem?
ThreadText: # DESEQ2:Error in rownames, what is the problem?
  
  (Asked by: username_0 on 2020-10-31)
  
  I am using DESEQ2 for RNAseq analysis but i do not understand why I get this error.
  
  ```
  > dds <- DESeqDataSetFromMatrix(countData = data, 
  +                               colData = labeldata, 
  +                               design =~ subtype, tidy = TRUE)
  
  **Error** in `.rowNamesDF<-`(x, value = value) : 
    duplicate 'row.names' are not allowed
  
  ```
  
  I really do not know what is the issue. Could you please help?
  
  Thanks
  
  **Tags:** r, rna-seq
  
  > **Comments:**
  > **username_1**: Hi @athanasia and thansk for your post. Members here do experience of DESEQ2 for transformation (I don't) and whilst the information could be enough, it is etiquette to provide as much detail as you can. For example, your data, size dimension, runs etc. ...  
  > **username_2**: Please edit your question to include the output of ``dput(head(data))``. thanks  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2020-10-31. Score: 3
  
  The hint is here:
  
  `duplicate 'row.names' are not allowed`
  
  `rownames(data)` should return a vector of only unique values, since it doesn't make sense to have the same gene/transcript in two different rows of your count matrix. How did you generate it?
  
  What does `which(duplicated(rownames(data)))` return? Maybe that'll give you a hint on what went wrong. In general, if you use `salmon` or `kallisto` for counting, you should use the excellent `tximport` package to get the counts into R, then create a DESeq dataset with `DESeqDataSetFromTximport()`.
  
  EDITS:
  
  The replies to my answer prompted me to re-read your post and I saw that you had set `tidy=TRUE`, which means the duplicates are actually in your first column of your `data`.
  
  > **Comments:**
  > **username_4**: I thought along the same lines, but `data` cannot have duplicate `row.names` - no object can have duplicate `row.names`, so this is some generated object that is being assigned duplicate row names owing to something wrong with `data` or `labelData` that has nothing to do with the row names of either object.  
  > **username_3**: Of course, they can. Here's a oneliner for you: `m <- matrix(0, nrow=3, ncol=3, dimnames=list(c('a', 'a', 'a'), c('b', 'b', 'b')))`. Anyway, I tried and DESeq2 handles this case semi-gracefully by appending numbers to the dupes. However, @Athanasia had set `tidy=TRUE`, which prompts DESeq2 to look for row names in the first column of the input, where duplicates trigger an error. I can post an MRE for this exact behavior if you'd like.  
  > **username_4**: Thank you, TIL.  
  
  ---
  
  