pinder.data.plot package#

Submodules#

pinder.data.plot.annotations module#

pinder.data.plot.annotations.get_annotation_metadata() DataFrame[source][source]#
pinder.data.plot.annotations.split_annotation_violins(annotation_df: ~pandas.core.frame.DataFrame, metric: str, theme: ~pinder.data.plot.plot.Theme = <pinder.data.plot.plot.LightTheme object>, span: list[int] | None = None, width: int = 950, height: int = 600, showlegend: bool = False) Figure[source][source]#
pinder.data.plot.annotations.main(fig_dir: Path = PosixPath('/home/runner/.local/share/pinder/2024-02/publication_figures'), format: str = 'pdf', theme_name: str = 'light') None[source][source]#

pinder.data.plot.categories module#

pinder.data.plot.categories.annotation_hit_rate_barplot(df: ~pandas.core.frame.DataFrame, bin_col: str, facet_col: str = 'monomer_name', theme: ~pinder.data.plot.plot.Theme = <pinder.data.plot.plot.LightTheme object>) Figure[source][source]#
pinder.data.plot.categories.get_categorical_annotation_hit_rate(dockq_annotation: DataFrame, annotation: str) DataFrame[source][source]#
pinder.data.plot.categories.bin_annotation(dockq_annotation: DataFrame, annotation: str, plot_label: str, digits: int = 0) DataFrame[source][source]#
pinder.data.plot.categories.success_rate_by_neff(dockq: ~pandas.core.frame.DataFrame, fig_dir: ~pathlib.Path = PosixPath('/home/runner/.local/share/pinder/2024-02/publication_figures'), format: str = 'pdf', theme: ~pinder.data.plot.plot.Theme = <pinder.data.plot.plot.LightTheme object>) None[source][source]#
pinder.data.plot.categories.success_rate_by_flexibility(dockq: ~pandas.core.frame.DataFrame, fig_dir: ~pathlib.Path = PosixPath('/home/runner/.local/share/pinder/2024-02/publication_figures'), format: str = 'pdf', theme: ~pinder.data.plot.plot.Theme = <pinder.data.plot.plot.LightTheme object>) None[source][source]#
pinder.data.plot.categories.success_rate_by_annotation(dockq: ~pandas.core.frame.DataFrame, fig_dir: ~pathlib.Path = PosixPath('/home/runner/.local/share/pinder/2024-02/publication_figures'), format: str = 'pdf', theme: ~pinder.data.plot.plot.Theme = <pinder.data.plot.plot.LightTheme object>) None[source][source]#
pinder.data.plot.categories.success_rate_by_chain_novelty(dockq: ~pandas.core.frame.DataFrame, fig_dir: ~pathlib.Path = PosixPath('/home/runner/.local/share/pinder/2024-02/publication_figures'), format: str = 'pdf', theme: ~pinder.data.plot.plot.Theme = <pinder.data.plot.plot.LightTheme object>) None[source][source]#
pinder.data.plot.categories.main(fig_dir: Path = PosixPath('/home/runner/.local/share/pinder/2024-02/publication_figures'), format: str = 'pdf', theme_name: str = 'light') None[source][source]#

pinder.data.plot.constants module#

pinder.data.plot.datasets module#

pinder.data.plot.datasets.oligomer_barplot(oligomer_counts: ~pandas.core.frame.DataFrame, theme: ~pinder.data.plot.plot.Theme = <pinder.data.plot.plot.LightTheme object>) Figure[source][source]#
pinder.data.plot.datasets.get_dataset_indices(split: str | None = 'test') DataFrame[source][source]#
pinder.data.plot.datasets.get_sequence_based_oligomer_state() DataFrame[source][source]#
pinder.data.plot.datasets.main(fig_dir: Path = PosixPath('/home/runner/.local/share/pinder/2024-02/publication_figures'), format: str = 'pdf', theme_name: str = 'light') None[source][source]#

pinder.data.plot.difficulty module#

pinder.data.plot.difficulty.get_diff(pid: str) DataFrame[source][source]#
pinder.data.plot.difficulty.get_difficulties(split: str = 'test', parallel: bool = True, max_workers: int | None = None) DataFrame[source][source]#
pinder.data.plot.difficulty.get_paired_difficulties(all_diff: DataFrame) DataFrame[source][source]#
pinder.data.plot.difficulty.dataset_difficulty_barplot(diff_count: ~pandas.core.frame.DataFrame, theme: ~pinder.data.plot.plot.Theme = <pinder.data.plot.plot.LightTheme object>) Figure[source][source]#
pinder.data.plot.difficulty.main(fig_dir: Path = PosixPath('/home/runner/.local/share/pinder/2024-02/publication_figures'), format: str = 'pdf', theme_name: str = 'light') None[source][source]#

