GSForge.operations.analytics module

Analytics are intended to more closely rank or compare a GEM subset, rather than the entire GEM. These functions are intended for analyzing and comparing subsets generated by the functions found in prospectors.

class GSForge.operations.analytics.RankGenesByModel(**kwargs)

Bases: GSForge.models._Interface.CallableInterface

Given some machine learning model, runs n_iterations and returns a summary of the ranking results.

This operation uses the Interface base class.

Parameters
  • model – A model that can be trained via .fit(x, y).

  • n_iterations (int) – Number of gene ranking iterations to use an instance of model.

Parameters inherited from:

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

model = param.Parameter(readonly=False)

n_iterations = param.Integer(readonly=False)

model = None
n_iterations = 1
static rank_genes_by_model(counts: xarray.core.dataarray.DataArray, labels: xarray.core.dataarray.DataArray, model) xarray.core.dataarray.DataArray
name = 'RankGenesByModel'
class GSForge.operations.analytics.nFDR(**kwargs)

Bases: GSForge.models._Interface.CallableInterface

nFDR (False Discovery Rate) [method_compare].

nFDR trains two models and compares their feature_importances_ attributes to estimate the false discovery rate.

The FDR estimated is the percent of instances a shuffled output feature has a higher feature importance score than the same non-shuffled feature score.

This is repeated up to n_iterations.

Parameters inherited from:

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

model = param.Parameter(readonly=False)

n_iterations = param.Integer(readonly=False)

model = None
n_iterations = 1
static nFDR(counts: xarray.core.dataarray.DataArray, labels: xarray.core.dataarray.DataArray, model) xarray.core.dataarray.DataArray
name = 'nFDR'
class GSForge.operations.analytics.mProbes(**kwargs)

Bases: GSForge.models._Interface.CallableInterface

mProbes [method_compare] works by randomly permuting the feature values in the supplied data. e.g. count values are shuffled within each samples feature (gene) array.

It then ranks the real and shadowed features (for n_iterations) with the supplied model via a call to model.fit(). It then examines model.feature_importances_ for the feature importance values, and then calculates the null rank distribution.

This is repeated upto n_iterations.

Parameters inherited from:

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

model = param.Parameter(readonly=False)

n_iterations = param.Integer(readonly=False)

model = None
n_iterations = 1
static mProbes(counts: xarray.core.dataarray.DataArray, labels: xarray.core.dataarray.DataArray, model) xarray.core.dataarray.DataArray
name = 'mProbes'