Removal of outliers after library size correction, can I save this to my dds object?
Entering edit mode
Moose123 • 0
Last seen 3.6 years ago


I looked for an answer but could not find it.. My supervisor replaced values of outliers in our expression data set to "NA", using the count data that is corrected for library size (means median-of-ratios). As we want to use the same processing steps, we want to assign these outliers also in my work (network analysis). 

Is it possible to insert the identified outliers also in the dds object at the same step in DESeq2 (so after dds = estimateSizeFactors(dds))?  In other words, could I assign these outlying values as NA in the count matrix and save this to the dds, so I could work further with it when I transform my data for network analysis? Or should I assign the NAs to the count matrix before creating the dds object? (I plan to use the k-nearest neighbour method after to replace the NAs.)

Thanks a lot,


deseq2 outliers • 318 views
Entering edit mode
Last seen 1 day ago
United States

You can't have NAs in the DESeqDataSet. So you'll have to keep track of them somehow yourself. You can add arbitrary matrices to the dataset though:

assays(dds)[["outlier"]] <- mat

Where mat could be a logical matrix. DESeq2 won't pay attention to this matrix, but you can use it for your own purposes. Another direction is that if you want to remove outliers on your own, you can downweight them. DESeq2 does pay attention to assays(dds)[["weights"]]. You can put in 0's here and this will downweight these counts so they don't contribute to the fitting procedures.


Login before adding your answer.

Traffic: 418 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6