GSForge.plots.gem package

Module contents

class GSForge.plots.gem.SamplewiseDistributions(**kwargs)

Bases: GSForge.plots.abstract_plot_models.InterfacePlottingBase

Provides a base that iterates through the selected samples.

Parameters inherited from:

GSForge.plots.abstract_plot_models.AbstractPlottingOperation: apply_default_opts, plot_options

GSForge.models._Interface.Interface: gem, gene_set_collection, selected_gene_sets, selected_genes, gene_set_mode, sample_subset, count_variable, annotation_variables, count_mask, annotation_mask, count_transform

hue_key = param.Parameter(readonly=False)

hue_colors = param.Parameter(readonly=False)

cmap = param.Parameter(readonly=False)

sample_colormap = param.Parameter(readonly=False)

datashade = param.Boolean(readonly=False)

dynspread = param.Boolean(readonly=False)

kde_kwargs = param.Dict(readonly=False)

kde_sample_size = param.Integer(readonly=False)

hue_key = None
hue_colors = None
cmap = 'glasbey'
sample_colormap = None
datashade = False
dynspread = False
kde_kwargs = {'filled': False}
kde_sample_size = 200
static bokeh_opts()
static matplotlib_opts()
static kde_linespace(count_array, bin_range, sample_size, cut=3)

Apply the math behind the univariate_kde as implemented by Holoviews so that it can be applied with numpy.apply_along_axis.

static evaluate_kde(values, x_space)
classmethod plot_sample_wise_kde(count_array, sample_dim='Sample', color_key=None, x_axis_name='counts', sample_size=100)
name = 'SamplewiseDistributions'
class GSForge.plots.gem.GeneVsCountsScatter(**kwargs)

Bases: GSForge.plots.abstract_plot_models.InterfacePlottingBase

Display the counts of a small selection of genes on a scatter plot (genes vs counts).

This function is a GSForge.OperationInterface method, and shares those common parameters.

A selection of genes must be supplied to this function, either specifically via the selected_genes parameter, or implicitly by the selection or combination of some GeneSet support arrays via a GeneSetCollection.

A warning is generated if the number of genes surpasses a ‘soft_max’ parameter. This is only there to prevent useless, accidental plots of many thousands of genes. You would need to override it to show more than 50 genes by default.

Parameters specific to this function:

Parameters
  • hue – Color by which to shade the observations.

  • soft_max – The number of genes above which this function will return a ValueError rather than attempt to plot an unreasonable number of genes.

  • backend – The selected plotting backend to use for display. Options are [“bokeh”, “matplotlib”].

  • apply_default_opts – Whether to apply the default styling.

Returns

A holoviews.Layout object. The display of this object depends on the currently selected backend.

Parameters inherited from:

GSForge.plots.abstract_plot_models.AbstractPlottingOperation: apply_default_opts, plot_options

GSForge.models._Interface.Interface: gem, gene_set_collection, selected_gene_sets, selected_genes, gene_set_mode, sample_subset, count_variable, annotation_variables, count_mask, annotation_mask, count_transform

hue = param.String(readonly=False)

Color by which to shade the observations.

soft_max = param.Integer(readonly=False)

The number of genes above which this function will return a ValueError rather than attempt to plot an unreasonable number of genes.

hue = None
soft_max = 250
static genewise_scatter(data: pandas.core.frame.DataFrame, hue: Optional[str] = None, gene_dim: str = 'Gene', sample_dim: str = 'Sample', count_dim: str = 'counts')
static bokeh_opts()
static matplotlib_opts()
name = 'GeneVsCountsScatter'
class GSForge.plots.gem.GenewiseAggregateScatter(**kwargs)

Bases: GSForge.plots.abstract_plot_models.InterfacePlottingBase

Displays the output of selected aggregations upon the count array on a scatter plot with optional adjoined kernel density estimates. e.g. mean counts vs mean variance etc. By default such outputs are log2 transformed as well.