pinder.data.plot.families module#

pinder.data.plot.families.copy_pinder_set(metadata: DataFrame) DataFrame[source][source]#
pinder.data.plot.families.get_pfam_metadata(fig_dir: Path = PosixPath('/home/runner/.local/share/pinder/2024-02/publication_figures'), frac_interface_threshold: float = 0.25, min_intersection: int = 10) DataFrame[source][source]#
pinder.data.plot.families.get_panther_id(uniprot_id: str) dict[str, str][source][source]#
pinder.data.plot.families.fetch_panther_ids(pinder_dir: Path = PosixPath('/home/runner/.local/share/pinder/2024-02')) DataFrame[source][source]#
pinder.data.plot.families.get_panther_metadata(pinder_dir: Path = PosixPath('/home/runner/.local/share/pinder/2024-02')) DataFrame[source][source]#
pinder.data.plot.families.family_diversity_bar_plot(class_size: ~pandas.core.frame.DataFrame, pinder_set: str, class_col: str = 'pfam_clan', top_n: int = 50, class_label: str | None = None, theme: ~pinder.data.plot.plot.Theme = <pinder.data.plot.plot.LightTheme object>, height: int = 1800, width: int = 1200, grid_x: bool = True, grid_y: bool = False, hide_legend_title: bool = True, hide_yaxis_title: bool = True, show_legend: bool = False, **kwargs: ~typing.Any) Figure[source][source]#
pinder.data.plot.families.family_grid_plot(family_metadata: ~pandas.core.frame.DataFrame, class_col: str, fig_dir: ~pathlib.Path = PosixPath('/home/runner/.local/share/pinder/2024-02/publication_figures'), include_invalid: bool = False, random_cluster_rep: bool = True, top_n: int = 50, format: str = 'pdf', theme: ~pinder.data.plot.plot.Theme = <pinder.data.plot.plot.LightTheme object>) None[source][source]#
pinder.data.plot.families.main(fig_dir: Path = PosixPath('/home/runner/.local/share/pinder/2024-02/publication_figures'), format: str = 'pdf', theme_name: str = 'light', include_invalid: bool = False, random_cluster_rep: bool = True) None[source][source]#

pinder.data.plot.figure_utils module#

pinder.data.plot.figure_utils.add_xaxis_title(fig: Figure, x_title: str, x: float = 0.5, y: float = -0.1) Figure[source][source]#
pinder.data.plot.figure_utils.add_yaxis_title(fig: Figure, y_title: str, x: float = -0.1, y: float = 0.5) Figure[source][source]#
pinder.data.plot.figure_utils.bold_annotations(fig: Figure) Figure[source][source]#
pinder.data.plot.figure_utils.bold_trace_name(fig: Figure) Figure[source][source]#
pinder.data.plot.figure_utils.format_text_template(fig: Figure, marker_line_color: str = '#333', text_template: str = '%{text:.1f}%') Figure[source][source]#
pinder.data.plot.figure_utils.remove_xaxis_titles(fig: Figure) Figure[source][source]#
pinder.data.plot.figure_utils.remove_yaxis_titles(fig: Figure) Figure[source][source]#
pinder.data.plot.figure_utils.remove_legend_title(fig: Figure) Figure[source][source]#
pinder.data.plot.figure_utils.update_layout(fig: Figure, font: dict[str, int | str] = {'family': 'Helvetica', 'size': 26}, margin: dict[str, int] = {'b': 20, 'l': 50, 'r': 50, 't': 50}) Figure[source][source]#
pinder.data.plot.figure_utils.update_axes(fig: Figure, axis: str, linecolor: str, tickcolor: str, titlecolor: str, **kwargs: Any) Figure[source][source]#
pinder.data.plot.figure_utils.write_fig(fig: Figure, output_file: Path, scale: int = 5) None[source][source]#

pinder.data.plot.image module#

pinder.data.plot.image.resize_img_to_array(img: Image, img_shape: tuple[int, int] = (244, 244)) ndarray[Any, dtype[int64]][source][source]#
pinder.data.plot.image.image_grid(fn_images: list[Path], text: list[str] = [], pdb_id: str | None = None, output_png: Path | None = None, per_row: int = 4, img_width: int = 2432, img_height: int = 1462, left: float | None = None, right: float | None = None, top: float | None = 0.88, bottom: float | None = None, wspace: float | None = None, hspace: float | None = None, figsize: tuple[int, int] = (22, 10)) None[source][source]#

