oktoberfest.pl.plot_gain_loss

oktoberfest.pl.plot_gain_loss(prosit_target, andromeda_target, level, filename)

Generate venn barplots to show lost, common and shared targets below 1% FDR attributed to peptide property predictions.

Parameters:
  • prosit_target (DataFrame) – mokapot / percolator target output for rescoring with peptide property prediction

  • andromeda_target (DataFrame) – mokapot / percolator target output for rescoring without peptide property prediction

  • level (str) – The level on which to produce the comparison. Can be either “peptide” or “psm”

  • filename (Union[str, Path]) – the path to the location used for storing the plot

Raises:

ValueError – if a wrong level is provided

Example:

>>> from oktoberfest import plotting as pl
>>> import pandas as pd
>>> # Required columns: PSMId, score, q-value and peptide
>>> prosit_df = pd.DataFrame({"PSMId": ["F1-15-TAIASPEK-1-5","F2-59-LGLTKLQLH-3-9","F1-24-EFAVEVLK-2-4",
>>>                         "F2-63-ISDPTSPLRTR-2-9","F1-16-ADHPLRTR-1-5"],
>>>                         "q-value": [0.005,0.008,0.002,0.006,0.004],
>>>                         "score": [-0.1,-0.5,-0.5,0.7,0.4],
>>>                         "peptide": ["TAIASPEK","LGLTKLQLH","EFAVEVLK","ISDPTSPLRTSR","ADHPLRTR"]})
>>> andromeda_df = pd.DataFrame({"PSMId": ["F1-11-KLYNANYIK-3-7","F2-59-LGLTKLQLH-3-9","F1-24-EFAVEVLK-2-4"],
>>>                             "q-value": [0.006,0.004,0.003],
>>>                             "score": [-0.1,-0.5,-0.5],
>>>                             "peptide": ["KLYNANYIK","LGLTKLQLH","EFAVEVLK"]})
>>> pl.plot_gain_loss(prosit_target=prosit_df,
>>>                     andromeda_target=andromeda_df,
>>>                     level="psm",
>>>                     filename="./tests/doctests/output/gain_loss_psm_plot.svg")