Error in .rowNamesDF<-(x, value = value) :duplicate row.names are not allowed DESeq2
1
1
Entering edit mode
corellig ▴ 10
@corellig-23789
Last seen 4.4 years ago

Hallo, I am working with DeSeq2 package. When I am trying to create the DeSeq matrix needed for starting the analysis, I get this error:

Error in `.rowNamesDF<-`(x, value = value) :duplicate 'row.names' are not allowed

even if online I found other posts with this problem, the solutions did not help me. When I do any(duplicated(rownames(x)))for both tables used for ColData and CountData, I get FALSE

In addition to the error I also get a warning message

In addition: Warning message:
non-unique values when setting 'row.names': ‘0’, ‘1’, ‘10’, ‘100’, ‘101’, ‘102’, ‘103’, ‘104’, ‘105’, ‘106’, ...

Here is my script:

       library(limma) 
       library(edgeR)
       library(DESeq2)
       library(ggplot2)
       library(dplyr)

    forcountdata<-read.csv("/home/student/Desktop/gene_read_counts_table_all_final_no_gene_name.csv",header=T,sep="", row.names = 1)

    colnames(forcountdata)<-c("Col0.1", "Tbl29.1","Max4.1","TM.1","Col0.2","Tbl29.2","Max4.2","TM.2","Col0.3","Tbl29.3","Max4.3","TM.3")

    metadata<-read.table("/home/student/Desktop/metadata.csv", header=T, sep=",")

    rownames(metadata)<-c("Col0.1", "Tbl29.1","Max4.1","TM.1", "Col0.2","Tbl29.2","Max4.2","TM.2","Col0.3","Tbl29.3","Max4.3","TM.3")

    rownames(metadata)==colnames(forcountdata)
    fourcountdata<-as.matrix(forcountdata)

    dds <- DESeqDataSetFromMatrix(forcountdata,
                              colData = metadata, design=(~Condition), tidy=TRUE) #Condition is inside metadata and is a column name

    any(duplicated(rownames(metadata)))
    any(duplicated(rownames(forcountdata)))

Thank you in advance!

deseq2 rownames • 5.4k views
ADD COMMENT
0
Entering edit mode

the colnames of the counts are the colnames of forcountdata:

colnames(forcountdata)<-c("Col0.1", "Tbl29.1","Max4.1","TM.1","Col0.2","Tbl29.2","Max4.2","TM.2","Col0.3","Tbl29.3","Max4.3","TM.3")

that must be the same names of the rownames of the metadata table (colnames CountData == rownames ColData), according to what DESeq tutorials/instructions say.

I do not really understand the warning message... because the rownames are not repeated as this warning says... And it counts from 1 to 10 to 100 and then it goes on and I do not understand that

The rownames of fourcountdata are the gene names from the gene library:AT1G01040, AT1G01046, etc...

ADD REPLY
0
Entering edit mode

Oops, I meant to ask about rownames of counts.

ADD REPLY
0
Entering edit mode

Hi! Any updates on this Michael Love? I have the same problem. If I use a count matrix with the gene names (row names) in the first column it runs, but I'm not sure if the results are accurate. I'm using R version 4.0.5 and deseq2 version 1.30.1

ADD REPLY
0
Entering edit mode

I never heard back from the original poster after asking about rownames.

Maybe make a new post and see the posting guidelines about providing code:

http://bioconductor.org/help/support/posting-guide/#composing

ADD REPLY
0
Entering edit mode
@mikelove
Last seen 3 days ago
United States

What are the colnames of the counts? It looks like the warning is giving you a clue what is going on.

ADD COMMENT
0
Entering edit mode

My advice is to keep looking around at these objects, R is just telling you that you have an issue with the rownames and you should be able to find it with some sleuthing.

One thing i saw in your code is a typo:

    fourcountdata<-as.matrix(forcountdata)

did you mean to put a u there? then you don't end up using the matrix version when you pass to DESeqDataSetFromMatrix

ADD REPLY

Login before adding your answer.

Traffic: 827 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6