Search a reduction for observations (e.g. traits) that match a given term
(case-insensitive substring search).
Then get the factors with the highest mean loading for the matching features.
get_top_factors( obj, metadata = NULL, reduction = NULL, term, search_col = "label_phe", n_quantiles = 10, select_quantiles = n_quantiles, plot_hist = FALSE, verbose = TRUE )
obj | Seurat object or dimensionality reduction object. |
---|---|
metadata | Phenotype metadata.
Not needed if |
reduction | Which reduction to extract from.
Only used if |
term | Term with which to perform substring search of observations. |
search_col | Which column in the observation metadata to perform substring search. |
n_quantiles | How many quantiles to bin factor loadings into. |
select_quantiles | Which quantiles to return. Defaults to the top quantile only. |
plot_hist | Whether to plot the distribution of loadings. |
verbose | Print messages. |
data.table
data("DEGAS_seurat") top_factors <- get_top_factors( obj = DEGAS_seurat, term = "parkinson", select_quantiles = 8:10 )#>#>#> #>