Extract_Top_Markers {scCustomize} | R Documentation |
Extract Top N Marker Genes
Description
Extract vector gene list (or named gene vector) from data.frame results of FindAllMarkers
or similar analysis.
Usage
Extract_Top_Markers(
marker_dataframe,
num_genes = 10,
group_by = "cluster",
rank_by = "avg_log2FC",
gene_column = "gene",
gene_rownames_to_column = FALSE,
data_frame = FALSE,
named_vector = TRUE,
make_unique = FALSE
)
Arguments
marker_dataframe |
data.frame output from |
num_genes |
number of genes per group (e.g., cluster) to include in output list. |
group_by |
column name of |
rank_by |
column name of |
gene_column |
column name of |
gene_rownames_to_column |
logical. Whether gene IDs are stored in rownames and should be moved to column. Default is FALSE. |
data_frame |
Logical, whether or not to return filtered data.frame of the original |
named_vector |
Logical, whether or not to name the vector of gene names that is returned by the function.
If |
make_unique |
Logical, whether an unnamed vector should return only unique values. Default is FALSE.
Not applicable when |
Value
filtered data.frame, vector, or named vector containing gene IDs.
Examples
## Not run:
top10_genes <- Extract_Top_Markers(marker_dataframe = markers_results, num_genes = 10,
group_by = "cluster", rank_by = "avg_log2FC")
## End(Not run)