- dynamo.tl.top_n_markers(adata, with_moran_i=False, group_by='test_group', sort_by='specificity', sort_order='decreasing', top_n_genes=5, exp_frac_thresh=0.1, log2_fc_thresh=None, qval_thresh=0.05, specificity_thresh=0.3, only_gene_list=False, display=True)
Filter cluster deg (Moran’s I test) results and retrieve top markers for each cluster.
AnnData) – an AnnData object.
bool) – whether to include Moran’s I test results for selecting top marker genes. Defaults to False.
str) – column name or names to group by. Defaults to “test_group”.
'decreasing']) – whether to sort the data frame with increasing or decreasing order. Defaults to “decreasing”.
int) – the number of top sorted markers. Defaults to 5.
float) – the minimum percentage of cells with expression for a gene to proceed selection of top markers. Defaults to 0.1.
float]) – the minimal threshold of log2 fold change for a gene to proceed selection of top markers. Applicable to none velocity, acceleration or curvature layers based DEGs. Defaults to None.
float) – the maximal threshold of qval to be considered as top markers. Defaults to 0.05.
float) – the minimum threshold of specificity to be considered as top markers. Defaults to 0.3.
bool) – whether to only return the gene list for each cluster. Defaults to False.
bool) – whether to print the data frame for the top marker genes after the filtering. Defaults to True.
ValueError – threshold too extreme that no genes passed the filter.
- Return type:
If only_gene_list is false, a data frame that stores the top marker for each group would be returned. Otherwise, a list containing lists of genes in each cluster would be returned. In addition, it will display the data frame depending on whether display is set to be True.