plot_distance_histo#

RAPDOR.plots.plot_distance_histo(rapdorids, rapdordata: RAPDORData, color: str = 'rgb(255, 138, 221)', bins: int = 10)#

Plots a histogram of the mean pairwise distances for a subset of proteins.

Parameters:
  • rapdorids (iterable) – A list or set of RAPDOR IDs specifying the proteins to include in the histogram.

  • rapdordata (RAPDORData) – A RAPDORData object containing the full dataset. Must include: - df: A DataFrame with a “Mean Distance” column. - state.distance_method: A string describing the distance metric used.

  • color (str, optional) – Hex or named color to use for the histogram bars. Defaults to DEFAULT_COLORS[“secondary”].

  • bins (int, optional) – Number of bins to divide the data into. Defaults to 10.

Returns:

A Plotly histogram figure showing the distribution of mean distances for the selected proteins.

Return type:

plotly.graph_objects.Figure

Example

fig = plot_distance_histo([“P12345”, “P67890”], rapdordata, bins=20) fig.show()