fn_images is a list of image paths. text is a list of annotations. top is how many images you want to display per_row is the number of images to show per row.

pinder.data.plot.leaderboards module#

pinder.data.plot.leaderboards.get_monomer_counts() dict[str, list[str]][source][source]#
pinder.data.plot.leaderboards.get_leaderboard_table(leaderboards: DataFrame, metrics: DataFrame, monomer: str, dataset: str, summary_only: bool = True) DataFrame[source][source]#
pinder.data.plot.leaderboards.get_leaderboard_dict(metrics: DataFrame) dict[str, dict[str, DataFrame]][source][source]#
pinder.data.plot.leaderboards.generate_latex_rows(df: DataFrame) str[source][source]#
pinder.data.plot.leaderboards.generate_latex_table(df: DataFrame, caption: str, label: str = 'dockq_metrics_holo_pinder_af2') str[source][source]#
pinder.data.plot.leaderboards.generate_latex_rows_all(df: DataFrame) str[source][source]#
pinder.data.plot.leaderboards.generate_latex_table_all(dfs: list[DataFrame], subset: str, label: str = 'dockq_metrics_holo_pinder_af2') str[source][source]#
pinder.data.plot.leaderboards.generate_per_monomer_leaderboard_tables(leaderboard_dict: dict[str, dict[str, DataFrame]]) str[source][source]#
pinder.data.plot.leaderboards.generate_per_subset_leaderboard_tables(leaderboard_dict: dict[str, dict[str, DataFrame]]) str[source][source]#
pinder.data.plot.leaderboards.main(fig_dir: Path = PosixPath('/home/runner/.local/share/pinder/2024-02/publication_figures'), format: str = 'pdf', theme_name: str = 'light') None[source][source]#

pinder.data.plot.leakage module#

pinder.data.plot.leakage.multi_level_leakage_diversity_bar_plots(leakage: ~pandas.core.frame.DataFrame, y_col: str = 'Percentage', primary_x_col: str = 'Split', primary_x_order: list[str] | None = ['Test', 'Val'], secondary_x_col: str = 'Metric', color_col: str = 'Dataset', color_col_order: list[str] | None = ['PINDER', 'ProteinFlow', 'DIPS-equidock', 'PPIRef'], width: int = 1600, height: int = 650, bar_width: float = 0.1, y_title: str | None = None, color_discrete_map: dict[str, str] = {'DIPS-equidock': '#b2dff6', 'PINDER': '#e7bade', 'PPIRef': '#A3D6B3', 'ProteinFlow': '#c1c7e4', 'Sequence': '#c1c7e4'}, legend: dict[str, ~typing.Any] = {'font': {'size': 32}, 'orientation': 'h', 'x': 0.01, 'xref': 'paper', 'y': 1.01, 'yanchor': 'bottom'}, theme: ~pinder.data.plot.plot.Theme = <pinder.data.plot.plot.LightTheme object>) Figure[source][source]#
pinder.data.plot.leakage.ialign_vs_idist_density(fig_dir: ~pathlib.Path = PosixPath('/home/runner/.local/share/pinder/2024-02/publication_figures'), format: str = 'pdf', theme: ~pinder.data.plot.plot.Theme = <pinder.data.plot.plot.LightTheme object>) None[source][source]#
pinder.data.plot.leakage.get_ialign_leakage() DataFrame[source][source]#
pinder.data.plot.leakage.get_summary_diversity_and_leakage_stats(fig_dir: Path = PosixPath('/home/runner/.local/share/pinder/2024-02/publication_figures'), use_cache: bool = True) DataFrame[source][source]#
pinder.data.plot.leakage.main(fig_dir: Path = PosixPath('/home/runner/.local/share/pinder/2024-02/publication_figures'), format: str = 'pdf', theme_name: str = 'light', figsize: tuple[int, int] = (13, 10), plot_width: int = 1600, plot_height: int = 650) None[source][source]#

pinder.data.plot.performance module#

