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!
the colnames of the counts are the colnames of forcountdata:
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...
Oops, I meant to ask about rownames of counts.
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
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