mmc.density_plot_total()

mmochi.landmarking.density_plot_total(adata, marker, batch, batch_key=utils.BATCH_KEY, data_key=utils.DATA_KEY, bw_adjust=0, step=0.1, weights=None)

Plots density of a single marker on a single batch in front of the density of this marker for the whole dataset. Creates density plot of a single batch for a single marker for a given data_key. Marks location of landmark(s) with small black line(s) on x axis. Plots this in front of the density plot for the entire dataset. This is helpful when adding a single batch to a larger, pre-landmarked dataset.

Parameters:
  • adata (AnnData) – AnnData to use with a batch in batch_key in .obs, and data in .obsm[data_key].

  • marker (str) – Marker to be plotted. Uses mmc.utils.get_data to find the marker.

  • batch_key (str (default: utils.BATCH_KEY)) – Category in .obs where batch is.

  • batch (str) – Label in .obs[batch_key] to be plotted.

  • data_key (Union[str, list] (default: utils.DATA_KEY)) – Label in .obsm to be plotted. If multiple obsm locations provided, provided order will be respected.

  • bw_adjust (float (default: 0)) – Scalar to multiply bandwidth smoothing method used by seaborn.kdeplot. See seaborn.kdeplot for more details.

  • step (float (default: 0.1)) – Size of x ticks on histogram.

  • weight – See seaborn.histplot documentation, the weights for the overall dataset to manually normalize the histogram heights of the batch and the total dataset. Passing None calculates n_batch_events/n_total_events