mantispy.tl.percent_replicating

mantispy.tl.percent_replicating#

mantispy.tl.percent_replicating(adata, groupby='Metadata_Perturbation', metric='pearson', use_rep=None, null_size=10000, quantile=0.95, seed=0, key_added='percent_replicating', copy=False)#

Median replicate correlation against a non-replicate null.

An older readout, largely replaced by mAP. It thresholds rather than ranks, and it depends on the number of replicates per perturbation. It is included because many published results report it.

Parameters:
  • adata (AnnData) – Well-level profiles with several replicates per group.

  • groupby (str (default: 'Metadata_Perturbation')) – Column whose groups are the replicate sets.

  • metric (str (default: 'pearson')) – Similarity between profiles, one of METRICS.

  • use_rep (str | None (default: None)) – Score obsm[use_rep] instead of X.

  • null_size (int (default: 10000)) – Number of draws in the non-replicate null.

  • quantile (float (default: 0.95)) – Quantile of the null medians a group has to beat to count as replicating.

  • seed (int (default: 0)) – Seed for the null draws.

  • key_added (str (default: 'percent_replicating')) – Name for the outputs.

  • copy (bool (default: False)) – Return a modified copy instead of mutating in place.

Return type:

AnnData | None

Returns:

None, or the modified copy. Writes uns["mantispy"][key_added] with group, n_replicates, median_replicate_correlation, null_threshold and is_replicating, leaving out groups with a single replicate. Writes uns["mantispy"][key_added + "_summary"] with fraction_replicating and n_groups.