oktoberfest.pl.plot_sa_distribution
- oktoberfest.pl.plot_sa_distribution(prosit_df, target_df, decoy_df, filename)
Generate spectral angle distribution for targets and decoys.
- Parameters:
prosit_df (
DataFrame) – mokapot / percolator input tab for rescoring with peptide property predictiontarget_df (
DataFrame) – mokapot / percolator target output for rescoring with peptide property prediction on the psm leveldecoy_df (
DataFrame) – mokapot / percolator decoy output for rescoring with peptide property prediction on the psm levelfilename (
Path) – the path to the location used for storing the plot
- Example:
>>> from oktoberfest import plotting as pl >>> import pandas as pd >>> # Required columns: SpecId and spectral_angle >>> prosit_df = pd.DataFrame({"SpecId": ["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","F1-11-KLYNANYIK-3-7","F2-4-YLNPLRTK-1-5"], >>> "spectral_angle": [0.6,0.2,0.3,0.6,0.4,0.2,0.5]}) >>> # Required columns: PSMId, score, q-value and peptide >>> target_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","F2-4-YLNPLRTK-1-5"], >>> "q-value": [0.005,0.008,0.002,0.006,0.004,0.001], >>> "score": [-0.1,-0.5,-0.5,0.7,0.4,0.5], >>> "peptide": ["TAIASPEK","LGLTKLQLH","EFAVEVLK","ISDPTSPLRTSR","ADHPLRTR","YLNPLRTK"]}) >>> decoy_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_sa_distribution(prosit_df=prosit_df, >>> target_df=target_df, >>> decoy_df=decoy_df, >>> filename="./tests/doctests/output/sa_distribution_plot.svg")