mcbrowse.figures.gene_gene

A gene-gene scatter figure.

This figure is the workhorse of annotating metacells with “cell types”. It shows which combinations of the two genes exist, gradients between different states, and how all these match the current type annotation.

class mcbrowse.figures.gene_gene.GeneGeneFilter(x_gene_name: str, y_gene_name: str, metacell_value: str = 'type', metacell_tooltip: Union[None, str, Tuple[str, str], Sequence[Union[str, Tuple[str, str]]], Callable[[DafReader], Sequence[Optional[str]]]] = None)[source]

Bases: FigureFilter[GeneGeneData]

Collect the data for a gene-gene figure.

x_gene_name: str

The name of the gene to use for the X axis.

This is stored in a column called x_gene_fractions in the collected data frame.

y_gene_name: str

The name of the gene to use for the Y axis.

This is stored in a column called y_gene_fractions in the collected data frame.

metacell_value: str = 'type'

The value to assign a value to each metacell (for coloring).

This is stored in a column called metacell_value in the collected data frame. It should be the name of some 1D data associated with each metacell in the daf data, that is, type will be used to access the metacell;type 1D data.

Converting the values to colors is done in the GeneGeneVeneer.

metacell_tooltip: Union[None, str, Tuple[str, str], Sequence[Union[str, Tuple[str, str]]], Callable[[daf.access.readers.DafReader], Sequence[Optional[str]]]] = None

How to compute a tooltip for each metacell.

collect(data: DafReader) GeneGeneData[source]

Collect the matching FigureData out of the data.

mcbrowse.figures.gene_gene.GeneGeneData

Contain the data for a gene-gene figure.

It will contain the columns: x_gene_fraction, y_gene_fraction, metacell_value and metacell_tooltip.

alias of TidyFigureData

class mcbrowse.figures.gene_gene.GeneGeneVeneer(*args, **kwds)[source]

Bases: FigureVeneer[GeneGeneData]

Control the appearance of a gene-gene figure.

figure: Optional[mcbrowse.figures.interface.FigureVeneer] = None

The overall figure parameters.

x_axis: Optional[mcbrowse.common.veneers.ContinuousAxisVeneer] = None

Control the X axis.

y_axis: Optional[mcbrowse.common.veneers.ContinuousAxisVeneer] = None

Control the Y axis.

points: Optional[mcbrowse.common.veneers.PointsVeneer] = None

Control the point appearance.

highlighted_points: Optional[mcbrowse.common.veneers.PointsVeneer] = None

Control the appearance of highlighted points.

tooltips: Optional[mcbrowse.common.veneers.TooltipsVeneer]

Control the appearance of the tooltips.

colors: Union[mcbrowse.common.veneers.DiscreteAxisVeneer, mcbrowse.common.veneers.ContinuousColorScale]

How to color the metacells.

plot(data: GeneGeneData) BaseFigure[source]

Generate the plotly figure using the specified data.