Skip to content

pyNBS.pyNBS_plotting.cluster_color_assign

Justin Huang edited this page Jan 27, 2018 · 3 revisions

This is a helper function that constructs a color map for different patient clusters. The color map can then be used to color the rows or columns of a co-clustering matrix map, as constructed by plot_cc_map.


Function Call:

cluster_color_assign(cluster_assignments, name=None)

Parameters:

  • cluster_assignments (required, pandas.Series): A pandas Series with an index of all patients and values as the cluster assignments for each patient. The cluster_assign output from the consensus_hclust_hard function is an appropriate input for this parameter.
  • name (optional, str, default=None): This is simply a string identifier for the cluster assignment vector passed in. It will show up as the label for on the associated row or column color bar when the resulting cluster_cmap is passed to plot_cc_map

Returns:

  • cluster_cmap (pandas.Series): A resulting mapping of each patient to an RGB color readable by the plot_cc_map function for either its row_color_map or its col_color_map parameters.

Additional notes about this function:

This function currently uses the default 'hls' color palette in Seaborn. Other color mapping functions are currently not implemented.

Clone this wiki locally