I have a dds object in DEseq2 and I wanted to do row means filtering on my object. I have 30 total samples, therefore I have 30 total columns in the count table. I'd like to filter all read counts lower than 30 for each treatment (for rows 1-15 and rows 16-30). I've tried the following code:

    keep = rowMeans(counts(dds[,c(1:15,16:30)])) >=30
    dds_30=dds[keep,]

but I do not think this is working. Would anybody be able to help?




I'm not sure what your `dds` variable looks like, but this should work judging by your current code.

    dds_30 <- dds[rowMeans(counts(dds)[, 1:15]) >= 30 & rowMeans(counts(dds)[, 16:30]) >= 30, ]