abagen.keep_stable_genes¶
- abagen.keep_stable_genes(expression, threshold=0.9, percentile=True, rank=True, return_stability=False)[source]¶
Removes genes in expression with differential stability < threshold
Calculates the similarity of gene expression across brain regions for every pair of donors in expression. Similarity is averaged across donor pairs and genes whose mean similarity falls below threshold are removed.
- Parameters
expression (list of (R, G) pandas.DataFrame) – Where each entry is the microarray expression of R regions across G genes for a given donor
threshold ([0, 1] float, optional) – Minimum required average similarity (e.g, correlation) across donors for a gene to be retained. Default: 0.1
percentile (bool, optional) – Whether to treat threshold as a percentile instead of an absolute cutoff. For example, threshold=0.9 and percentile=True would retain only those genes with a differential stability in the top 10% of all genes, whereas percentile=False would retain only those genes with differential stability > 0.9. Default: True
rank (bool, optional) – Whether to calculate similarity as Spearman correlation instead of Pearson correlation. Default: True
return_stability (bool, optional) – Whether to return stability estimates for each gene in addition to expression data. Default: False
- Returns
expression (list of (R, Gr) pandas.DataFrame) – Microarray expression for R regions across Gr genes, where Gr is the number of retained genes
stability ((G,) numpy.ndarray) – Stability (average correlation) of each gene across pairs of donors. Only returned if
return_stability=True