This is a test version of Biostars. For the public version, visit https://www.biostars.org.
DESeq2

Hi people I get error in this code:

rawdata <- read.csv("data.csv",
                    header = TRUE,row.names = 1, stringsAsFactors = FALSE,
                    check.names = F) #rawdata is a count matrix

metadata <- read.table("Clinical.txt", header = TRUE, row.names = 1, stringsAsFactors = TRUE) #metadata is a table of samples' information


library(Biobase)
library(GenomicRanges)
library(tibble)
library(dplyr)
install.packages("BiocManager")

BiocManager::install("SummarizedExperiment")

se <- SummarizedExperiment(rawdata)
colData(se) <- DataFrame(metadata)
library(DESeq2)
dds <- DESeqDataSet( se, design = ~ 1 )  ##this gives error 



 error is: renaming the first element in assays to 'counts'
    Error in DESeqDataSet(se, design = ~1) : 
  counts matrix should be numeric, currently it has mode: list
rna-seq

The error is already stated clearly:

counts matrix should be numeric, currently it has mode: list

It appears that your first file is not in proper format, but tough to tell for sure without seeing at least several lines from each input file.

I think with each question your goal should be to give us as much information as possible, as that will cut down on time for follow-up questions and answers.

I'm closing/deleting this question as it's already being addressed in another thread. Please stop spamming the forum with multiple threads addressing the same problem, or your account will be suspended.

EDIT: I apologize, the answerer in the other thread asked you explicitly to open a new question, and I did not see that part. I especially apologize for the remark on suspension and take it back.

1 answer

Try using a dedicated converter function:

dds <- as(se, "DESeqDataSet")

Log in to answer this question.