GSForge.panels Package¶
panels
Package¶
GSForge Panel applications provide interactive visualizations for AnnotatedGEM
or GeneSetCollection
objects.
-
class
GSForge.panels.
UMAP_Panel
(source, interface_opts=None, **params)[source]¶ Bases:
param.parameterized.Parameterized
A UMAP Panel Exploration Tool.
interface
= param.Parameter()An instance of a GSForge.Interface object.
data_var_cats
= param.Dict(class_=<class ‘dict’>)Categories of variables. Controls which values are selectable as a ‘hue’.
n_neighbors
= param.Integer(default=15, inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))The size of local neighborhood (in terms of number of neighboring sample points) used for manifold approximation. Larger values result in more global views of the manifold, while smaller values result in more local data being preserved. In general values should be in the range 2 to 100. This parameter is limited by the number of samples in a given dataset.
n_components
= param.Integer(default=2, inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))The number of components (dimensions) to reduce to. Maybe one day we will go 3D. For now this should not be changed.
min_dist
= param.Number(bounds=[0, 1.0], default=0.1, inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))The effective minimum distance between embedded points. Smaller values will result in a more clustered/clumped embedding where nearby points on the manifold are drawn closer together, while larger values will result on a more even dispersal of points. The value should be set relative to the spread value, which determines the scale at which embedded points will be spread out.
metric
= param.ObjectSelector(default=’manhattan’, objects=[‘euclidean’, ‘manhattan’, ‘chebyshev’, ‘minkowski’])The metric to use to compute distances in high dimensional space.
random_state
= param.Integer(inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))Random state seed. Set for (exactly) reproducible plots.
hue
= param.ObjectSelector(objects=[])Select the column by which the points drawn should be colored by.
update
= param.Action()-
debug
(**kwargs)¶ Inspect .param.debug method for the full docstring
-
defaults
(**kwargs)¶ Inspect .param.defaults method for the full docstring
-
force_new_dynamic_value
= functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'GSForge.panels._umap_panel.UMAP_Panel'>)¶
-
get_param_values
= functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'GSForge.panels._umap_panel.UMAP_Panel'>)¶
-
get_transform_kwargs
(transform=<class 'umap.umap_.UMAP'>)[source]¶ Gets the overlapping arguments of the transform and parameters of this panel class, and returns them as a dictionary.
-
get_value_generator
= functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'GSForge.panels._umap_panel.UMAP_Panel'>)¶
-
inspect_value
= functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'GSForge.panels._umap_panel.UMAP_Panel'>)¶
-
message
(**kwargs)¶ Inspect .param.message method for the full docstring
-
params
= functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'GSForge.panels._umap_panel.UMAP_Panel'>)¶
-
pprint
(imports=None, prefix=' ', unknown_value='<?>', qualify=False, separator='')¶ (Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
classmethod
print_param_defaults
(*args, **kwargs)¶ Inspect .param.print_param_defaults method for the full docstring
-
print_param_values
(**kwargs)¶ Inspect .param.print_param_values method for the full docstring
-
script_repr
(imports=[], prefix=' ')¶ Variant of __repr__ designed for generating a runnable script.
-
classmethod
set_default
(*args, **kwargs)¶ Inspect .param.set_default method for the full docstring
-
set_dynamic_time_fn
= functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'GSForge.panels._umap_panel.UMAP_Panel'>)¶
-
set_param
= functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'GSForge.panels._umap_panel.UMAP_Panel'>)¶
-
state_pop
()¶ Restore the most recently saved state.
See state_push() for more details.
-
state_push
()¶ Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
static
static_transform
(array, **kwargs)[source]¶ Runs the transform with the selected panel parameters on the given array.
-
verbose
(**kwargs)¶ Inspect .param.verbose method for the full docstring
-
warning
(**kwargs)¶ Inspect .param.warning method for the full docstring
-
class
GSForge.panels.
Connectivity_Panel
(*args, **params)[source]¶ Bases:
GSForge.models._Interface.Interface
Display lineament collection membership via a network graph.
This panel requires a GeneSetCollection as input.
gem
= param.ClassSelector(class_=<class ‘GSForge.models._AnnotatedGEM.AnnotatedGEM’>)An AnnotatedGEM object.
gene_set_collection
= param.ClassSelector(class_=<class ‘GSForge.models._GeneSetCollection.GeneSetCollection’>)A GeneSetCollection object.
selected_gene_sets
= param.ListSelector(default=[None], objects=[])A list of keys from the provided GeneSetCollection (stored in gene_set_collection) that are to be used for selecting sets of genes from the count matrix.
selected_genes
= param.Parameter()A list of genes to use in indexing from the count matrix. This parameter takes priority over all other gene selecting methods. That means that selected lineaments (or combinations thereof) will have no effect.
gene_set_mode
= param.ObjectSelector(default=’union’, objects=[‘complete’, ‘union’, ‘intersection’])Controls how any selected gene sets are returned by the interface. + complete Returns the entire gene set of the AnnotatedGEM. + union Returns the union of the selected gene sets support. + intersection Returns the intersection of the selected gene sets support.
sample_subset
= param.Parameter()A list of samples to use in a given operation. These can be supplied directly as a list of genes, or can be drawn from a given GeneSet.
count_variable
= param.String()The name of the count matrix used.
annotation_variables
= param.Parameter()The name of the active annotation variable(s). These are the annotation columns that will be control the subset returned by y_annotation_data.
count_mask
= param.ObjectSelector(default=’complete’, objects=[‘complete’, ‘masked’, ‘dropped’])The type of mask to use for the count matrix. + ‘complete’ returns the entire count matrix as numbers. + ‘masked’ returns the entire count matrix with zero or missing as NaN values. + ‘dropped’ returns the count matrix without genes that have zero or missing values.
annotation_mask
= param.ObjectSelector(default=’complete’, objects=[‘complete’, ‘dropped’])The type of mask to use for the target array. + ‘complete’ returns the entire target array. + ‘masked’ returns the entire target array with zero or missing as NaN values. + ‘dropped’ returns the target array without samples that have zero or missing values.
count_transform
= param.Callable()A transform that will be run on the x_data that is supplied by this Interface. The transform runs on the subset of the matrix that has been selected.
mapping_selector
= param.ListSelector(objects=[])mapping_index_name
= param.String(default=’Gene’)edge_weight_label
= param.String()update_network
= param.Action()-
property
active_count_variable
¶ Returns the name of the currently active count matrix.
-
build_nx_graph
(selected_mappings=None, weight=None)[source]¶ Construct the networkx graph object form the selected mappings.
-
debug
(**kwargs)¶ Inspect .param.debug method for the full docstring
-
defaults
(**kwargs)¶ Inspect .param.defaults method for the full docstring
-
force_new_dynamic_value
= functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'GSForge.panels._connectivity_panel.Connectivity_Panel'>)¶
-
property
gene_index_name
¶ Returns the name of the gene index.
-
get_gene_index
(count_variable=None) → numpy.core.multiarray.array¶ Get the currently selected gene index as a numpy array.
- Parameters
count_variable – The variable to be retrieved.
- Returns
A numpy array of the currently selected genes.
-
get_param_values
= functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'GSForge.panels._connectivity_panel.Connectivity_Panel'>)¶
-
get_sample_index
() → numpy.core.multiarray.array¶ Get the currently selected sample index as a numpy array.
- Returns
A numpy array of the currently selected samples.
-
get_selection_indexes
() → dict¶ Returns the currently selected indexes as a dictionary.
-
get_value_generator
= functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'GSForge.panels._connectivity_panel.Connectivity_Panel'>)¶
-
inspect_value
= functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'GSForge.panels._connectivity_panel.Connectivity_Panel'>)¶
-
message
(**kwargs)¶ Inspect .param.message method for the full docstring
-
params
= functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'GSForge.panels._connectivity_panel.Connectivity_Panel'>)¶
-
pprint
(imports=None, prefix=' ', unknown_value='<?>', qualify=False, separator='')¶ (Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
classmethod
print_param_defaults
(*args, **kwargs)¶ Inspect .param.print_param_defaults method for the full docstring
-
print_param_values
(**kwargs)¶ Inspect .param.print_param_values method for the full docstring
-
property
sample_index_name
¶ Returns the name of the sample index.
-
script_repr
(imports=[], prefix=' ')¶ Variant of __repr__ designed for generating a runnable script.
-
property
selection
¶ Returns the currently selected data.
-
classmethod
set_default
(*args, **kwargs)¶ Inspect .param.set_default method for the full docstring
-
set_dynamic_time_fn
= functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'GSForge.panels._connectivity_panel.Connectivity_Panel'>)¶
-
set_param
= functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'GSForge.panels._connectivity_panel.Connectivity_Panel'>)¶
-
state_pop
()¶ Restore the most recently saved state.
See state_push() for more details.
-
state_push
()¶ Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
verbose
(**kwargs)¶ Inspect .param.verbose method for the full docstring
-
warning
(**kwargs)¶ Inspect .param.warning method for the full docstring
-
property
x_count_data
¶ Returns the currently selected ‘x_data’. Usually this will be a subset of the active count array.
- Returns
An Xarray.Dataset selection of the currently active ‘x_data’.
-
property
y_annotation_data
¶ Returns the currently selected ‘y_data’, or None, based on the
selected_annotation_variables
parameter.- Returns
An
xarray.Dataset
orxarray.DataArray
object of the currently selected y_data.