DeSEq2-- error- count matrix
1
0
Entering edit mode
@bcc3ae4b
Last seen 15 days ago
United States

dataset <- DESeqDataSetFromMatrix(countData = countData,
+                                   colData = colData,
+                                   design = ~condition)
*Error in DESeqDataSet(se, design = design, ignoreRank) :
counts matrix should be numeric, currently it has mode: character*


And here is the code I am running :

if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")

BiocManager::install("DESeq2")
library('DESeq2')
library('RColorBrewer')
countFilePath = './count-1.txt'
countData = read.table(file = countFilePath, header = FALSE, sep = '\t', row.names = 1,stringsAsFactors=FALSE)
##make first row the colname
colnames(countData) <- countData[1,]
countData <- countData[-1, ]

##if needed to remove some columes countData = countData[3:ncol(countData)]
dim(countData)
colFilePath = './colname-Jul12.txt'
colData = read.table(file = colFilePath, header = TRUE, sep = ' ', row.names = 1)
colData[['condition']] =  factor(colData[['condition']], levels = c('Water', '130','160'))
colData
dataset <- DESeqDataSetFromMatrix(countData = countData,
colData = colData,
design = ~condition)


Anybody can help me here?

Thank you so much Sali

DESeq2 • 109 views
0
Entering edit mode

Since the software is complaining about the content of CountData, you don't think it might be helpful to show people a little of your countData? Since the software is complaining that your CountData isn't numerical, don't you think you should show how you checked to make sure that it was all numerical?

0
Entering edit mode
@mikelove
Last seen 2 days ago
United States

You need to examine countData as swbarnes2 suggests. It is currently a table of character value data, but needs to be numeric data.

One way to avoid this would be to specify header=TRUE when reading in the data, so R recognizes the data as entirely numeric values. Note that read.delim has header=TRUE by default:

You may want to get some basic R help from bioinformatic collaborators first.