DESeqDataSetFromMatrix error
1
0
Entering edit mode
Diya • 0
@ac4dbe6a
Last seen 2.4 years ago
United Kingdom

Hi, I am stuck with starting off with Matrix to DataSet conversion for DESeq analysis. Can you please see what possibly is going wrong?

Thank you.

Code should be placed in three backticks as shown below

Rawcounts_old_retina <- read_csv("Rawcounts old_retina.csv")
View(Rawcounts_old_retina)
readcount_matrix <- as.matrix(read.csv("Rawcounts old_retina.csv"), row.names= ("Genes"))
head(readcount_matrix,1)
Metadata <- data.frame(sample = c( "S7", "S8", "S9", "S10", "S11", "S12"), condition = c("control", "control", "control", "KO", "KO", "KO"), row.names= "sample")
Metadata$condition <- as.factor(Metadata$condition)
countData<- data.frame(readcount_matrix)
countData
all(rownames(Metadata) %in% colnames(countData))
countData<- countData[,-1]
all(rownames(Metadata) == colnames(countData))

problematic code is DESeqDataSetFromMatrix

dds <- DESeqDataSetFromMatrix(countData = countData, colData = Metadata, design= ~condition)

ERROR

Error in DESeqDataSet(se, design = design, ignoreRank) : some values in assay are negative

BiocGenerics DESeq2 DEGreport RNASeqData DEG • 2.1k views
ADD COMMENT
0
Entering edit mode
swbarnes2 ★ 1.4k
@swbarnes2-14086
Last seen 3 days ago
San Diego

Well, what do you think the error means?

ADD COMMENT
0
Entering edit mode

It says some values are negative. But I really cannot spot any negative value. What should I do to rectify this? Any idea?

I filtered csv columns, using 'less than 0' filter. And there were no values below 0. On R, I used: any(countData<0) [1] TRUE

I don't understand the conflict here.

ADD REPLY
0
Entering edit mode

How did you check that there are no negative values?

ADD REPLY
0
Entering edit mode

If you do

any(countData<0) 
[1] TRUE

That means you have some values below zero!

ADD REPLY
0
Entering edit mode

Hi James,

Is there a way to avoid these negative values present in the matrix? Will appreciate some help.

ADD REPLY
1
Entering edit mode

I would first want to know why you have negative values. If they are counts then by definition there should be no values lower than zero. If they aren't counts, then you probably shouldn't be using DESeq2 to model them.

ADD REPLY
0
Entering edit mode

Also, when the instructions say to put code within triple backticks, what that means is you should put a triple backtick on one line, hit Enter, then paste your code, then hit Enter, and then put in another set of three backticks. This is what it looks like when you do that:

z <- rnorm(1000)
zz <- rnorm(10000)

Which looks like a block of code. If you wrap each line separately it looks like this:

z <- rnorm(1000)

zz <- rnorm(10000)

Which is still more legible than what you had previously, but it's pretty janky looking...

ADD REPLY

Login before adding your answer.

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