rnalysis.enrichment.venn_diagram๏
- rnalysis.enrichment.venn_diagram(objs: Dict[str, str | FeatureSet | Set[str]], title: str | Literal['default'] = 'default', attr_ref_table_path: str | Path | Literal['predefined'] = 'predefined', set_colors: ColorList = ('r', 'g', 'b'), transparency: Fraction = 0.4, weighted: bool = True, add_outline: bool = True, linecolor: Color = 'black', linestyle: Literal['solid', 'dashed'] = 'solid', linewidth: float = 2.0, title_fontsize: float = 14, set_fontsize: float = 12, subset_fontsize: float = 10, fig: Figure = None, **legacy_args) Figure๏
Generate a Venn diagram of 2 to 3 sets, FeatureSets or attributes from the Attribute Reference Table.
- Parameters:
objs (a dictionary with 2-3 entries, where the keys are the names of the sets, and the values are either a FeatureSet, a python set of feature indices, or a name of a column in the Attribute Reference Table. For example: {'first set':{'gene1','gene2','gene3'}, 'second set':'name_of_attribute_from_reference_table'}) โ the FeatureSets, python sets or user-defined attributes to plot.
set_colors (tuple of matplotlib-format colors, the same size as 'objs') โ determines the colors of the circles in the diagram.
attr_ref_table_path (str or pathlib.Path (default='predefined')) โ the path of the Attribute Reference Table from which user-defined attributes will be drawn, if such attributes are included in โobjsโ.
title (str or 'default' (default='default')) โ determines the title of the plot.
transparency (a float between 0 and 1) โ determines the opacity of the circles. Opacity of 0 is completely transparent, while opacity of 1 is completely opaque.
weighted (bool (default=True)) โ if True, the plot will be area-weighted.
add_outline (bool (default=True)) โ if True, adds an outline to the circles.
linecolor (matplotlib-format color (default='black')) โ Determines the color of the circlesโ outline.
linestyle ('solid' or 'dashed' (default='solid')) โ the style of the circlesโ outline.
linewidth (float (default=2.0)) โ the widdth of the circlesโ outlines.
title_fontsize (float (default=14)) โ font size for the plotโs title.
set_fontsize (float (default=12)) โ font size for the set labels.
subset_fontsize (float (default=10)) โ font size for the subset labels.
fig (matplotlib.Figure) โ optionally, supply your own Figure to generate the plot onto.
- Returns:
a tuple of a VennDiagram object; and a list of 2-3 Circle patches.
Example plot of venn_diagram()๏