Removing rows (countData) from a DESeq Object
1
0
Entering edit mode
Bine ▴ 10
@bine-23912
Last seen 27 days ago

Dear knowledgeable people,

I am having some issues manipulating my DESeq Object, it is not so easy as it as with a dataframe.

Basically all what I want to do is is to remove certain genes from the countData and the corresponding rows from the colData.

Has anyone an idea how I can do this? Select and all this does not to work on this object..

Thank you very much, Bine

DESeq2 • 123 views
1
Entering edit mode
ATpoint ▴ 570
@atpoint-13662
Last seen 1 hour ago
Germany

The DESeqDataSet is basically a SummarizedExperiment, so standard subsetting operations apply. The crux of SE is that you do not have to manually filter the different slots. If you remove want to keep like the first three samples do dds[,1:3], the colData will be filtered automatically. Same goes for rows and rowData. Note that remove certain genes from the countData and the corresponding rows from the colData does not make sense as colData refers to columns (so usually the samples) and "genes" usually refers to rows, so filtering genes has no effect on the colData. An example of what you want to do would help together with code and errors that you encounter.

0
Entering edit mode

Thank you very much. Sry for not explaining it clearly enough. It is great that the colData will be filtered automatically.

What I want to do is I found that out of 50.000 genes only 15.000 pass my filter.

Actually the easiest way for me to keep working with the data would be to view these 15.000 genes.

So I have now my new DESeq Object with 15.000 genes:

# Apply Filter

keep <- rowSums(counts(dds0)> 1 >= 100 dds0 <- dds0[keep,]

View(dds0) doesnt work, and view(cts) shows me the 50.000 genes from before.

Is there an option to view countData of dds0 (new) ?

1
Entering edit mode

View(dds0) doesnt work

Yes, that is expected. The DESeqDataSet is a container, not a specific assay itself so you first have to access the assay.

Is there an option to view countData of dds0 (new) ?

View(counts(dds0))


http://bioconductor.org/packages/release/bioc/vignettes/SummarizedExperiment/inst/doc/SummarizedExperiment.html

0
Entering edit mode

Thank you I will check this documentation!