pinder.data.plot.performance.patch_af2mm_monomer_types(metrics: DataFrame) DataFrame[source][source]#
pinder.data.plot.performance.get_dockq_metrics() DataFrame[source][source]#
pinder.data.plot.performance.get_ialign_metrics() DataFrame[source][source]#
pinder.data.plot.performance.get_penalized_dockq() DataFrame[source][source]#
pinder.data.plot.performance.select_top_n(data: DataFrame, sort_col: str, ascending: bool = True, n: int = 1, group_cols: list[str] = ['pinder_set', 'method_name', 'id', 'monomer_name']) DataFrame[source][source]#
pinder.data.plot.performance.remove_af2mm_nonaf2(metrics: DataFrame) DataFrame[source][source]#
pinder.data.plot.performance.get_subsampled_train(split_index: DataFrame) DataFrame[source][source]#
pinder.data.plot.performance.get_deleaked_sr(ialign_data: DataFrame, dockq_data: DataFrame, log_pvalue_threshold: float, rmsd_threshold: float, is_score_threshold: float, test_id_col: str = 'query_id') dict[str, str | int | float][source][source]#
pinder.data.plot.performance.get_diffdock_ialign_sr(metrics: DataFrame, ialign: DataFrame, ialign_config: IalignConfig = IalignConfig(rmsd_threshold=5.0, log_pvalue_threshold=-9.0, is_score_threshold=0.3, alignment_printout=0, speed_mode=1, min_residues=5, min_interface=5, distance_cutoff=10.0, output_prefix='output')) DataFrame[source][source]#
pinder.data.plot.performance.get_timesplit_pinder_xl_ids(config: ClusterConfig = ClusterConfig(seed=40, canonical_method='foldseek_community', edge_weight='weight', foldseek_cluster_edge_threshold=0.7, foldseek_edge_threshold=0.55, foldseek_af2_difficulty_threshold=0.7, mmseqs_edge_threshold=0.0, resolution_thr=3.5, min_chain_length=40, min_atom_types=3, max_var_thr=0.98, oligomeric_count=2, method='X-RAY DIFFRACTION', interface_atom_gaps_4A=0, prodigy_label='BIO', number_of_components=1, alphafold_cutoff_date='2021-10-01', depth_limit=2, max_node_degree=1000, top_n=1, min_depth_2_hits_with_comm=1, max_depth_2_hits_with_comm=2000, max_depth_2_hits=1000)) set[str][source][source]#
pinder.data.plot.performance.get_af2mm_ialign_sr(metrics: DataFrame, ialign: DataFrame, config: ClusterConfig = ClusterConfig(seed=40, canonical_method='foldseek_community', edge_weight='weight', foldseek_cluster_edge_threshold=0.7, foldseek_edge_threshold=0.55, foldseek_af2_difficulty_threshold=0.7, mmseqs_edge_threshold=0.0, resolution_thr=3.5, min_chain_length=40, min_atom_types=3, max_var_thr=0.98, oligomeric_count=2, method='X-RAY DIFFRACTION', interface_atom_gaps_4A=0, prodigy_label='BIO', number_of_components=1, alphafold_cutoff_date='2021-10-01', depth_limit=2, max_node_degree=1000, top_n=1, min_depth_2_hits_with_comm=1, max_depth_2_hits_with_comm=2000, max_depth_2_hits=1000), ialign_config: IalignConfig = IalignConfig(rmsd_threshold=5.0, log_pvalue_threshold=-9.0, is_score_threshold=0.3, alignment_printout=0, speed_mode=1, min_residues=5, min_interface=5, distance_cutoff=10.0, output_prefix='output')) DataFrame[source][source]#
pinder.data.plot.performance.get_af2mm_neff_sr(metrics: DataFrame, config: ClusterConfig = ClusterConfig(seed=40, canonical_method='foldseek_community', edge_weight='weight', foldseek_cluster_edge_threshold=0.7, foldseek_edge_threshold=0.55, foldseek_af2_difficulty_threshold=0.7, mmseqs_edge_threshold=0.0, resolution_thr=3.5, min_chain_length=40, min_atom_types=3, max_var_thr=0.98, oligomeric_count=2, method='X-RAY DIFFRACTION', interface_atom_gaps_4A=0, prodigy_label='BIO', number_of_components=1, alphafold_cutoff_date='2021-10-01', depth_limit=2, max_node_degree=1000, top_n=1, min_depth_2_hits_with_comm=1, max_depth_2_hits_with_comm=2000, max_depth_2_hits=1000)) DataFrame[source][source]#
pinder.data.plot.performance.sr_curve(data: ~pandas.core.frame.DataFrame, color: str, x: str = 'log(P-value)', y: str = 'sr', theme: ~pinder.data.plot.plot.Theme = <pinder.data.plot.plot.LightTheme object>) Figure[source][source]#
pinder.data.plot.performance.reference_based_violin_plots(dockq: ~pandas.core.frame.DataFrame, fig_dir: ~pathlib.Path = PosixPath('/home/runner/.local/share/pinder/2024-02/publication_figures'), theme: ~pinder.data.plot.plot.Theme = <pinder.data.plot.plot.LightTheme object>, format: str = 'pdf') None[source][source]#
pinder.data.plot.performance.main(fig_dir: Path = PosixPath('/home/runner/.local/share/pinder/2024-02/publication_figures'), format: str = 'pdf', theme_name: str = 'light', config: ClusterConfig = ClusterConfig(seed=40, canonical_method='foldseek_community', edge_weight='weight', foldseek_cluster_edge_threshold=0.7, foldseek_edge_threshold=0.55, foldseek_af2_difficulty_threshold=0.7, mmseqs_edge_threshold=0.0, resolution_thr=3.5, min_chain_length=40, min_atom_types=3, max_var_thr=0.98, oligomeric_count=2, method='X-RAY DIFFRACTION', interface_atom_gaps_4A=0, prodigy_label='BIO', number_of_components=1, alphafold_cutoff_date='2021-10-01', depth_limit=2, max_node_degree=1000, top_n=1, min_depth_2_hits_with_comm=1, max_depth_2_hits_with_comm=2000, max_depth_2_hits=1000), ialign_config: IalignConfig = IalignConfig(rmsd_threshold=5.0, log_pvalue_threshold=-9.0, is_score_threshold=0.3, alignment_printout=0, speed_mode=1, min_residues=5, min_interface=5, distance_cutoff=10.0, output_prefix='output')) None[source][source]#

