DESeq error: counts matrix should be numeric, currently it has mode: character
1
0
Entering edit mode
Kucsera • 0
@42f45eeb
Last seen 18 hours ago
United States

Hello guys!

I've been trying to run a DESeq on my RNA seq data, however, when I read in my data and try to run a "DESeqDataSetFromMatrix" the following error pops up. I could really use some help.

#read in counts data
counts_data <- read.csv('forDESeq2.csv')

#for some reason I have gene name duplicates, this eliminates it
rownames(counts_data) <- make.names(counts_data$external_gene_name, unique = TRUE)
counts_data <- counts_data[,-1]
colData <- read.csv('colData.csv', header = TRUE, sep = ",", col.names = 'groups')

#to check whether the rows and columns are the same
all(colnames(counts_data) %in% rownames(colData))
all(colnames(counts_data) == rownames(colData))

#to check whether there is a negative value
any(counts_data < 0)

dds <- DESeqDataSetFromMatrix(countData = counts_data,
                              colData = colData,
                              design = ~ groups)

Any assistance is appreciated!

DESeq2 • 163 views
ADD COMMENT
0
Entering edit mode
ATpoint ★ 4.6k
@atpoint-13662
Last seen 2 days ago
Germany

R thinks your data are characters (e.g. "1", "2", instead of 1, 2) so given that your counts_data indeed only contains counts, do:

mode(counts_data) <- "numeric"

ADD COMMENT
0
Entering edit mode

After applying your suggestion, the following error pops up:

Error in mde(x) : 'list' object cannot be coerced to type 'double'
ADD REPLY

Login before adding your answer.

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