proteobench.plotting.plot_generator_entrapment module#
- class proteobench.plotting.plot_generator_entrapment.EntrapmentPlotGenerator[source]#
Bases:
PlotGeneratorBasePlot generator for Entrapment modules.
- generate_in_depth_plots(performance_data: DataFrame, parse_settings: Any, **kwargs) Dict[str, Figure][source]#
Generate standard Entrapment plots.
- Parameters:
- Returns:
Dictionary mapping plot names to plotly figures
- Return type:
Dict[str, go.Figure]
- get_in_depth_plot_layout() list[source]#
Define layout for Entrapment plots.
- Returns:
List of in-depth plot configurations defining how plots should be displayed
- Return type:
- plot_category_strip(result_df: DataFrame, software_colors: Dict[str, str] = {'AlphaDIA': '#1D2732', 'AlphaPept': '#cc6777', 'Custom': '#000000', 'DIA-NN': '#999934', 'FragPipe': '#342288', 'FragPipe (DIA-NN quant)': '#F89008', 'MSAID': '#bfef45', 'MSAngel': '#147733', 'MaxQuant': '#88ccef', 'MetaMorpheus': '#637C7A', 'PEAKS': '#f032e6', 'ProlineStudio': '#ddcc77', 'Proteome Discoverer': '#911eb4', 'Sage': '#671100', 'Spectronaut': '#007548', 'WOMBAT': '#44aa9a', 'i2MassChroQ': '#aa4599', 'quantms': '#f5e830'}, **kwargs) Figure[source]#
Strip plot of number of identified features grouped by FDP validity category.
Points are distributed within each category column using evenly-spaced horizontal jitter (sorted by
nr_id_featureswithin each group so the ordering is deterministic and reproducible). Background shading distinguishes categories: light red = invalid, light yellow = inconclusive, light green = valid. Point colour encodes the software tool.- Parameters:
result_df (pd.DataFrame) – DataFrame containing all datapoints (one row per workflow). Must include
lower_bound_FDP,paired_FDP,reported_fdr_parsed_from_input,nr_id_features,software_name,software_version.software_colors (Dict[str, str]) – Mapping of software names to hex colour strings.
**kwargs (dict) – Ignored; accepted for call-site compatibility.
- Returns:
Plotly figure.
- Return type:
go.Figure
- plot_fdp_id_scatter(result_df: DataFrame, software_colors: Dict[str, str] = {'AlphaDIA': '#1D2732', 'AlphaPept': '#cc6777', 'Custom': '#000000', 'DIA-NN': '#999934', 'FragPipe': '#342288', 'FragPipe (DIA-NN quant)': '#F89008', 'MSAID': '#bfef45', 'MSAngel': '#147733', 'MaxQuant': '#88ccef', 'MetaMorpheus': '#637C7A', 'PEAKS': '#f032e6', 'ProlineStudio': '#ddcc77', 'Proteome Discoverer': '#911eb4', 'Sage': '#671100', 'Spectronaut': '#007548', 'WOMBAT': '#44aa9a', 'i2MassChroQ': '#aa4599', 'quantms': '#f5e830'}, **kwargs) Figure[source]#
Scatter plot of FDP/FDR ratio (x) vs number of identified features (y).
Each point is one submitted workflow. Colour encodes the software tool; marker shape encodes the validity category (valid / inconclusive / invalid) computed from
paired_FDPvsreported_fdr_parsed_from_input. A vertical dashed line at x = 1 marks the point where the empirical FDP equals the declared FDR.- Parameters:
result_df (pd.DataFrame) – DataFrame containing all datapoints (one row per workflow). Must include
paired_FDP,reported_fdr_parsed_from_input,nr_id_features,software_name,software_version.software_colors (Dict[str, str]) – Mapping of software names to hex colour strings.
**kwargs (dict) – Ignored; accepted for call-site compatibility.
- Returns:
Plotly figure.
- Return type:
go.Figure
- plot_fdp_ratio(result_df: DataFrame, metric: str = 'Upper FDP bound - Paired method', colorblind_mode: bool = False, software_markers: Dict[str, str] = {'AlphaDIA': 'star-triangle-up', 'AlphaPept': 'square', 'Custom': 'star-square', 'DIA-NN': 'star', 'FragPipe': 'x', 'FragPipe (DIA-NN quant)': 'circle-x', 'MSAID': 'square-cross', 'MSAngel': 'cross', 'MaxQuant': 'circle', 'MetaMorpheus': 'asterisk', 'PEAKS': 'diamond-wide', 'ProlineStudio': 'diamond', 'Proteome Discoverer': 'hash', 'Sage': 'triangle-down', 'Spectronaut': 'diamond-tall', 'WOMBAT': 'pentagon', 'i2MassChroQ': 'triangle-up', 'quantms': 'hexagram'}, **kwargs) Figure[source]#
Plot the ratio of empirical FDP to reported FDR per workflow, grouped by software tool.
Each marker represents one workflow submission. The y-axis shows how much the empirical false discovery proportion (FDP) deviates from the FDR threshold declared by the user. A ratio of 1 means FDP equals the claimed FDR; below 1 is better (FDP is lower than claimed). Markers are coloured by validity category (valid / inconclusive / invalid) recomputed against each workflow’s own
reported_fdr_parsed_from_inputvalue.- Parameters:
result_df (pd.DataFrame) – DataFrame containing all datapoints (one row per submitted workflow). Must include columns
software_name,reported_fdr_parsed_from_input,lower_bound_FDP, and the FDP column resolved frommetric.metric (str, optional) – Which FDP bound to place on the y-axis. One of
"Lower FDP bound","Upper FDP bound - Combined method","Upper FDP bound - Paired method".colorblind_mode (bool, optional) – If
True, use distinct marker shapes per software tool in addition to category colours.software_markers (Dict[str, str]) – Mapping of software names to Plotly marker symbol strings.
**kwargs (dict) – Ignored; accepted for call-site compatibility.
- Returns:
Plotly figure with the FDP-ratio strip plot.
- Return type:
go.Figure
- plot_forest(result_df: DataFrame, sort_ascending: bool = True, **kwargs) Figure[source]#
Plot a forest / interval plot of FDP bounds per submitted workflow.
Each row represents one submission. A thick horizontal bar spans from the lower FDP bound to the paired upper FDP bound; open circle markers at both endpoints make the interval limits explicit. A diamond marker shows the declared FDR threshold (
reported_fdr_parsed_from_input). Bar colour indicates the validity category (valid / inconclusive / invalid) computed against each workflow’s ownreported_fdr_parsed_from_input. Rows are sorted by the number of identified features.- Parameters:
result_df (pd.DataFrame) – DataFrame containing all datapoints (one row per workflow). Must include
lower_bound_FDP,paired_FDP,reported_fdr_parsed_from_input,nr_id_features,software_name,software_version.sort_ascending (bool, optional) – Sort rows by
nr_id_featuresascending (True) or descending (False).**kwargs (dict) – Ignored; accepted for call-site compatibility.
- Returns:
Plotly figure with the forest plot.
- Return type:
go.Figure
- plot_main_metric(result_df: DataFrame, hide_annot: bool = False, metric: str = 'Upper FDP bound - Paired method', colorblind_mode: bool = False, software_colors: Dict[str, str] = {'AlphaDIA': '#1D2732', 'AlphaPept': '#cc6777', 'Custom': '#000000', 'DIA-NN': '#999934', 'FragPipe': '#342288', 'FragPipe (DIA-NN quant)': '#F89008', 'MSAID': '#bfef45', 'MSAngel': '#147733', 'MaxQuant': '#88ccef', 'MetaMorpheus': '#637C7A', 'PEAKS': '#f032e6', 'ProlineStudio': '#ddcc77', 'Proteome Discoverer': '#911eb4', 'Sage': '#671100', 'Spectronaut': '#007548', 'WOMBAT': '#44aa9a', 'i2MassChroQ': '#aa4599', 'quantms': '#f5e830'}, software_markers: Dict[str, str] = {'AlphaDIA': 'star-triangle-up', 'AlphaPept': 'square', 'Custom': 'star-square', 'DIA-NN': 'star', 'FragPipe': 'x', 'FragPipe (DIA-NN quant)': 'circle-x', 'MSAID': 'square-cross', 'MSAngel': 'cross', 'MaxQuant': 'circle', 'MetaMorpheus': 'asterisk', 'PEAKS': 'diamond-wide', 'ProlineStudio': 'diamond', 'Proteome Discoverer': 'hash', 'Sage': 'triangle-down', 'Spectronaut': 'diamond-tall', 'WOMBAT': 'pentagon', 'i2MassChroQ': 'triangle-up', 'quantms': 'hexagram'}, mapping: Dict[str, str] = {'new': 20, 'old': 10}, highlight_color: str = '#d30067', label: str = '', legend_name_map: Dict[str, str] = {'AlphaPept': 'AlphaPept (legacy tool)'}, annotation: str = '', **kwargs) Figure[source]#
Generate the main performance metric scatter plot for entrapment modules.
- Parameters:
result_df (pd.DataFrame) – DataFrame containing the results to plot.
metric (str, optional) – Bound to plot on the x axis, one of “Lower FDP bound”, “Upper FDP bound - Combined method”, or “Upper FDP bound - Paired method”.
colorblind_mode (Bool, optional) – If True, use different shapes for workflows.
software_colors (Dict[str, str]) – Mapping of software names to colors.
software_markers (Dict[str, str]) – Mapping of software names to markers.
mapping (Dict[str, str]) – Mapping for renaming software versions.
highlight_color (str) – Color to use for highlighting a specific software/tool.
label (str) – Label for the highlighted software/tool.
legend_name_map (Dict[str, str]) – Mapping for legend names.
hide_annot (bool) – Whether to hide annotations on the plot.
**kwargs (dict) – Additional module-specific parameters.
- Returns:
Plotly figure with the main performance metric plot.
- Return type:
go.Figure