pinder.data.plot.plot module#

class pinder.data.plot.plot.Colors(white: 'str' = '#FFFFFF', gray: 'str' = '#A6ADCB', pink: 'str' = '#e7bade', brightpink: 'str' = '#FD4ECB', pinder: 'str' = '#f26b6c', palepurple: 'str' = '#c1c7e4', whitepurple: 'str' = '#d6d3db', purple: 'str' = '#8268F4', redpurple: 'str' = '#CC79A7', green: 'str' = '#A3D6B3', palegreen: 'str' = '#5F9A8D', teal: 'str' = '#38EADC', bluish_green: 'str' = '#009E73', blue: 'str' = '#b2dff6', cb_blue: 'str' = '#0072B2', cb_skyblue: 'str' = '#56B4E9', ice: 'str' = '#AAD2E8', deepice: 'str' = '#77B9F1', paleblue: 'str' = '#61A4BB', denim: 'str' = '#285290', navy: 'str' = '#132747', midnight: 'str' = '#0B131B', cb_orange: 'str' = '#E69F00', cb_vermillion: 'str' = '#D55E00', cb_yellow: 'str' = '#F0E442')[source][source]#

Bases: object

white: str = '#FFFFFF'#
gray: str = '#A6ADCB'#
pink: str = '#e7bade'#
brightpink: str = '#FD4ECB'#
pinder: str = '#f26b6c'#
palepurple: str = '#c1c7e4'#
whitepurple: str = '#d6d3db'#
purple: str = '#8268F4'#
redpurple: str = '#CC79A7'#
green: str = '#A3D6B3'#
palegreen: str = '#5F9A8D'#
teal: str = '#38EADC'#
bluish_green: str = '#009E73'#
blue: str = '#b2dff6'#
cb_blue: str = '#0072B2'#
cb_skyblue: str = '#56B4E9'#
ice: str = '#AAD2E8'#
deepice: str = '#77B9F1'#
paleblue: str = '#61A4BB'#
denim: str = '#285290'#
navy: str = '#132747'#
midnight: str = '#0B131B'#
cb_orange: str = '#E69F00'#
cb_vermillion: str = '#D55E00'#
cb_yellow: str = '#F0E442'#
palette(name: str, n: int | None = None) list[str][source]#
property colors: list[str]#

The list of available colors.

Type:

list[str]

property light: list[str]#

The list of available light colors.

Type:

list[str]

property dark: list[str]#

The list of available dark colors.

Type:

list[str]

property colorblind_paired: list[str]#

The list of available colorblind-friendly paired colors.

Type:

list[str]

property blues: list[str]#

The list of available blue-hued colors.

Type:

list[str]

property pinks: list[str]#

The list of available pink-hued colors.

Type:

list[str]

property purples: list[str]#

The list of available purple-hued colors.

Type:

list[str]

property neutral: list[str]#

The list of available neutral colors.

Type:

list[str]

property paired: list[str]#

paired color palette.

Type:

list[str]

property bright: list[str]#

bright color palette.

Type:

list[str]

property pastel: list[str]#

pastel color palette.

Type:

list[str]

class pinder.data.plot.plot.Theme[source][source]#

Bases: object

