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?


  • $\begingroup$ 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. ... $\endgroup$
    – M__
    Commented Oct 31, 2020 at 15:25
  • $\begingroup$ Please edit your question to include the output of dput(head(data)). thanks $\endgroup$
    – user438383
    Commented Oct 31, 2020 at 18:49

1 Answer 1


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().


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.

  • $\begingroup$ 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. $\endgroup$
    – Ram RS
    Commented Nov 1, 2020 at 17:52
  • $\begingroup$ 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. $\endgroup$ Commented Nov 1, 2020 at 18:23
  • $\begingroup$ Thank you, TIL. $\endgroup$
    – Ram RS
    Commented Nov 1, 2020 at 21:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.