GOPCASignatureMatrix class

class gopca.GOPCASignatureMatrix(*args, **kwargs)

A GO-PCA signature matrix (the result of a GO-PCA run).

filter_collection_signatures(corr_thresh=0.9, source=None)

Filter signatures by collection.

filter_signatures(corr_thresh, inplace=False)

Remove “redundant” signatures.

classmethod from_signatures(signatures, standardize=False, center=True, use_median=True, cluster_signatures=True, signature_cluster_metric=u'correlation', cluster_samples=True, sample_cluster_metric=u'euclidean', cluster_method=u'average')

Generate a GO-PCA signature matrix from individual signatures.

The GO-PCA signature matrix contains the expression levels of all signatures (rows) generated, across all samples (columns) in the analysis. See the documentation of the GOPCASignature class for details on how signature expression levels are calculated.

Parameters:
  • signatures (Iterable of GOPCASignature) –
  • signatures generated. (The) –
get_figure(heatmap_kw=None, **kwargs)

Generate a plotly figure showing the signature matrix as a heatmap.

This is a shortcut for SignatureMatrix.get_heatmap(...).get_figure(...).

See ExpHeatmap.get_figure() for keyword arguments.

Parameters:heatmap_kw (dict or None) – If not None, dictionary containing keyword arguments to be passed to the ExpHeatmap constructor.
Returns:The plotly figure.
Return type:plotly.graph_objs.Figure
get_heatmap(max_name_length=40, include_id=False, highlight_sig=None, highlight_source=None, matrix_kw=None, colorbar_label=u'Signature expression<br>(log<sub>2</sub>-scale)', annotation_transparency=0.8)

Generate an ExpHeatMap instance.

get_signature(name, pc=None, i=None)

Look up a signature by name, PC, and index.

get_signature_labels(**kwargs)

Generate a list of GO-PCA signature labels (convenience function).

Returns:List of signature labels.
Return type:list of str
hash

An MD5 hash string for the signature.

n

The number of samples in the matrix.

q

The number of signatures in the matrix.

signature_labels

The list of signature labels.

signatures

This returns the list of signatures (as a pandas.Index object).

write_pickle(path)

Save the current object to a pickle file.

Parameters:path (str) – The path of the pickle file.
Returns:
Return type:None