axis_linewidth: float = 2.8#
area_fill_color: str = '#ffb8b8'#
template: str = 'presentation'#
axis_line_color: str = 'black'#
axis_title_color: str = 'black'#
tick_color: str = '#333'#
text_marker_line_color: str = '#333'#
marker_line_color: str = '#333'#
marker_pattern_bgcolor: str = 'white'#
meanline_color: str = '#b3b3b3'#
box_fill_color: str = '#d6d6d6'#
class pinder.data.plot.plot.LightTheme[source][source]#

Bases: Theme

template: str = 'simple_white'#
tick_color: str = '#333'#
axis_line_color: str = 'black'#
axis_title_color: str = 'black'#
text_marker_line_color: str = '#333'#
box_fill_color: str = 'rgba(214, 214, 214, 0.1)'#
marker_line_color: str = '#333'#
meanline_color: str = '#b3b3b3'#
violin_marker_line_color: str = 'rgba(214, 214, 214, 0.1)'#
marker_pattern_bgcolor: str = 'white'#
class pinder.data.plot.plot.DarkTheme[source][source]#

Bases: Theme

template: str = 'plotly_dark'#
tick_color: str = '#d6d6d6'#
axis_line_color: str = 'white'#
axis_title_color: str = 'white'#
marker_line_color: str = '#d6d6d6'#
text_marker_line_color: str = '#d6d6d6'#
box_fill_color: str = '#212121'#
meanline_color: str = '#616161'#
violin_marker_line_color: str = 'rgba(33, 33, 33, 0.1)'#
marker_pattern_bgcolor: str = 'black'#
pinder.data.plot.plot.format_axes(fig: px.Figure, x: str, y: str, theme: Theme = <pinder.data.plot.plot.LightTheme object>, labels: dict[str, str] = {}, hide_xaxis_title: bool = False, hide_yaxis_title: bool = False, custom_xaxis_title: str | None = None, custom_yaxis_title: str | None = None, grid_x: bool = True, grid_y: bool = True, shared_xaxis_title: bool = False, shared_yaxis_title: bool = False, shared_xaxis_y_loc: float = -0.1, shared_yaxis_x_loc: float = -0.1, x_tick_labels: bool = True, y_tick_labels: bool = True) px.Figure[source][source]#
pinder.data.plot.plot.format_text(fig: px.Figure, text: str | None = None, theme: Theme = <pinder.data.plot.plot.LightTheme object>, text_template: str = '%{text:.1f}%') px.Figure[source][source]#
pinder.data.plot.plot.format_legend(fig: px.Figure, show_legend: bool = True, hide_legend_title: bool = False) px.Figure[source][source]#
pinder.data.plot.plot.format_facets(fig: px.Figure, data: pd.DataFrame, facet_col: str | None = None, facet_col_wrap: int | None = None, show_facet_y_line: bool = True) px.Figure[source][source]#
pinder.data.plot.plot.apply_formatting(fig: px.Figure, data: pd.DataFrame, x: str, y: str, theme: Theme = <pinder.data.plot.plot.LightTheme object>, labels: dict[str, str] = {}, hide_xaxis_title: bool = False, hide_yaxis_title: bool = False, custom_xaxis_title: str | None = None, custom_yaxis_title: str | None = None, grid_x: bool = True, grid_y: bool = True, shared_xaxis_title: bool = False, shared_yaxis_title: bool = False, shared_xaxis_y_loc: float = -0.1, shared_yaxis_x_loc: float = -0.1, x_tick_labels: bool = True, y_tick_labels: bool = True, facet_col: str | None = None, facet_col_wrap: int | None = None, show_facet_y_line: bool = True, show_legend: bool = True, hide_legend_title: bool = False, text: str | None = None, text_template: str = '%{text:.1f}%') px.Figure[source][source]#
class pinder.data.plot.plot.LinePlot(theme: ~pinder.data.plot.plot.Theme = <pinder.data.plot.plot.DarkTheme object>)[source][source]#

Bases: object

lineplot(data: pd.DataFrame, x: str, y: str, color: str | None = None, facet_col: str | None = None, facet_col_wrap: int | None = None, facet_row: str | None = None, text: str | None = None, color_discrete_map: dict[str, str] | None = None, labels: dict[str, str] = {}, category_orders: dict[str, list[str]] | None = None, height: int = 650, width: int | None = None, hide_xaxis_title: bool = False, hide_yaxis_title: bool = False, custom_xaxis_title: str | None = None, custom_yaxis_title: str | None = None, grid_x: bool = True, grid_y: bool = True, show_legend: bool = True, hide_legend_title: bool = False, shared_xaxis_title: bool = False, shared_yaxis_title: bool = False, shared_xaxis_y_loc: float = -0.1, shared_yaxis_x_loc: float = -0.1, x_tick_labels: bool = True, y_tick_labels: bool = True, show_facet_y_line: bool = True, text_template: str = '%{text:.1f}%', line_dash: str | None = None) px.Figure[source]#
class pinder.data.plot.plot.BarPlot(theme: ~pinder.data.plot.plot.Theme = <pinder.data.plot.plot.DarkTheme object>)[source][source]#

