New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
filter out/subset features #4958
Comments
Hi, To calculate what percentage of cells express each gene, you could do something like this.
However, you can not filter out certain genes unless you create a new Seurat object, like this.
Depending on what your downstream analysis is, it might be possible to select features without creating a new Seurat object. For example, the FindMarkers() command has a features argument that you can use to perform DE only on the genes you choose. |
That's very clear. Thanks |
Hi mhkowalski, The idea is very clear and applicable to my analysis. Appreciate! Do you mind to explain more about the functions of "rowMeans(counts>0)"? It seems like it calculates the mean counts of a feature among selected cells (counts>0), but not the ratio of the cells with its expression. Sorry, I am new to R and please let me know if I am wrong with my understanding. thanks Leon |
counts>0 returns a matrix where each entry is TRUE/FALSE if that entry of the counts matrix exceeds 0. Performing rowMeans on that matrix gives you for each gene the number of cells with a count > 0 divided by total # of cells, which is the percent of cells expressing a gene. |
Awesome, that perfectly solved my issue. Thanks so much for your help! Leon |
Dear authors, Is there a recommend threshold for the filter? Say 5% or 10% or others instead of 1% of genes.percent.expression? Thank you very much! |
Hi All,
The function of "CreateSeuratObject" filters out low quality of cells and features from the raw data set.
For a specific purpose, I do not want to create a new object but would like to filter out some low distributed features in the down-stream analysis.
Are there any suggestions to do so? Is that possible to calculate the percentage of cells with a specific feature expression so that we can do subset based on that? Any suggestion would be highly appreciated.
thanks
Best,
Leon
The text was updated successfully, but these errors were encountered: