feature_percent.Rd
Check the Proportion of positive cells (default: expression above 0) in certain clusters
feature_percent(
seu,
feature,
ident = NULL,
group.by = NULL,
DefaultAssay = "RNA",
above = 0,
total = F,
if.expressed = F,
min.pct = 0.1
)
Seurat object
Features to plot (gene expression, metrics, PC scores, anything that can be retreived by FetchData)
cluster name, Default: all clusters
A variable name in meta.data to group by, if you don't want to use default Idents of Seurat object
Assay to use, Default: 'RNA'
Above which value will be considered as positive cell, Default: 0
If to calculate proportion in total cells of selected clusters, Default: F
If only return logical value, Default: F
Minimum fraction of min.pct cells in the cluster will be considered "expressed", only use this parameter when "if.expressed" is set to TRUE. Default: 0.1
A matrix
None.
genes <- VariableFeatures(pbmc)[1:10]
feature_percent(pbmc, feature = genes)
# Count one cell as positive only the expression is above 2
feature_percent(pbmc, feature = genes, above = 2)
# Only check subset of clusters
feature_percent(pbmc, feature = genes, ident = c("B cell", "CD8 T cell"))
# Group by a different variable
feature_percent(pbmc, feature = genes, group.by = "orig.ident")
# Also check the proportion of expressed cells in total clusters
feature_percent(pbmc, feature = genes, total = T)
# only show logical value; 'TRUE' if more than 20% cells are positive
feature_percent(pbmc, feature = genes, if.expressed = T, min.pct = 0.2)