idea.IDEA#

class idea.IDEA(degs: DataFrame, go: DataFrame, deg_size_name: str = 'padj', deg_color_name: str = 'padj', deg_gene_name: str = 'gene', go_size_name: str = 'adj_pvalue', go_term_name: str = 'term_name', go_overlap_name: str = 'overlapping_genes', neg_log_xform_degs_size: bool = True, neg_log_xform_degs_color: bool = True, absolute_degs_color: bool = True, neg_log_xform_go: bool = True, set_deg_mass: bool = True, set_go_mass: bool = True, edge_color: str = 'grey', edge_width: float = 1.0, gene_palette: str = 'Reds', term_palette: str = 'Blues', gene_color: str | None = None, term_color: str | None = None, center: float | None = None, fontsize: int = 14, fontface: str = 'arial', fontcolor: str = 'auto', deg_node_scalar: float = 1.0, go_node_scalar: float = 1.0, force_options: bool = False)#
__init__(degs: DataFrame, go: DataFrame, deg_size_name: str = 'padj', deg_color_name: str = 'padj', deg_gene_name: str = 'gene', go_size_name: str = 'adj_pvalue', go_term_name: str = 'term_name', go_overlap_name: str = 'overlapping_genes', neg_log_xform_degs_size: bool = True, neg_log_xform_degs_color: bool = True, absolute_degs_color: bool = True, neg_log_xform_go: bool = True, set_deg_mass: bool = True, set_go_mass: bool = True, edge_color: str = 'grey', edge_width: float = 1.0, gene_palette: str = 'Reds', term_palette: str = 'Blues', gene_color: str | None = None, term_color: str | None = None, center: float | None = None, fontsize: int = 14, fontface: str = 'arial', fontcolor: str = 'auto', deg_node_scalar: float = 1.0, go_node_scalar: float = 1.0, force_options: bool = False)#

Initialize the IDEA class.

Parameters:
  • degs (pd.DataFrame) – A dataframe of differentially expressed genes.

  • go (pd.DataFrame) – A dataframe of gene ontology terms.

  • deg_size_name (str, optional) – The name of the column in degs that should be used for the size of the differentially expressed genes. By default, this is “padj”.

  • deg_color_name (str, optional) – The name of the column in degs that should be used for the color of the differentially expressed genes. By default, this is “padj”.

  • deg_gene_name (str, optional) – The name of the column in degs that should be used for the gene names of the differentially expressed genes. By default, this is “gene”.

  • go_size_name (str, optional) – The name of the column in go that should be used for the size of the gene ontology terms. By default, this is “adj_pvalue”.

  • go_term_name (str, optional) – The name of the column in go that should be used for the gene ontology terms. By default, this is “term_name”.

  • go_overlap_name (str, optional) – The name of the column in go that should be used for the overlapping genes of the gene ontology terms. By default, this is “overlapping_genes”.

  • neg_log_xform_degs_size (bool, optional) – Whether or not to invert the attributes of the differentially expressed genes. By default, this is True.

  • neg_log_xform_degs_color (bool, optional) – Whether or not to invert the attributes of the differentially expressed genes. By default, this is True.

  • absolute_degs_color (bool, optional) – Whether or not to take the absolute value of the color attribute for the differentially expressed genes. By default, this is True.

  • neg_log_xform_go (bool, optional) – Whether or not to invert the attributes of the gene ontology terms. By default, this is True.

  • set_deg_mass (bool, optional) – Whether or not to set the mass of the differentially expressed genes with the deg size. By default, this is True.

  • set_go_mass (bool, optional) – Whether or not to set the mass of the gene ontology terms with the go size. By default, this is True.

  • edge_color (str, optional) – The color of the edges in the bipartite graph. By default, this is “black”.

  • term_palette (str, optional) – The color palette to use for the gene ontology terms. By default, this is “Blues”. Palettes can be found at matplotlib.org/stable/tutorials/colors/colormaps.html. If None, the color will be set to the edge_color.

  • gene_palette (str, optional) – The color palette to use for the differentially expressed genes. By default, this is “Reds”. Palettes can be found at matplotlib.org/stable/tutorials/colors/colormaps.html. If None, the color will be set to the edge_color.

  • gene_color (str, optional) – The color of the differentially expressed genes. By default, this is None. If None, the color will be set to the gene_palette. Otherwise, the color will be set to the gene_color.

  • term_color (str, optional) – The color of the gene ontology terms. By default, this is None. If None, the color will be set to the term_palette. Otherwise, the color will be set to the term_color.

  • center (float, optional) – The center of the DEG color scale. Set to zero for diverging color scales. By default, this is None.

  • fontsize (int, optional) – The fontsize of the labels. By default, this is 14.

  • edge_width (float, optional) – The width of the edges. By default, this is 1.0.

  • fontface (str, optional) – The fontface of the labels. By default, this is “arial”.

  • fontcolor (str, optional) – The fontcolor of the labels. By default, this is “black”.

  • deg_node_scalar (float, optional) – The scalar to multiply the size of the DEG nodes by. By default, this is 1.0.

  • go_node_scalar (float, optional) – The scalar to multiply the size of the GO nodes by. By default, this is 1.0.

  • force_options (bool, optional) – Whether or not to force the options provided even if they don’t match expectations. By default, this is False.

Methods

__init__(degs, go[, deg_size_name, ...])

Initialize the IDEA class.

visualize([filepath, height, width])

Creates the vis.js visualization.