DESeqDataSetFromMatrix error: invalid 'row.names'
0
0
Entering edit mode
3.2 years ago
jschiant • 0

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)

R rna-seq • 2.8k views
ADD COMMENT
0
Entering edit mode

can you post the results of dput(head(countData)) and dput(head(metaData)) here? It's hard to guess what's going wrong without seeing a part of your data.

ADD REPLY
0
Entering edit mode
dput(countData[1:10, 1:10])
Error: Can't subset columns that don't exist.
x Locations 9 and 10 don't exist.
ℹ There are only 8 columns.
ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

So.your count data has 8 columns, and metadata data has information for 6...?

ADD REPLY
0
Entering edit mode

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!!

ADD REPLY
0
Entering edit mode

For the count data you can just do dput(head(countData)) then and edit your post.

ADD REPLY

Login before adding your answer.

Traffic: 2605 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