Bases: object

barplot(data: pd.DataFrame, x: str, y: str, color: str | None = None, facet_col: str | None = None, facet_col_wrap: int | None = None, facet_row: str | None = None, text: str | None = None, color_discrete_map: dict[str, str] | None = None, labels: dict[str, str] = {}, category_orders: dict[str, list[str]] | None = None, height: int = 650, width: int | None = None, barmode: str = 'group', hide_xaxis_title: bool = False, hide_yaxis_title: bool = False, custom_xaxis_title: str | None = None, custom_yaxis_title: str | None = None, grid_x: bool = True, grid_y: bool = True, show_legend: bool = True, hide_legend_title: bool = False, shared_xaxis_title: bool = False, shared_yaxis_title: bool = False, show_facet_y_line: bool = True, text_template: str = '%{text:.1f}%', x_tick_labels: bool = True, y_tick_labels: bool = True, shared_xaxis_y_loc: float = -0.1, shared_yaxis_x_loc: float = -0.1) px.Figure[source]#
grouped_stacked_bar(data: pd.DataFrame, x: str, group_col: str, y_cols: list[str], group_colors: dict[str, str] | None = {'Oracle': '#b2dff6', 'Top 1': '#A3D6B3', 'Top 5': '#e7bade'}, x_order: list[str] | None = None, labels: dict[str, str] = {}, pattern_cols: list[str] | None = ['percent_capri'], y_title: str | None = None, y_colors: dict[str, str] | None = {}, width: int = 1400, height: int = 900, legend_orientation: str = 'v', legend_font_size: int = 12, font_size: int = 16, font_family: str = 'Helvetica', barmode: str = 'group') px.Figure[source]#
class pinder.data.plot.plot.ViolinPlot(theme: ~pinder.data.plot.plot.Theme = <pinder.data.plot.plot.DarkTheme object>)[source][source]#

Bases: object

violinplot(data: pd.DataFrame, x: str, y: str, color: str | None = None, box: bool = True, facet_col: str | None = None, facet_col_wrap: int | None = None, facet_col_spacing: float | None = None, text: str | None = None, points: str = 'outliers', color_discrete_map: dict[str, str] | None = None, labels: dict[str, str] = {}, category_orders: dict[str, list[str]] | None = None, height: int = 650, width: int | None = None, violinmode: str = 'group', hide_xaxis_title: bool = False, hide_yaxis_title: bool = False, custom_xaxis_title: str | None = None, custom_yaxis_title: str | None = None, grid_x: bool = True, grid_y: bool = True, show_legend: bool = True, hide_legend_title: bool = False, shared_xaxis_title: bool = False, shared_yaxis_title: bool = False, shared_xaxis_y_loc: float = -0.1, shared_yaxis_x_loc: float = -0.1, hard_span: bool = False, span: list[float] | None = None, vrect: tuple[float, float] | None = None, hrect: tuple[float, float] | None = None, meanline_visible: bool = True, scalemode: str = 'width', scale_width: float = 0.6, x_tick_labels: bool = True, y_tick_labels: bool = True, marker_line_width: float = 0.5, marker_size: int = 8, marker_opacity: float = 0.9, show_facet_y_line: bool = True, text_template: str = '%{text:.1f}%') px.Figure[source]#

pinder.data.plot.run module#

pinder_plot

INFO: Showing help with the command 'pinder_plot -- --help'.

NAME
    pinder_plot

SYNOPSIS
    pinder_plot COMMAND

COMMANDS
    COMMAND is one of the following:

    annotations

    categories

    datasets

    difficulty

    families

    leaderboards

    leakage

    performance

    validity

pinder_plot annotations –help

INFO: Showing help with the command 'pinder_plot annotations -- --help'.

NAME
    pinder_plot annotations

SYNOPSIS
    pinder_plot annotations <flags>

FLAGS
    -f, --fig_dir=FIG_DIR
        Type: 'Path'
        Default: PosixPath('~/.local/share/pinder/2024-02/publication_figures')
    -o, --format=FORMAT
        Type: 'str'
        Default: 'pdf'
    -t, --theme_name=THEME_NAME
        Type: 'str'
        Default: 'light'
pinder.data.plot.run.main() None[source][source]#

pinder.data.plot.structure_case_studies module#

