This is a test version of Biostars. For the public version, visit https://www.biostars.org.
sample-specific filtering of counts matrix

I know I can filter my counts matrix using this command

filtered.counts <- counts[rowSums(counts==0)<3, ]

when I would like to keep genes with counts in more than three samples.

But is there a way to do the same and removes rows from the matrix when this three 0 are in only one condition? I have 2 conditions with each four replica. I would like to filter for genes with counts in at least two of them.

Would this kind of filtering make sense? Or do I create a bias in the expression matrix?

thanks Assa

counts rna-seq deseq2 condition

You could simply use something like FilterByExpr from edgeR.

I would keep the rows (genes) if one condition has all zeros while the rest having non-zero values. Depending on the sequencing depth across different samples/conditions, this gene might simply be under-/over-represented in one condition vs others. And yes, sample-specific filtering might result in biases in the downstream steps.

0 answers

No answers yet.

Log in to answer this question.