HELPpy.visualization package
Submodules
HELPpy.visualization.plot module
- HELPpy.visualization.plot.svenn_intesect(sets: List[set], labels: List[str], figsize=(10, 20), fontsize=10, ylabel='EG', xlabel='no. Genes', saveflag: bool = False) None [source]
Generate a Supervenn diagram to visualize the intersection of multiple sets.
- Parameters:
sets (List[set]) – List of sets to be visualized.
labels (List[str]) – List of labels corresponding to each set.
figsize (tuple) – Figure size in inches, as a tuple (width, height) (default is (10, 20)).
fontsize (int) – Font size for labels (default is 10).
xlabel (str) – label for x axis (default is ‘no. Genes’)
ylabel (str) – label for y axis (default is ‘EG’)
saveflag (bool) – Whether to save the generated diagram as an image (default is False).
- Returns:
None
The function generates a Supervenn diagram using the ‘supervenn’ library and Matplotlib. The diagram visualizes the intersection of multiple sets with labeled areas.
- Example:
# Usage example: set1 = {1, 2, 3, 4, 5} set2 = {3, 4, 5, 6, 7} set3 = {5, 6, 7, 8, 9} svenn_intesect([set1, set2, set3], ["Set A", "Set B", "Set C"], saveflag=True)
HELPpy.visualization.ui module
- class HELPpy.visualization.ui.Help_Dashboard(verbose: bool = False)[source]
Bases:
object
- labelling(path: str = '/Users/maurizio/HELP/docs', filename: str = '', modelname: str = '', rows: int = 5, minlines=10, percent=100.0, line_group='OncotreeLineage', line_col='ModelID', verbose=False)[source]
Generate an interactive widget for labeling cell lines based on specified criteria.
- Parameters:
path (str) – path for input file loading.
filename (str) – name of CRISPR effect input file.
modelname (str) – name of Model input file.
rows (int, optional) – The number of rows to display in the widget for selecting tissues (default is 5).
minlines (int, optional) – Minimum number of cell lines for tissue/lineage to be considered (default is 1).
line_group (str, optional) – The column in ‘df_map’ to use for tissue selection (default is ‘OncotreeLineage’).
line_col (str, optional) – The column in ‘df_map’ to use for line selection (default is ‘ModelID’).
- Returns:
Widget containing the labeled cell lines.
- Return type:
ipywidgets.ValueWidget
- process_features(label_path: str = '.', feature_path: str = '.', rows: int = 5)[source]
Create an interactive widget for processing features.
- Parameters:
label_path (str, optional) – Path to the label file (default is “.”).
feature_path (str, optional) – Path to the feature files (default is “.”).
rows (int, optional) – Number of rows to display in the widget (default is 5).
- Returns:
Widget containing the assembled features and labels DataFrames.
- Return type:
ipywidgets.ValueWidget
- select_cell_lines(df: DataFrame, df_map: DataFrame, outvar: object, rows: int = 5, minlines=1, line_group='OncotreeLineage', line_col='ModelID', verbose=False)[source]
Generate an interactive widget for labeling cell lines based on specified criteria.
- Parameters:
df (pd.DataFrame) – The main DataFrame containing the data.
df_map (pd.DataFrame) – A DataFrame used for mapping data.
rows (int, optional) – The number of rows to display in the widget for selecting tissues (default is 5).
minlines (int, optional) – Minimum number of cell lines for tissue/lineage to be considered (default is 1).
line_group (str, optional) – The column in ‘df_map’ to use for tissue selection (default is ‘OncotreeLineage’).
line_col (str, optional) – The column in ‘df_map’ to use for line selection (default is ‘ModelID’).
- Returns:
Widget containing the labeled cell lines.
- Return type:
ipywidgets.ValueWidget