Confused by percent_top purpose in scanpy.pp.calculate_qc_metrics

Hi! As I am a beginner at utilizing scanpy, I would like for someone to better help me understand the purpose of percent_top when calculating qc metrics. How can adding a percent_top argument change my preprocessing vs. when not added?

percent_top specifies how many of the most highly expressed genes should be used to calculate cumulative count percentages for each cell. For example, percent_top=[50] creates a metric showing what percentage of a cell’s total counts comes from its 50 most highly expressed genes. A high value indicates that the library is dominated by a relatively small number of genes, which may help identify low-complexity or otherwise unusual cells, although the appropriate interpretation depends on the cell type and dataset.

Importantly, percent_top does not remove genes or cells and does not directly modify the expression matrix. It only adds QC metrics to adata.obs. It changes downstream preprocessing only if you subsequently use those metrics to filter cells.

Also, omitting the argument is different from setting percent_top=None. If the argument is omitted, Scanpy uses its default values, currently (50, 100, 200, 500). Setting it to None disables the calculation of these top-gene percentage metrics.