pinder.data.plot.structure_case_studies.get_oracle_per_id_monomer_method(dockq: DataFrame) DataFrame[source][source]#
pinder.data.plot.structure_case_studies.get_case_subset(oracle_data: DataFrame, id_monomers: list[str]) DataFrame[source][source]#
pinder.data.plot.structure_case_studies.clamp_rgb_value(value: float) float[source][source]#

Clamp the RGB values to ensure they are within the valid range [0, 1].

pinder.data.plot.structure_case_studies.generate_color_palette(n_methods: int = 12, lightness_shift: float = 0.2) dict[int, tuple[str, str]][source][source]#

Generate a color palette with n_methods distinct colors, and for each color, generate a lighter/darker shade with better perceptual distinction.

Parameters:
n_methodsint, optional

Number of methods, by default 12.

lightness_shiftfloat, optional

Amount to lighten/darken for the paired color, by default 0.2.

Returns:
dict[int, str]

A dictionary of colors with keys as method numbers and values as hex codes.

pinder.data.plot.structure_case_studies.generate_chimerax_native_pred_overlay(native: Path, models: list[dict[str, Path | str]], color_palette: dict[str, tuple[str, str]], native_R_chain: str = 'R', native_L_chain: str = 'L', pad: float = -0.6) str[source][source]#
pinder.data.plot.structure_case_studies.generate_chimera_grid_scripts(data: DataFrame, cxs_dir: Path, group_label: str, color_pal: dict[str, tuple[str, str]], gcs_model_root: str) DataFrame[source][source]#
pinder.data.plot.structure_case_studies.get_case_data(dockq: DataFrame) dict[str, DataFrame][source][source]#
pinder.data.plot.structure_case_studies.get_method_color_palette(dockq: DataFrame) dict[str, tuple[str, str]][source][source]#
pinder.data.plot.structure_case_studies.generate_case_scripts(cases: dict[str, DataFrame], color_pal: dict[str, tuple[str, str]], gcs_model_root: str, fig_dir: Path = PosixPath('/home/runner/.local/share/pinder/2024-02/publication_figures')) None[source][source]#
pinder.data.plot.structure_case_studies.generate_case_image_grids(cases: dict[str, DataFrame], color_pal: dict[str, tuple[str, str]], gcs_model_root: str, fig_dir: Path = PosixPath('/home/runner/.local/share/pinder/2024-02/publication_figures'), format: str = 'pdf') None[source][source]#
pinder.data.plot.structure_case_studies.main(gcs_model_root: str, fig_dir: Path = PosixPath('/home/runner/.local/share/pinder/2024-02/publication_figures'), format: str = 'pdf') None[source][source]#

pinder.data.plot.validity module#

pinder.data.plot.validity.get_ref_free_metrics(metric_type: str, xtal: bool) DataFrame[source][source]#
pinder.data.plot.validity.add_xtal_dummy_dockq(pinder_metrics: DataFrame) DataFrame[source][source]#
pinder.data.plot.validity.split_pinder_masked_unmasked(pinder_metrics: DataFrame) tuple[DataFrame, DataFrame][source][source]#
pinder.data.plot.validity.get_success_rate(data: DataFrame, filter_name: str) DataFrame[source][source]#
pinder.data.plot.validity.combine_native_and_predicted(pinder_metrics: DataFrame, method_metrics: DataFrame, metric_type: str) DataFrame[source][source]#
pinder.data.plot.validity.validity_bar_plot(sr_data: ~pandas.core.frame.DataFrame, sr_metric: str, fig_dir: ~pathlib.Path = PosixPath('/home/runner/.local/share/pinder/2024-02/publication_figures'), theme: ~pinder.data.plot.plot.Theme = <pinder.data.plot.plot.LightTheme object>, format: str = 'pdf') None[source][source]#
pinder.data.plot.validity.ref_free_violin_plot(metrics: ~pandas.core.frame.DataFrame, metric_col: str, fig_dir: ~pathlib.Path = PosixPath('/home/runner/.local/share/pinder/2024-02/publication_figures'), theme: ~pinder.data.plot.plot.Theme = <pinder.data.plot.plot.LightTheme object>, format: str = 'pdf') None[source][source]#
pinder.data.plot.validity.copy_xtal_apo_pred_metrics(metrics: DataFrame) DataFrame[source][source]#
pinder.data.plot.validity.main(fig_dir: Path = PosixPath('/home/runner/.local/share/pinder/2024-02/publication_figures'), format: str = 'pdf', theme_name: str = 'light') None[source][source]#

Module contents#

Pinder data sub-package for producing figures.