This function is a GSForge.OperationInterface method, and shares those common parameters.

Axis aggregation functions:
  • frequency

  • mean

  • variance

  • standard_dev

  • fano

  • mean_rank

  • cv_squared

Parameters specific to this function:

Parameters
  • x_axis_selector – Select from the available axis aggregation functions.

  • y_axis_selector – Select from the available axis aggregation functions.

  • datashade – Whether to apply the datashader.datashade operation.

  • dynspread – Whether to apply the datashader.dynspread operation.

  • backend – The selected plotting backend to use for display. Options are [“bokeh”, “matplotlib”].

  • apply_default_opts – Whether to apply the default styling.

Returns

A holoviews.Layout object. The display of this object depends on the currently selected backend.

Parameters inherited from:

GSForge.plots.abstract_plot_models.AbstractPlottingOperation: apply_default_opts, plot_options

GSForge.models._Interface.Interface: gem, gene_set_collection, selected_gene_sets, selected_genes, gene_set_mode, sample_subset, count_variable, annotation_variables, count_mask, annotation_mask, count_transform

datashade = param.Boolean(readonly=False)

dynspread = param.Boolean(readonly=False)

adjoint_distributions = param.Boolean(readonly=False)

x_axis_selector = param.ObjectSelector(readonly=False)

Select from the available axis aggregation functions.

y_axis_selector = param.ObjectSelector(readonly=False)

Select from the available axis aggregation functions.

axis_functions = {'cv_squared': <function GenewiseAggregateScatter.<lambda>>, 'fano': <function GenewiseAggregateScatter.<lambda>>, 'frequency': <function GenewiseAggregateScatter.<lambda>>, 'mean': <function GenewiseAggregateScatter.<lambda>>, 'mean_rank': <function GenewiseAggregateScatter.<lambda>>, 'standard_dev': <function GenewiseAggregateScatter.<lambda>>, 'variance': <function GenewiseAggregateScatter.<lambda>>}
datashade = False
dynspread = False
adjoint_distributions = True
x_axis_selector = 'mean'
y_axis_selector = 'variance'
static bokeh_opts()
static matplotlib_opts()
static scatter_dist(dataset, x_kdims, y_kdims, datashade=False, dynspread=False, adjoint_distributions=True, options=None)
static scatter_dist_by_mappings(dataset, x_kdims, y_kdims, mappings, selection_dim='Gene', datashade=False, dynspread=False, adjoint_distributions=True, options=None)
name = 'GenewiseAggregateScatter'
class GSForge.plots.gem.RasterGEM(**kwargs)

Bases: GSForge.plots.abstract_plot_models.InterfacePlottingBase

Parameters inherited from:

GSForge.plots.abstract_plot_models.AbstractPlottingOperation: apply_default_opts

GSForge.models._Interface.Interface: gem, gene_set_collection, selected_gene_sets, selected_genes, gene_set_mode, sample_subset, count_variable, annotation_variables, count_mask, annotation_mask, count_transform

plot_options = param.Parameter(readonly=False)

User supplied options to the plotting functions. If provided (and is not None), these will take precedence over a functions built-in defaults.

hue = param.String(readonly=False)

Color by which to shade the observations.

cmap = param.Parameter(readonly=False)

canvas_opts = param.Dict(readonly=False)

hue = None
cmap = None
plot_options = {'plot_height': 400, 'plot_width': 800}
canvas_opts = None
static gem_raster(counts, canvas_opts=None)
static colorized_gem_raster(counts, labels, cmap=None, canvas_opts=None)
name = 'RasterGEM'
class GSForge.plots.gem.GroupedGeneCovariance(**kwargs)

Bases: GSForge.plots.abstract_plot_models.InterfacePlottingBase

Parameters inherited from:

GSForge.plots.abstract_plot_models.AbstractPlottingOperation: apply_default_opts, plot_options

