, annotation=None, *, fraction=0.65, filter_genes=None, filter_samples=None)

Calculate marker pairs of genes. [Scialdone15] [Fechtner18].

Calculates the pairs of genes serving as marker pairs for each phase, based on a matrix of gene counts and an annotation of known phases.

This reproduces the approach of [Scialdone15] in the implementation of [Fechtner18].

More information and bug reports here.

adata : AnnData

The annotated data matrix.

annotation : Optional[Mapping[str, Collection[Union[str, int, bool]]]] (default: None)

Mapping from category to genes, e.g. {'phase': [Gene1, ...]}. Defaults to data.vars['category'].

fraction : float (default: 0.65)

Fraction of cells per category where marker criteria must be satisfied.

filter_genes : Optional[Collection[Union[str, int, bool]]] (default: None)

Genes for sampling the reference set. Defaults to all genes.

filter_samples : Optional[Collection[Union[str, int, bool]]] (default: None)

Cells for sampling the reference set. Defaults to all samples.

Return type

Dict[str, List[Tuple[str, str]]]


A dict mapping from category to lists of marker pairs, e.g.: {'Category_1': [(Gene_1, Gene_2), ...], ...}.


>>> from import sandbag
>>> from pypairs import datasets
>>> adata = datasets.leng15()
>>> marker_pairs = sandbag(adata, fraction=0.5)