API

Import Monkeybread as:

import monkeybread as mb

Calculations: calc

calc.cell_contact(adata, groupby, group1, group2)

Detects contact between two groups of cells.

calc.cell_transcript_proximity(adata, cells)

Detects transcripts in proximity or inside a given list of cells.

calc.kernel_density(adata[, groupby, ...])

Calculates kernel density estimation on large cell quantities.

calc.shortest_distances(adata, groupby, ...)

Calculates the distance from each cell in one group to the nearest cell in another group.

calc.neighborhood_profile(adata, groupby[, ...])

Calculates a neighborhood profile for each cell.

calc.ligand_receptor_score(adata, contacts, ...)

Calculates scores for ligand-receptor pairs in contacting cells.

Plotting: plot

plot.cell_contact_embedding(adata, contacts)

Shows embeddings of cells in contact.

plot.cell_contact_histplot(adata, groupby, ...)

Plots a histogram highlighting the observed cell contact compared to permutations.

plot.cell_contact_heatmap(adata, groupby[, ...])

Produces a heatmap highlighting cell contact between groups in a pairwise manner.

plot.cell_transcript_proximity(adata, cells)

Plots cell boundaries and optionally transcripts in the surrounding area.

plot.kernel_density(adata, key[, spot_size, ...])

Plots the results of monkeybread.calc.kernel_density() using scanpy.pl.embedding().

plot.shortest_distances(distances[, ...])

Plots the results of shortest distances calculations in histogram format.

plot.embedding_filter(adata, mask[, group, ...])

Shows a filtered embedding, allowing for examination of specific cells.

plot.embedding_zoom(adata[, left_pct, ...])

Shows embeddings of cells in contact with zoomed focus.

plot.ligand_receptor_scatter(actual_scores, ...)

Plots a scatterplot highlighting the observed ligand-receptor scores and significance.

Statistical Tests: stat

stat.cell_contact(adata, groupby, group1, ...)

Calculates expected cell contact and p-value using a permutation test.

stat.shortest_distances(adata, groupby, ...)

Calculates an expected distribution of shortest distances via permutation of labels.

stat.ligand_receptor_score(adata, contacts, ...)

Calculates statistical significance of ligand-receptor pairs in contacting cells.

Utility Functions: util

util.load_merscope([folder, use_cache, ...])

Loads data from MERSCOPE, in accordance to the folder structure of the FFPE data release.

util.randomize_positions(adata, radius[, ...])

Randomizes positions within a given radius.

util.subset_cells(adata, by, subset[, ...])

Subsets cells based on gene expression and optionally labels them.

util.contact_count(contacts, group1, group2)

Counts contact observed by monkeybread.calc.cell_contact().