GSForge.models._Interface.Interface: gem, gene_set_collection, selected_gene_sets, selected_genes, gene_set_mode, sample_subset, count_variable, annotation_variables, count_mask, annotation_mask, count_transform

group_variable = param.String(readonly=False)

x_group_label = param.String(readonly=False)

y_group_label = param.String(readonly=False)

grouped_data = param.Parameter(readonly=False)

datashade = param.Boolean(readonly=False)

dynspread = param.Boolean(readonly=False)

group_variable = ''
x_group_label = ''
y_group_label = ''
grouped_data = None
datashade = False
dynspread = False
static grouped_mean_scatter(count_xarray, labels, group_variable, x_group_label, y_group_label, datashade=False, dynspread=False)
static bokeh_opts()
static matplotlib_opts()
name = 'GroupedGeneCovariance'
class GSForge.plots.gem.EmpiricalCumulativeDistribution(**kwargs)

Bases: GSForge.plots.abstract_plot_models.InterfacePlottingBase

Parameters inherited from:

GSForge.plots.abstract_plot_models.AbstractPlottingOperation: apply_default_opts, plot_options

GSForge.models._Interface.Interface: gem, gene_set_collection, selected_gene_sets, selected_genes, gene_set_mode, sample_subset, count_variable, annotation_variables, count_mask, annotation_mask, count_transform

hue_key = param.Parameter(readonly=False)

hue_colors = param.Parameter(readonly=False)

cmap = param.Parameter(readonly=False)

sample_colormap = param.Parameter(readonly=False)

x_axis_transform = param.Parameter(readonly=False)

A transform (usually log2) for getting a viewable spread of the results.

datashade = param.Boolean(readonly=False)

dynspread = param.Boolean(readonly=False)

hue_key = None
hue_colors = None
cmap = 'glasbey'
sample_colormap = None
x_axis_transform = ('log 2', <function EmpiricalCumulativeDistribution.<lambda>>)
datashade = False
dynspread = False
static plot_sample_wise_ecdf(counts: xarray.core.dataarray.DataArray, sample_dim: str = 'Sample', color_key: Optional[numpy.ndarray] = None, x_axis_name='counts')

Draw sample-wise empirical cumulative distribution functions.

static bokeh_opts()
static matplotlib_opts()
name = 'EmpiricalCumulativeDistribution'
class GSForge.plots.gem.GeneCountOverTime(**kwargs)

Bases: GSForge.plots.abstract_plot_models.InterfacePlottingBase

For each treatment group:
  • Curve: mean / median / trend

  • Points: given by count_variable.

  • Area: log fold change

  • Area: variance, error.

Parameters inherited from:

GSForge.plots.abstract_plot_models.AbstractPlottingOperation: apply_default_opts, plot_options

GSForge.models._Interface.Interface: gem, gene_set_collection, selected_gene_sets, selected_genes, gene_set_mode, sample_subset, count_variable, annotation_variables, count_mask, annotation_mask, count_transform

selected_gene = param.Parameter(readonly=False)

time_variable = param.Parameter(readonly=False)

treatment_variable = param.Parameter(readonly=False)

dispersion_variable = param.Parameter(readonly=False)

log_fold_change = param.Parameter(readonly=False)

treatment_colormap = param.Parameter(readonly=False)

log2_output = param.Boolean(readonly=False)

selected_gene = None
time_variable = None
treatment_variable = None
dispersion_variable = None
log_fold_change = 1.0
treatment_colormap = None
log2_output = True
static create_plot_dataframe(dataset, selected_gene, time_var, treatment_var, dispersion_var, count_var, gene_var, count_transform=None)
get_plot_dataframe()
static create_spread_dataframe(points_dataframe, time_var, log_fold_spread=1.0, count_var='counts', treatment_var=None, dispersion_var=None)
get_spread_dataframe()
plot_as_scatter()
plot_mean_curve()
plot_dispersion_spread()
property bokeh_opts
name = 'GeneCountOverTime'