Dear R users,
I want to perform a GSEA on RNA-seq data, I use the filterbyexp() function in the DGELlist in edgeR.
I am not sure about hte arguments I use : I would like to keep all genes with an expression of at least 10 cpm in 10% of samples.
Is it
filterbyexp(DGElistobject, min.count = 10, min.prop = 0.1)
?
It keeps almost the same number of gene sthan the default filter which is I think min.count = 10, min.prop = 0.7
min.count is a threshold for actual counts rather than cpm. If you want to filter genes based on their cpm values, you may need to take into account the library sizes and get an equivalent cut-off for min.count. E.g., if the average library size of all the samples is about 20 million, then 10 cpm would be equivalent to min.count = 200.
The arguments are already set to optimal values for differential expression analyses so you don't need to change them at all.
The only thing you need to do is to make sure that you specify the design of your experiment, either by setting the group variable of your DGEList or specifying the design or group arguments to filterByExpr().
Since you only have 1 sample in DonorD_01, your Gene_X will not be filtered if it exceeds the CPM cut-off in at least 1 sample. In a typical RNA-seq dataset, a read count of 345 is large enough to pass the CPM threshold.
I used
filterByExpr
with the design parameter. I have 7 donors and paired samples (Condition = {KO, WT}, except for Donor 1)Count matrix:
This gene is odd because it's only expressed in one sample, but it's still kept by
filterByExpr()
. What is the minimum number of samples by default?You probably need to print out your
design
here for us to see where the problem might be.Thanks for your reply. I have edited my initial post
Since you only have 1 sample in
DonorD_01
, yourGene_X
will not be filtered if it exceeds the CPM cut-off in at least 1 sample. In a typical RNA-seq dataset, a read count of 345 is large enough to pass the CPM threshold.