Usage#

Import the sc-toolbox API as follows:

import sc_toolbox as sct

You can then access the respective modules like:

sct.pl.cool_fancy_plot()

Preprocessing#

Tools#

tools.generate_expression_table

Generates a table of cells by genes of expression values as a Pandas DataFrame.

tools.relative_frequencies

Calculates the relative frequencies of conditions grouped by an observation.

tools.relative_frequency_per_cluster

Calculates relative frequencies per cluster

tools.correlate_to_signature

Correlations Score (based on cell type signature (logFC)) - alternative to sc.tl.score

tools.remove_outliers

Remove outlying cells based on UMAP embeddings with DBScan (density based clustering).

tools.add_percentages

Add columns to existing diffxpy table specifying percentage of expressing cells.

tools.ranksums_between_groups

Perform Wilcoxon Rank-sum test between two groups.

tools.generate_count_object

@Meshal what is this really supposed to do?

tools.tidy_de_table

Sorts diffxpy de table and adds percentages of expression per group

tools.correlate_means_to_gene

Calculate gene to gene correlation based on a mean expression table

tools.extended_marker_table

Generates an extended marker table with cell types and percentages of expressed cell types per cluster.

tools.generate_pseudobulk

Generates a pseudobulk for a given key of groups in the AnnData object.

tools.automated_marker_annotation

Calculates a marker gene overlap based on pre-existing annotations.

tools.de_res_to_anndata

Add a tabular differential expression result to AnnData as if it was produced by scanpy.tl.rank_genes_groups.

Plots#

plot.Colormaps(value)

Useful Colormaps for e.g.

plot.custom_plot_size(width, height, dpi)

Create a custom axis object of desired sizes.

plot.standard_lineplot(data, order, xlabel, ...)

Draws a standard line plot based on Seaborn's lmplot.

plot.average_expression(gene_expression, ...)

Draw a line plot showing the gene expression over time.

plot.average_expression_per_cluster(...[, ...])

Plots gene expression over time split by cluster identity.

plot.average_expression_split_cluster(...[, ...])

Plot average gene expression as line plots for multiple clusters at once.

plot.average_expression_per_cell(...[, ...])

Plots the average gene expression as a line plot per cell.

plot.gene_expression_dpt_ordered(data, ...)

Plot smoothed expression of all cells ordered by pseudo time.

plot.relative_frequencies_boxplots(...[, ...])

Plots the relative frequencies as split boxplots.

plot.split_boxplot(table, order, xlabel, ylabel)

Draws a boxsplit split by hue.

plot.marker_dendrogram(marker_table[, ...])

Plots a dendogram of used marker genes.

plot.volcano_plot(table[, fdr_thresh, ...])

Scatter plot of differential gene expression results generated by diffxpy

plot.cluster_composition_stacked_barplot(...)

Plot relative frequencies as a stacked barplot.

plot.gene_boxplot(table, palette[, xlabel, ...])

Plot gene values as split boxplots.

plot.colors_overview(colors[, ncols, ...])

Draw an overview plot of all used colors.

plot.relative_frequencies_lineplot(...[, ...])

Plot relative frequencies as a line plot.

plot.annotated_cell_type_umap(adata, ...[, ...])

Plots a UMAP which is colored by the primary_color, but also draws all labels on top of all clusters.

plot.genotype_vs_genotype_umaps(adata, ...)

Plots a two UMAPs of genotypes next to each other displaying only the colors of the second UMAP.