When I'm trying to use the DESeqDataSetFromMatrix function, I'm getting the error:
Error in
.rowNamesDF<-
(x, value = value) : invalid 'row.names' length
Yesterday I successfully ran the function with the exact same file inputs with no problem, but somehow without changing the files at all it has stopped working. I tried restarting R, I checked to make sure the sample names lined up, I tried updating all of my packages. Why is this happening? Below is my code.
countData <- read_csv('thyroid_case_counts.csv')
metaData <- read.csv('rna_clinical_data.tsv', header = TRUE, sep = "")
dds <- DESeqDataSetFromMatrix(countData=countData, colData=metaData, design=~Cluster, tidy = TRUE)
can you post the results of
dput(head(countData))
anddput(head(metaData))
here? It's hard to guess what's going wrong without seeing a part of your data.If I try to convert my first column with the gene names in it to the row names, when I run the dds line it says that my row names have duplicates, because it tries to use the counts of the first samples as the row names
So.your count data has 8 columns, and metadata data has information for 6...?
Ahhh thank you I see what the problem is, the files were formatted correctly but I must have accidentally added in a space without realizing it to the line that converted the gene ID column into the row names. Now it works, thank you!!
For the count data you can just do
dput(head(countData))
then and edit your post.