# DESEQ2:Error in rownames, what is the problem?

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


Thanks

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

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.

• 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. Nov 1, 2020 at 17:52
• 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. Nov 1, 2020 at 18:23
• Thank you, TIL. Nov 1, 2020 at 21:14