funki.plots

funki.plots.plot_counts_vs_n_genes(data)

Generates a scatter plot displaying the number of genes by counts versus total gene counts.

Parameters:

data (funki.input.DataSet) – The data set from which to generate the figure

Returns:

The figure contataining the resulting scatter plot

Return type:

plotly.graph_objs.Figure

funki.plots.plot_counts_vs_pct_mito(data)

Generates a scatter plot displaying the percentage of mitochondrial genes versus total gene counts.

Parameters:

data (funki.input.DataSet) – The data set from which to generate the figure

Returns:

The figure contataining the resulting scatter plot

Return type:

plotly.graph_objs.Figure

funki.plots.plot_dex(data, logfc_thr=1.0, fdr_thr=0.05)

Plots the results of the differential expression analisis as a volcano plot.

Parameters:
  • data (funki.input.DataSet) – The data set from which to generate the figure

  • logfc_thr (float, optional) – Threshold for signifacnce based on the log2(FC) value, defaults to 1.0

  • fdr_thr (float, optional) – Threshold for signifacnce based on the FDR value, defaults to 0.05

Returns:

The figure contataining the resulting scatter plot

Return type:

plotly.graph_objs.Figure

funki.plots.plot_enrich(data, top=10)

Generates a horizontal barplot displaying the top results of an enrichment analysis based on the consensus score across methods.

Parameters:
  • data (funki.input.DataSet) – The data set from which to generate the figure (it is assumed that funki.analysis.enrich() as been performed beforehand).

  • top (int) – Number of top enriched gene sets to display based on their consensus score. If a negative number is provided, the bottom ones will be displayed instead.

Returns:

The figure contataining the resulting bar plot

Return type:

plotly.graph_objs.Figure

funki.plots.plot_highest_expr(data, top=10)

Generates a box plot of the top expressed genes (based on mean expression).

Parameters:
  • data (funki.input.DataSet) – The data set from which to generate the figure

  • top (int, optional) – Number of top genes to represent, defaults to 10

Returns:

The figure contataining the resulting box plot

Return type:

plotly.graph_objs.Figure

funki.plots.plot_n_genes(data)

Generates a violin plot displaying the number of genes by counts. This is, number of genes per cell that have non-zero counts.

Parameters:

data (funki.input.DataSet) – The data set from which to generate the figure

Returns:

The figure contataining the resulting violin plot

Return type:

plotly.graph_objs.Figure

funki.plots.plot_pca(data, color=None, use_highly_variable=True, recalculate=False, **kwargs)

Plots the dimensionality reduction PCA results of a data set.

Parameters:
  • data (funki.input.DataSet) – The data set from which to compute the PCA

  • color (str | list[str], optional) – Variables or observations to color from, defaults to None

  • use_highly_variable (bool, optional) – Whether to use highly variable genes only or all genes available, defaults to True

  • recalculate (bool, optional) – Whether to recalculate the dimensionality reduction, defaults to False

  • **kwargs (optional) – Other keyword arguments that can be passed to scanpy.pp.pca()

Returns:

The figure contataining the scatter plot showing the PCA embedding

Return type:

plotly.graph_objs.Figure

funki.plots.plot_pct_counts_mito(data)

Generates a violin plot displaying the percentage of mitochondrial genes.

Parameters:

data (funki.input.DataSet) – The data set from which to generate the figure

Returns:

The figure contataining the resulting violin plot

Return type:

plotly.graph_objs.Figure

funki.plots.plot_total_counts(data)

Generates a violin plot displaying the total gene counts.

Parameters:

data (funki.input.DataSet) – The data set from which to generate the figure

Returns:

The figure contataining the resulting violin plot

Return type:

plotly.graph_objs.Figure

funki.plots.plot_tsne(data, color=None, perplexity=30, recalculate=False)

Plots the dimensionality reduction t-SNE results of a data set.

Parameters:
  • data (funki.input.DataSet) – The data set from which to compute the t-SNE

  • color (str | list[str], optional) – Variables or observations to color from, defaults to None

  • perplexity (int, optional) – Perplexity hyperparmaeter for the t-SNE representation. Relates to the number of nearest neighbours, defaults to 30

  • recalculate (bool, optional) – Whether to recalculate the dimensionality reduction, defaults to False

Returns:

The figure contataining the scatter plot showing the tSNE embedding

Return type:

plotly.graph_objs.Figure

funki.plots.plot_umap(data, color=None, min_dist=0.5, spread=1.0, alpha=1.0, gamma=1.0, recalculate=False, **kwargs)

Plots the dimensionality reduction UMAP results of a data set.

Parameters:
  • data (funki.input.DataSet) – The data set from which to compute the UMAP

  • color (str | list[str], optional) – Variables or observations to color from, defaults to None

  • min_dist (float, optional) – Effective minimum distance between the embedded points

  • spread (float, optional) – Effective scale of embedded points

  • alpha (float, optional) – Initial learning rate for the optimization

  • gamma (float, optional) – Weighting applied to negative samples for the optimization

  • recalculate (bool, optional) – Whether to recalculate the dimensionality reduction, defaults to False

  • **kwargs (optional) – Other keyword arguments that can be passed to scanpy.tl.umap()

Returns:

The figure contataining the scatter plot showing the UMAP embedding

Return type:

plotly.graph_objs.Figure