proteometer.alignment#

Functions#

get_df_for_pept_alignment_plot(→ pandas.DataFrame)

Generates a DataFrame for visualizing peptide alignment with fold changes.

plot_pept_alignment(→ matplotlib.figure.Figure)

Plots a heatmap of peptide alignment with fold changes.

Module Contents#

proteometer.alignment.get_df_for_pept_alignment_plot(pept_df: pandas.DataFrame, prot_seq: str, pairwise_ttest_name: str, tryptic_pattern: str = 'all', peptide_col: str = 'Sequence', clean_pept_col: str = 'clean_pept', max_vis_fc: float = 3.0, id_separator: str = '@') pandas.DataFrame[source]#

Generates a DataFrame for visualizing peptide alignment with fold changes.

Parameters:
  • pept_df (pd.DataFrame) – Input DataFrame containing peptide information.

  • prot_seq (str) – Protein sequence to align peptides against.

  • pairwise_ttest_name (str) – Column name in pept_df containing fold change values.

  • tryptic_pattern (str, optional) – Tryptic pattern to filter peptides. Defaults to “all”.

  • peptide_col (str, optional) – Column name for peptide sequences in pept_df. Defaults to “Sequence”.

  • clean_pept_col (str, optional) – Column name for cleaned peptide sequences in pept_df. Defaults to “clean_pept”.

  • max_vis_fc (float, optional) – Maximum fold change value for visualization. Defaults to 3.0.

  • id_separator (str, optional) – Separator for peptide ID formatting. Defaults to “@”.

Returns:

A DataFrame with fold changes aligned to the protein sequence.

Return type:

pd.DataFrame

proteometer.alignment.plot_pept_alignment(pept_df: pandas.DataFrame, prot_seq: str, pairwise_ttest_name: str, save2file: str | None = None, tryptic_pattern: str = 'all', peptide_col: str = 'Sequence', clean_pept_col: str = 'clean_pept', max_vis_fc: float = 3.0, color_map: str | list[matplotlib.typing.ColorType] | matplotlib.colors.Colormap | None = 'coolwarm') matplotlib.figure.Figure[source]#

Plots a heatmap of peptide alignment with fold changes.

Parameters:
  • pept_df (pd.DataFrame) – Input DataFrame containing peptide information.

  • prot_seq (str) – Protein sequence to align peptides against.

  • pairwise_ttest_name (str) – Column name in pept_df containing fold change values.

  • save2file (str | None, optional) – File path to save the plot. If None, the plot is displayed. Defaults to None.

  • tryptic_pattern (str, optional) – Tryptic pattern to filter peptides. Defaults to “all”.

  • peptide_col (str, optional) – Column name for peptide sequences in pept_df. Defaults to “Sequence”.

  • clean_pept_col (str, optional) – Column name for cleaned peptide sequences in pept_df. Defaults to “clean_pept”.

  • max_vis_fc (float, optional) – Maximum fold change value for visualization. Defaults to 3.0.

  • color_map (str | list[ColorType] | Colormap | None, optional) – Colormap for the heatmap. Defaults to “coolwarm”.

Returns:

The plot object.

Return type:

Figure