NA values of count matrix in class DESeqDataSet
1
0
Entering edit mode
maleknias • 0
@maleknias-14032
Last seen 3.6 years ago

Dear all

Hi

I downloaded a data set in class "RangedSummarizedExperiment" from "https://jhubiostatistics.shinyapps.io/recount/". I want to find differential expression genes. My code is :

load("~/Downloads/rse_gene.Rdata")

class(rse_gene)

[1] "RangedSummarizedExperiment"

attr(,"package")

[1] "SummarizedExperiment"

>data=colData(rse_gene)

>names= names(colData(rse_gene))

>write.table(data,file="colData.csv", col.names=names,sep="\t",row.names=FALSE)

>data1=fread("~/Downloads/colData.txt")

>colData(rse_gene) =DataFrame(data1)

>colData(rse_gene)$disease.status = as.factor(colData(rse_gene)$disease.status)

>dds <- DESeqDataSet(rse_gene, design = ~ disease.status)

converting counts to integer mode Error in validObject(.Object) :

invalid class “DESeqDataSet” object: NA values are not allowed in the count matrix In addition: Warning message: In mde(x) : NAs introduced by coercion to integer range

I use two solution for this problem but both of them were useless:

1- Keep only rows with non-zero counts:

>rse_gene <- rse_gene[rowSums(assay(rse_gene)) != 0, ]

2- Replace the NA value by -9 :

>countdata <- assay(rse_gene)

>replace(countdata,countdata==0,-9)

>coldata <- colData(rse_gene)

>ddsMat <- DESeqDataSetFromMatrix(countData = countdata, colData = coldata, design = ~ disease.status)

I will be appreciate if any one can help me!!

rna-seq recount • 1.2k views
ADD COMMENT
0
Entering edit mode

Hi,

Please post code for reproducing the error and the R session information you have. Thanks.

Also, why are you writing the colData() information to a text file and then reading it back into R? Are you editing the colData() information outside R?

Best, Leonardo

ADD REPLY
0
Entering edit mode

Hi,

I just wanted to check in and see if you've resolved this question. If not, please post a reproducible example so I and others can help you.

Best, Leonardo

ADD REPLY
1
Entering edit mode
Amit ▴ 10
@f8ae0436
Last seen 19 days ago
Netherlands

I got trapped in a similar problem but found a solution by myself. In my case, extra space after count matrix data was the reason for this problem, after deleting those spaces until the last value of count matrix data my problem was solved.

ADD COMMENT
0
Entering edit mode

Nice, thanks for the answer!

Best, Leo

ADD REPLY

Login before adding your answer.

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