Author: Zhenru Zhou zhou.zhenru@gene.com, Qui Phung phung.qui@gene.com, Corey Bakalarski bakalarski.corey@gene.com

# PepMapViz: A Versatile Toolkit for Peptide Mapping, Visualization, and Comparative Exploration

#### Zhenru Zhou zhou.zhenru@gene.com, Qui Phung phung.qui@gene.com, Corey Bakalarski bakalarski.corey@gene.com

# Introduction

This vignette demonstrates how to use `PepMapViz` with input files.

# Accessing Input Files

The input files are stored in the `inst/extdata/` directory of the package. You can access them using the `system.file()` function. The example files are searching results from PEAKS software. “Donor” column is added to plot peptides from different donors.

    library(PepMapViz)

    # To access the input files for proteomics results, specify the file path by replacing it with your own directory path.
    input_file_folder <- system.file("extdata/example_PEAKS_result", package = "PepMapViz")

    # Read the input files
    resulting_df <- combine_files_from_folder(input_file_folder)

    # Optional. Incorporating metadata into your analysis
    meta_data_path <- system.file("extdata/example_PEAKS_metadata", package = "PepMapViz")
    meta_data_df <- combine_files_from_folder(meta_data_path)
    resulting_df <- merge(
      x = resulting_df,
      y = meta_data_df,
      by = "Source File",
      all.x = TRUE  # Left join behavior
    )
    head(resulting_df)

    ## Key: <Source File>
    ##                                                                      Source File
    ##                                                                           <char>
    ## 1: 20230208_TTS1_ptran0117_OBJ42352_IDB001031_9D1_Boco_IP1_L243_MAPPs_1_1_1419.d
    ## 2: 20230208_TTS1_ptran0117_OBJ42352_IDB001031_9D1_Boco_IP1_L243_MAPPs_1_1_1419.d
    ## 3: 20230208_TTS1_ptran0117_OBJ42352_IDB001031_9D1_Boco_IP1_L243_MAPPs_1_1_1419.d
    ## 4: 20230208_TTS1_ptran0117_OBJ42352_IDB001031_9D1_Boco_IP1_L243_MAPPs_1_1_1419.d
    ## 5: 20230208_TTS1_ptran0117_OBJ42352_IDB001031_9D1_Boco_IP1_L243_MAPPs_1_1_1419.d
    ## 6: 20230208_TTS1_ptran0117_OBJ42352_IDB001031_9D1_Boco_IP1_L243_MAPPs_1_1_1419.d
    ##                           Peptide -10LgP     Mass Length Delta 1/k0   ppm
    ##                            <char>  <num>    <num>  <int>      <int> <num>
    ## 1:      ADYEKHKVYAC(+57.02)EVTHQG  26.08 2033.927     17          0   0.5
    ## 2:      ADYEKHKVYAC(+57.02)EVTHQG  43.32 2033.927     17          0   3.0
    ## 3:    ADYEKHKVYAC(+57.02)EVTHQGLS  37.61 2234.043     19          0   2.3
    ## 4:    ADYEKHKVYAC(+57.02)EVTHQGLS  26.73 2234.043     19          0   4.4
    ## 5:    ADYEKHKVYAC(+57.02)EVTHQGLS  44.82 2234.043     19          0   2.3
    ## 6: ADYEKHKVYAC(+57.02)EVTHQGLSSPV  29.12 2517.196     22          0   9.7
    ##         m/z     z      RT    1/k0 Range     Area Intensity    Scan Precursor Id
    ##       <num> <int>   <num>        <char>    <num>     <num>   <int>        <int>
    ## 1: 509.4939     4 31.9954 0.8114-0.8215 5554.165  73379.20 1591380        58236
    ## 2: 678.9911     3 31.9985 0.9191-0.9292 1305.469  18703.08 1591376        58232
    ## 3: 745.6968     3 39.5249 0.9050-0.9151 2653.591  38730.42 1978829        86021
    ## 4: 559.5256     4 39.5073 0.8272-0.8373 2627.366  78978.09 1978842        86034
    ## 5: 745.6968     3 39.5249 0.9066-0.9167 2653.591  38730.42 1980444        86112
    ## 6: 630.3182     4 48.1040 0.9272-0.9373       NA        NA 2430176       122840
    ##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   Accession
    ##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      <char>
    ## 1: A0A087WWV8|A0A087WWV8_HUMAN;Herceptin_LC|Trastuzumab_LC;aVb8-65_LC|aVb8-65_LC|aVb8-65_Light_Chain,;Tecentriq_LC|Atezolizumab_LC;Q6P5S8|Q6P5S8_HUMAN;Q5EFE6|Q5EFE6_HUMAN;V9HW34|V9HW34_HUMAN;JNJ61178104_TNFa_LC|JNJ61178104_TNFa_Light_Chain;Opdivo_LC|Nivolumab_LC;A0A087WYL9|A0A087WYL9_HUMAN;Rybrevant_EGFR_LC|Amivantamab_EGFR_Light_Chain;hA33_LC|hA33_LC;Herceptin_signalseqVHS_LC|Trastuzumab_signalseqVHS_LC;Tecentriq_signalseqNAYA_LC|Atezolizumab_signalseqNAYA_LC;Herceptin_signalseqNAYA_LC|Trastuzumab_signalseqNAYA_LC;JNJ61178104_TNFa_HC|JNJ61178104_TNFa_Heavy_Chain;Q6PJF2|Q6PJF2_HUMAN;Lemtrada_LC|Alemtuzumab_LC;Ly3415244_LC2|Ly3415244_Light_Chain_2;BocoBev_Bev_LC|BocoBev_Bev_Light_Chain;A0A087X130|A0A087X130_HUMAN;Praluent_LC|Alirocumab_LC;MPSK3169A_LC|MPSK3169A_LC;Keytruda_LC|Pembrolizumab_LC;Q8TCD0|Q8TCD0_HUMAN;Cosentyx_LC|Secukinumab_LC;Imfinzi_LC|Durvalumab_LC;Q6GMX0|Q6GMX0_HUMAN;Etrolizumab_LC|Etrolizumab;BocoBev_Boco_LC|BocoBev_Boco_Light_Chain;Tecentriq_signalseqVHS_LC|Atezolizumab_signlaseqVHS_LC;Q6PIL8|Q6PIL8_HUMAN;Q0KKI6|Q0KKI6_HUMAN;Remicade_LC|Infliximab_LC;Bococizumab_LC|Bococizumab_LC;P01834|IGKC_HUMAN;Libtayo_LC|Cemiplimab_LC;TrasBev_1cell_Tras_LC|TrasBev_1cell_Tras_Light_Chain;Q7Z3Y4|Q7Z3Y4_HUMAN;TrasBev_2cell_Tras_LC|TrasBev_2cell_Tras_Light_Chain;TrasBev_1cell_v2_Tras_LC|TrasBev_1cellv2_Tras_Light_Chain;hC6D4_LC|hC6D4.hIgG1;A0A087WTX5|A0A087WTX5_HUMAN;Rybrevant_Met_LC|Amivantamab_Met_Light_Chain;Humira_LC|Adalimumab_LC;A0A087WZW8|A0A087WZW8_HUMAN;KLK5KLK7_KLK5_LC|KLK5KLK7_KLK5_Light_Chain;METMab_LC|Onartuzumab;A0A075B6H6|A0A075B6H6_HUMAN
    ## 2: A0A087WWV8|A0A087WWV8_HUMAN;Herceptin_LC|Trastuzumab_LC;aVb8-65_LC|aVb8-65_LC|aVb8-65_Light_Chain,;Tecentriq_LC|Atezolizumab_LC;Q6P5S8|Q6P5S8_HUMAN;Q5EFE6|Q5EFE6_HUMAN;V9HW34|V9HW34_HUMAN;JNJ61178104_TNFa_LC|JNJ61178104_TNFa_Light_Chain;Opdivo_LC|Nivolumab_LC;A0A087WYL9|A0A087WYL9_HUMAN;Rybrevant_EGFR_LC|Amivantamab_EGFR_Light_Chain;hA33_LC|hA33_LC;Herceptin_signalseqVHS_LC|Trastuzumab_signalseqVHS_LC;Tecentriq_signalseqNAYA_LC|Atezolizumab_signalseqNAYA_LC;Herceptin_signalseqNAYA_LC|Trastuzumab_signalseqNAYA_LC;JNJ61178104_TNFa_HC|JNJ61178104_TNFa_Heavy_Chain;Q6PJF2|Q6PJF2_HUMAN;Lemtrada_LC|Alemtuzumab_LC;Ly3415244_LC2|Ly3415244_Light_Chain_2;BocoBev_Bev_LC|BocoBev_Bev_Light_Chain;A0A087X130|A0A087X130_HUMAN;Praluent_LC|Alirocumab_LC;MPSK3169A_LC|MPSK3169A_LC;Keytruda_LC|Pembrolizumab_LC;Q8TCD0|Q8TCD0_HUMAN;Cosentyx_LC|Secukinumab_LC;Imfinzi_LC|Durvalumab_LC;Q6GMX0|Q6GMX0_HUMAN;Etrolizumab_LC|Etrolizumab;BocoBev_Boco_LC|BocoBev_Boco_Light_Chain;Tecentriq_signalseqVHS_LC|Atezolizumab_signlaseqVHS_LC;Q6PIL8|Q6PIL8_HUMAN;Q0KKI6|Q0KKI6_HUMAN;Remicade_LC|Infliximab_LC;Bococizumab_LC|Bococizumab_LC;P01834|IGKC_HUMAN;Libtayo_LC|Cemiplimab_LC;TrasBev_1cell_Tras_LC|TrasBev_1cell_Tras_Light_Chain;Q7Z3Y4|Q7Z3Y4_HUMAN;TrasBev_2cell_Tras_LC|TrasBev_2cell_Tras_Light_Chain;TrasBev_1cell_v2_Tras_LC|TrasBev_1cellv2_Tras_Light_Chain;hC6D4_LC|hC6D4.hIgG1;A0A087WTX5|A0A087WTX5_HUMAN;Rybrevant_Met_LC|Amivantamab_Met_Light_Chain;Humira_LC|Adalimumab_LC;A0A087WZW8|A0A087WZW8_HUMAN;KLK5KLK7_KLK5_LC|KLK5KLK7_KLK5_Light_Chain;METMab_LC|Onartuzumab;A0A075B6H6|A0A075B6H6_HUMAN
    ## 3:                                                 Keytruda_LC|Pembrolizumab_LC;A0A087WWV8|A0A087WWV8_HUMAN;Q8TCD0|Q8TCD0_HUMAN;Imfinzi_LC|Durvalumab_LC;Cosentyx_LC|Secukinumab_LC;Q6GMX0|Q6GMX0_HUMAN;Herceptin_LC|Trastuzumab_LC;aVb8-65_LC|aVb8-65_LC|aVb8-65_Light_Chain,;Tecentriq_LC|Atezolizumab_LC;BocoBev_Boco_LC|BocoBev_Boco_Light_Chain;Tecentriq_signalseqVHS_LC|Atezolizumab_signlaseqVHS_LC;Q6PIL8|Q6PIL8_HUMAN;Q0KKI6|Q0KKI6_HUMAN;Q6P5S8|Q6P5S8_HUMAN;Q5EFE6|Q5EFE6_HUMAN;V9HW34|V9HW34_HUMAN;Remicade_LC|Infliximab_LC;Bococizumab_LC|Bococizumab_LC;JNJ61178104_TNFa_LC|JNJ61178104_TNFa_Light_Chain;P01834|IGKC_HUMAN;Libtayo_LC|Cemiplimab_LC;Opdivo_LC|Nivolumab_LC;A0A087WYL9|A0A087WYL9_HUMAN;TrasBev_1cell_Tras_LC|TrasBev_1cell_Tras_Light_Chain;Rybrevant_EGFR_LC|Amivantamab_EGFR_Light_Chain;Q7Z3Y4|Q7Z3Y4_HUMAN;TrasBev_1cell_v2_Tras_LC|TrasBev_1cellv2_Tras_Light_Chain;TrasBev_2cell_Tras_LC|TrasBev_2cell_Tras_Light_Chain;hA33_LC|hA33_LC;A0A087WTX5|A0A087WTX5_HUMAN;Herceptin_signalseqVHS_LC|Trastuzumab_signalseqVHS_LC;Tecentriq_signalseqNAYA_LC|Atezolizumab_signalseqNAYA_LC;Herceptin_signalseqNAYA_LC|Trastuzumab_signalseqNAYA_LC;JNJ61178104_TNFa_HC|JNJ61178104_TNFa_Heavy_Chain;Rybrevant_Met_LC|Amivantamab_Met_Light_Chain;Humira_LC|Adalimumab_LC;Q6PJF2|Q6PJF2_HUMAN;Lemtrada_LC|Alemtuzumab_LC;Ly3415244_LC2|Ly3415244_Light_Chain_2;BocoBev_Bev_LC|BocoBev_Bev_Light_Chain;A0A087X130|A0A087X130_HUMAN;Praluent_LC|Alirocumab_LC;A0A087WZW8|A0A087WZW8_HUMAN;KLK5KLK7_KLK5_LC|KLK5KLK7_KLK5_Light_Chain;METMab_LC|Onartuzumab;A0A075B6H6|A0A075B6H6_HUMAN;MPSK3169A_LC|MPSK3169A_LC
    ## 4:                                                 Keytruda_LC|Pembrolizumab_LC;A0A087WWV8|A0A087WWV8_HUMAN;Q8TCD0|Q8TCD0_HUMAN;Imfinzi_LC|Durvalumab_LC;Cosentyx_LC|Secukinumab_LC;Q6GMX0|Q6GMX0_HUMAN;Herceptin_LC|Trastuzumab_LC;aVb8-65_LC|aVb8-65_LC|aVb8-65_Light_Chain,;Tecentriq_LC|Atezolizumab_LC;BocoBev_Boco_LC|BocoBev_Boco_Light_Chain;Tecentriq_signalseqVHS_LC|Atezolizumab_signlaseqVHS_LC;Q6PIL8|Q6PIL8_HUMAN;Q0KKI6|Q0KKI6_HUMAN;Q6P5S8|Q6P5S8_HUMAN;Q5EFE6|Q5EFE6_HUMAN;V9HW34|V9HW34_HUMAN;Remicade_LC|Infliximab_LC;Bococizumab_LC|Bococizumab_LC;JNJ61178104_TNFa_LC|JNJ61178104_TNFa_Light_Chain;P01834|IGKC_HUMAN;Libtayo_LC|Cemiplimab_LC;Opdivo_LC|Nivolumab_LC;A0A087WYL9|A0A087WYL9_HUMAN;TrasBev_1cell_Tras_LC|TrasBev_1cell_Tras_Light_Chain;Rybrevant_EGFR_LC|Amivantamab_EGFR_Light_Chain;Q7Z3Y4|Q7Z3Y4_HUMAN;TrasBev_1cell_v2_Tras_LC|TrasBev_1cellv2_Tras_Light_Chain;TrasBev_2cell_Tras_LC|TrasBev_2cell_Tras_Light_Chain;hA33_LC|hA33_LC;A0A087WTX5|A0A087WTX5_HUMAN;Herceptin_signalseqVHS_LC|Trastuzumab_signalseqVHS_LC;Tecentriq_signalseqNAYA_LC|Atezolizumab_signalseqNAYA_LC;Herceptin_signalseqNAYA_LC|Trastuzumab_signalseqNAYA_LC;JNJ61178104_TNFa_HC|JNJ61178104_TNFa_Heavy_Chain;Rybrevant_Met_LC|Amivantamab_Met_Light_Chain;Humira_LC|Adalimumab_LC;Q6PJF2|Q6PJF2_HUMAN;Lemtrada_LC|Alemtuzumab_LC;Ly3415244_LC2|Ly3415244_Light_Chain_2;BocoBev_Bev_LC|BocoBev_Bev_Light_Chain;A0A087X130|A0A087X130_HUMAN;Praluent_LC|Alirocumab_LC;A0A087WZW8|A0A087WZW8_HUMAN;KLK5KLK7_KLK5_LC|KLK5KLK7_KLK5_Light_Chain;METMab_LC|Onartuzumab;A0A075B6H6|A0A075B6H6_HUMAN;MPSK3169A_LC|MPSK3169A_LC
    ## 5:                                                 Keytruda_LC|Pembrolizumab_LC;A0A087WWV8|A0A087WWV8_HUMAN;Q8TCD0|Q8TCD0_HUMAN;Imfinzi_LC|Durvalumab_LC;Cosentyx_LC|Secukinumab_LC;Q6GMX0|Q6GMX0_HUMAN;Herceptin_LC|Trastuzumab_LC;aVb8-65_LC|aVb8-65_LC|aVb8-65_Light_Chain,;Tecentriq_LC|Atezolizumab_LC;BocoBev_Boco_LC|BocoBev_Boco_Light_Chain;Tecentriq_signalseqVHS_LC|Atezolizumab_signlaseqVHS_LC;Q6PIL8|Q6PIL8_HUMAN;Q0KKI6|Q0KKI6_HUMAN;Q6P5S8|Q6P5S8_HUMAN;Q5EFE6|Q5EFE6_HUMAN;V9HW34|V9HW34_HUMAN;Remicade_LC|Infliximab_LC;Bococizumab_LC|Bococizumab_LC;JNJ61178104_TNFa_LC|JNJ61178104_TNFa_Light_Chain;P01834|IGKC_HUMAN;Libtayo_LC|Cemiplimab_LC;Opdivo_LC|Nivolumab_LC;A0A087WYL9|A0A087WYL9_HUMAN;TrasBev_1cell_Tras_LC|TrasBev_1cell_Tras_Light_Chain;Rybrevant_EGFR_LC|Amivantamab_EGFR_Light_Chain;Q7Z3Y4|Q7Z3Y4_HUMAN;TrasBev_1cell_v2_Tras_LC|TrasBev_1cellv2_Tras_Light_Chain;TrasBev_2cell_Tras_LC|TrasBev_2cell_Tras_Light_Chain;hA33_LC|hA33_LC;A0A087WTX5|A0A087WTX5_HUMAN;Herceptin_signalseqVHS_LC|Trastuzumab_signalseqVHS_LC;Tecentriq_signalseqNAYA_LC|Atezolizumab_signalseqNAYA_LC;Herceptin_signalseqNAYA_LC|Trastuzumab_signalseqNAYA_LC;JNJ61178104_TNFa_HC|JNJ61178104_TNFa_Heavy_Chain;Rybrevant_Met_LC|Amivantamab_Met_Light_Chain;Humira_LC|Adalimumab_LC;Q6PJF2|Q6PJF2_HUMAN;Lemtrada_LC|Alemtuzumab_LC;Ly3415244_LC2|Ly3415244_Light_Chain_2;BocoBev_Bev_LC|BocoBev_Bev_Light_Chain;A0A087X130|A0A087X130_HUMAN;Praluent_LC|Alirocumab_LC;A0A087WZW8|A0A087WZW8_HUMAN;KLK5KLK7_KLK5_LC|KLK5KLK7_KLK5_Light_Chain;METMab_LC|Onartuzumab;A0A075B6H6|A0A075B6H6_HUMAN;MPSK3169A_LC|MPSK3169A_LC
    ## 6: A0A087WWV8|A0A087WWV8_HUMAN;Herceptin_LC|Trastuzumab_LC;aVb8-65_LC|aVb8-65_LC|aVb8-65_Light_Chain,;Tecentriq_LC|Atezolizumab_LC;Q6P5S8|Q6P5S8_HUMAN;Q5EFE6|Q5EFE6_HUMAN;V9HW34|V9HW34_HUMAN;JNJ61178104_TNFa_LC|JNJ61178104_TNFa_Light_Chain;Opdivo_LC|Nivolumab_LC;A0A087WYL9|A0A087WYL9_HUMAN;Rybrevant_EGFR_LC|Amivantamab_EGFR_Light_Chain;hA33_LC|hA33_LC;Herceptin_signalseqVHS_LC|Trastuzumab_signalseqVHS_LC;Tecentriq_signalseqNAYA_LC|Atezolizumab_signalseqNAYA_LC;Herceptin_signalseqNAYA_LC|Trastuzumab_signalseqNAYA_LC;JNJ61178104_TNFa_HC|JNJ61178104_TNFa_Heavy_Chain;Q6PJF2|Q6PJF2_HUMAN;Lemtrada_LC|Alemtuzumab_LC;Ly3415244_LC2|Ly3415244_Light_Chain_2;BocoBev_Bev_LC|BocoBev_Bev_Light_Chain;A0A087X130|A0A087X130_HUMAN;Praluent_LC|Alirocumab_LC;MPSK3169A_LC|MPSK3169A_LC;Keytruda_LC|Pembrolizumab_LC;Q8TCD0|Q8TCD0_HUMAN;Imfinzi_LC|Durvalumab_LC;Cosentyx_LC|Secukinumab_LC;Q6GMX0|Q6GMX0_HUMAN;Etrolizumab_LC|Etrolizumab;BocoBev_Boco_LC|BocoBev_Boco_Light_Chain;Tecentriq_signalseqVHS_LC|Atezolizumab_signlaseqVHS_LC;Q6PIL8|Q6PIL8_HUMAN;Q0KKI6|Q0KKI6_HUMAN;Remicade_LC|Infliximab_LC;Bococizumab_LC|Bococizumab_LC;P01834|IGKC_HUMAN;Libtayo_LC|Cemiplimab_LC;TrasBev_1cell_Tras_LC|TrasBev_1cell_Tras_Light_Chain;Q7Z3Y4|Q7Z3Y4_HUMAN;TrasBev_1cell_v2_Tras_LC|TrasBev_1cellv2_Tras_Light_Chain;TrasBev_2cell_Tras_LC|TrasBev_2cell_Tras_Light_Chain;hC6D4_LC|hC6D4.hIgG1;A0A087WTX5|A0A087WTX5_HUMAN;Rybrevant_Met_LC|Amivantamab_Met_Light_Chain;Humira_LC|Adalimumab_LC;A0A087WZW8|A0A087WZW8_HUMAN;KLK5KLK7_KLK5_LC|KLK5KLK7_KLK5_Light_Chain;METMab_LC|Onartuzumab;A0A075B6H6|A0A075B6H6_HUMAN
    ##                     PTM                           AScore  Donor
    ##                  <char>                           <char> <char>
    ## 1: Carbamidomethylation C11:Carbamidomethylation:1001.00     D1
    ## 2: Carbamidomethylation C11:Carbamidomethylation:1001.00     D1
    ## 3: Carbamidomethylation C11:Carbamidomethylation:1001.00     D1
    ## 4: Carbamidomethylation C11:Carbamidomethylation:1001.00     D1
    ## 5: Carbamidomethylation C11:Carbamidomethylation:1001.00     D1
    ## 6: Carbamidomethylation C11:Carbamidomethylation:1001.00     D1

# Strip the sequence

This function takes outputs from multiple platform, a data frame with a column containing peptide sequences with modifications and converts it into a new dataframe with plain peptide sequences without modifications.

    # Strip the sequence
    striped_data_peaks <- strip_sequence(resulting_df, "Peptide", "Sequence", "PEAKS")
    head(striped_data_peaks)

    ## Key: <Source File>
    ##                                                                      Source File
    ##                                                                           <char>
    ## 1: 20230208_TTS1_ptran0117_OBJ42352_IDB001031_9D1_Boco_IP1_L243_MAPPs_1_1_1419.d
    ## 2: 20230208_TTS1_ptran0117_OBJ42352_IDB001031_9D1_Boco_IP1_L243_MAPPs_1_1_1419.d
    ## 3: 20230208_TTS1_ptran0117_OBJ42352_IDB001031_9D1_Boco_IP1_L243_MAPPs_1_1_1419.d
    ## 4: 20230208_TTS1_ptran0117_OBJ42352_IDB001031_9D1_Boco_IP1_L243_MAPPs_1_1_1419.d
    ## 5: 20230208_TTS1_ptran0117_OBJ42352_IDB001031_9D1_Boco_IP1_L243_MAPPs_1_1_1419.d
    ## 6: 20230208_TTS1_ptran0117_OBJ42352_IDB001031_9D1_Boco_IP1_L243_MAPPs_1_1_1419.d
    ##                           Peptide -10LgP     Mass Length Delta 1/k0   ppm
    ##                            <char>  <num>    <num>  <int>      <int> <num>
    ## 1:      ADYEKHKVYAC(+57.02)EVTHQG  26.08 2033.927     17          0   0.5
    ## 2:      ADYEKHKVYAC(+57.02)EVTHQG  43.32 2033.927     17          0   3.0
    ## 3:    ADYEKHKVYAC(+57.02)EVTHQGLS  37.61 2234.043     19          0   2.3
    ## 4:    ADYEKHKVYAC(+57.02)EVTHQGLS  26.73 2234.043     19          0   4.4
    ## 5:    ADYEKHKVYAC(+57.02)EVTHQGLS  44.82 2234.043     19          0   2.3
    ## 6: ADYEKHKVYAC(+57.02)EVTHQGLSSPV  29.12 2517.196     22          0   9.7
    ##         m/z     z      RT    1/k0 Range     Area Intensity    Scan Precursor Id
    ##       <num> <int>   <num>        <char>    <num>     <num>   <int>        <int>
    ## 1: 509.4939     4 31.9954 0.8114-0.8215 5554.165  73379.20 1591380        58236
    ## 2: 678.9911     3 31.9985 0.9191-0.9292 1305.469  18703.08 1591376        58232
    ## 3: 745.6968     3 39.5249 0.9050-0.9151 2653.591  38730.42 1978829        86021
    ## 4: 559.5256     4 39.5073 0.8272-0.8373 2627.366  78978.09 1978842        86034
    ## 5: 745.6968     3 39.5249 0.9066-0.9167 2653.591  38730.42 1980444        86112
    ## 6: 630.3182     4 48.1040 0.9272-0.9373       NA        NA 2430176       122840
    ##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   Accession
    ##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      <char>
    ## 1: A0A087WWV8|A0A087WWV8_HUMAN;Herceptin_LC|Trastuzumab_LC;aVb8-65_LC|aVb8-65_LC|aVb8-65_Light_Chain,;Tecentriq_LC|Atezolizumab_LC;Q6P5S8|Q6P5S8_HUMAN;Q5EFE6|Q5EFE6_HUMAN;V9HW34|V9HW34_HUMAN;JNJ61178104_TNFa_LC|JNJ61178104_TNFa_Light_Chain;Opdivo_LC|Nivolumab_LC;A0A087WYL9|A0A087WYL9_HUMAN;Rybrevant_EGFR_LC|Amivantamab_EGFR_Light_Chain;hA33_LC|hA33_LC;Herceptin_signalseqVHS_LC|Trastuzumab_signalseqVHS_LC;Tecentriq_signalseqNAYA_LC|Atezolizumab_signalseqNAYA_LC;Herceptin_signalseqNAYA_LC|Trastuzumab_signalseqNAYA_LC;JNJ61178104_TNFa_HC|JNJ61178104_TNFa_Heavy_Chain;Q6PJF2|Q6PJF2_HUMAN;Lemtrada_LC|Alemtuzumab_LC;Ly3415244_LC2|Ly3415244_Light_Chain_2;BocoBev_Bev_LC|BocoBev_Bev_Light_Chain;A0A087X130|A0A087X130_HUMAN;Praluent_LC|Alirocumab_LC;MPSK3169A_LC|MPSK3169A_LC;Keytruda_LC|Pembrolizumab_LC;Q8TCD0|Q8TCD0_HUMAN;Cosentyx_LC|Secukinumab_LC;Imfinzi_LC|Durvalumab_LC;Q6GMX0|Q6GMX0_HUMAN;Etrolizumab_LC|Etrolizumab;BocoBev_Boco_LC|BocoBev_Boco_Light_Chain;Tecentriq_signalseqVHS_LC|Atezolizumab_signlaseqVHS_LC;Q6PIL8|Q6PIL8_HUMAN;Q0KKI6|Q0KKI6_HUMAN;Remicade_LC|Infliximab_LC;Bococizumab_LC|Bococizumab_LC;P01834|IGKC_HUMAN;Libtayo_LC|Cemiplimab_LC;TrasBev_1cell_Tras_LC|TrasBev_1cell_Tras_Light_Chain;Q7Z3Y4|Q7Z3Y4_HUMAN;TrasBev_2cell_Tras_LC|TrasBev_2cell_Tras_Light_Chain;TrasBev_1cell_v2_Tras_LC|TrasBev_1cellv2_Tras_Light_Chain;hC6D4_LC|hC6D4.hIgG1;A0A087WTX5|A0A087WTX5_HUMAN;Rybrevant_Met_LC|Amivantamab_Met_Light_Chain;Humira_LC|Adalimumab_LC;A0A087WZW8|A0A087WZW8_HUMAN;KLK5KLK7_KLK5_LC|KLK5KLK7_KLK5_Light_Chain;METMab_LC|Onartuzumab;A0A075B6H6|A0A075B6H6_HUMAN
    ## 2: A0A087WWV8|A0A087WWV8_HUMAN;Herceptin_LC|Trastuzumab_LC;aVb8-65_LC|aVb8-65_LC|aVb8-65_Light_Chain,;Tecentriq_LC|Atezolizumab_LC;Q6P5S8|Q6P5S8_HUMAN;Q5EFE6|Q5EFE6_HUMAN;V9HW34|V9HW34_HUMAN;JNJ61178104_TNFa_LC|JNJ61178104_TNFa_Light_Chain;Opdivo_LC|Nivolumab_LC;A0A087WYL9|A0A087WYL9_HUMAN;Rybrevant_EGFR_LC|Amivantamab_EGFR_Light_Chain;hA33_LC|hA33_LC;Herceptin_signalseqVHS_LC|Trastuzumab_signalseqVHS_LC;Tecentriq_signalseqNAYA_LC|Atezolizumab_signalseqNAYA_LC;Herceptin_signalseqNAYA_LC|Trastuzumab_signalseqNAYA_LC;JNJ61178104_TNFa_HC|JNJ61178104_TNFa_Heavy_Chain;Q6PJF2|Q6PJF2_HUMAN;Lemtrada_LC|Alemtuzumab_LC;Ly3415244_LC2|Ly3415244_Light_Chain_2;BocoBev_Bev_LC|BocoBev_Bev_Light_Chain;A0A087X130|A0A087X130_HUMAN;Praluent_LC|Alirocumab_LC;MPSK3169A_LC|MPSK3169A_LC;Keytruda_LC|Pembrolizumab_LC;Q8TCD0|Q8TCD0_HUMAN;Cosentyx_LC|Secukinumab_LC;Imfinzi_LC|Durvalumab_LC;Q6GMX0|Q6GMX0_HUMAN;Etrolizumab_LC|Etrolizumab;BocoBev_Boco_LC|BocoBev_Boco_Light_Chain;Tecentriq_signalseqVHS_LC|Atezolizumab_signlaseqVHS_LC;Q6PIL8|Q6PIL8_HUMAN;Q0KKI6|Q0KKI6_HUMAN;Remicade_LC|Infliximab_LC;Bococizumab_LC|Bococizumab_LC;P01834|IGKC_HUMAN;Libtayo_LC|Cemiplimab_LC;TrasBev_1cell_Tras_LC|TrasBev_1cell_Tras_Light_Chain;Q7Z3Y4|Q7Z3Y4_HUMAN;TrasBev_2cell_Tras_LC|TrasBev_2cell_Tras_Light_Chain;TrasBev_1cell_v2_Tras_LC|TrasBev_1cellv2_Tras_Light_Chain;hC6D4_LC|hC6D4.hIgG1;A0A087WTX5|A0A087WTX5_HUMAN;Rybrevant_Met_LC|Amivantamab_Met_Light_Chain;Humira_LC|Adalimumab_LC;A0A087WZW8|A0A087WZW8_HUMAN;KLK5KLK7_KLK5_LC|KLK5KLK7_KLK5_Light_Chain;METMab_LC|Onartuzumab;A0A075B6H6|A0A075B6H6_HUMAN
    ## 3:                                                 Keytruda_LC|Pembrolizumab_LC;A0A087WWV8|A0A087WWV8_HUMAN;Q8TCD0|Q8TCD0_HUMAN;Imfinzi_LC|Durvalumab_LC;Cosentyx_LC|Secukinumab_LC;Q6GMX0|Q6GMX0_HUMAN;Herceptin_LC|Trastuzumab_LC;aVb8-65_LC|aVb8-65_LC|aVb8-65_Light_Chain,;Tecentriq_LC|Atezolizumab_LC;BocoBev_Boco_LC|BocoBev_Boco_Light_Chain;Tecentriq_signalseqVHS_LC|Atezolizumab_signlaseqVHS_LC;Q6PIL8|Q6PIL8_HUMAN;Q0KKI6|Q0KKI6_HUMAN;Q6P5S8|Q6P5S8_HUMAN;Q5EFE6|Q5EFE6_HUMAN;V9HW34|V9HW34_HUMAN;Remicade_LC|Infliximab_LC;Bococizumab_LC|Bococizumab_LC;JNJ61178104_TNFa_LC|JNJ61178104_TNFa_Light_Chain;P01834|IGKC_HUMAN;Libtayo_LC|Cemiplimab_LC;Opdivo_LC|Nivolumab_LC;A0A087WYL9|A0A087WYL9_HUMAN;TrasBev_1cell_Tras_LC|TrasBev_1cell_Tras_Light_Chain;Rybrevant_EGFR_LC|Amivantamab_EGFR_Light_Chain;Q7Z3Y4|Q7Z3Y4_HUMAN;TrasBev_1cell_v2_Tras_LC|TrasBev_1cellv2_Tras_Light_Chain;TrasBev_2cell_Tras_LC|TrasBev_2cell_Tras_Light_Chain;hA33_LC|hA33_LC;A0A087WTX5|A0A087WTX5_HUMAN;Herceptin_signalseqVHS_LC|Trastuzumab_signalseqVHS_LC;Tecentriq_signalseqNAYA_LC|Atezolizumab_signalseqNAYA_LC;Herceptin_signalseqNAYA_LC|Trastuzumab_signalseqNAYA_LC;JNJ61178104_TNFa_HC|JNJ61178104_TNFa_Heavy_Chain;Rybrevant_Met_LC|Amivantamab_Met_Light_Chain;Humira_LC|Adalimumab_LC;Q6PJF2|Q6PJF2_HUMAN;Lemtrada_LC|Alemtuzumab_LC;Ly3415244_LC2|Ly3415244_Light_Chain_2;BocoBev_Bev_LC|BocoBev_Bev_Light_Chain;A0A087X130|A0A087X130_HUMAN;Praluent_LC|Alirocumab_LC;A0A087WZW8|A0A087WZW8_HUMAN;KLK5KLK7_KLK5_LC|KLK5KLK7_KLK5_Light_Chain;METMab_LC|Onartuzumab;A0A075B6H6|A0A075B6H6_HUMAN;MPSK3169A_LC|MPSK3169A_LC
    ## 4:                                                 Keytruda_LC|Pembrolizumab_LC;A0A087WWV8|A0A087WWV8_HUMAN;Q8TCD0|Q8TCD0_HUMAN;Imfinzi_LC|Durvalumab_LC;Cosentyx_LC|Secukinumab_LC;Q6GMX0|Q6GMX0_HUMAN;Herceptin_LC|Trastuzumab_LC;aVb8-65_LC|aVb8-65_LC|aVb8-65_Light_Chain,;Tecentriq_LC|Atezolizumab_LC;BocoBev_Boco_LC|BocoBev_Boco_Light_Chain;Tecentriq_signalseqVHS_LC|Atezolizumab_signlaseqVHS_LC;Q6PIL8|Q6PIL8_HUMAN;Q0KKI6|Q0KKI6_HUMAN;Q6P5S8|Q6P5S8_HUMAN;Q5EFE6|Q5EFE6_HUMAN;V9HW34|V9HW34_HUMAN;Remicade_LC|Infliximab_LC;Bococizumab_LC|Bococizumab_LC;JNJ61178104_TNFa_LC|JNJ61178104_TNFa_Light_Chain;P01834|IGKC_HUMAN;Libtayo_LC|Cemiplimab_LC;Opdivo_LC|Nivolumab_LC;A0A087WYL9|A0A087WYL9_HUMAN;TrasBev_1cell_Tras_LC|TrasBev_1cell_Tras_Light_Chain;Rybrevant_EGFR_LC|Amivantamab_EGFR_Light_Chain;Q7Z3Y4|Q7Z3Y4_HUMAN;TrasBev_1cell_v2_Tras_LC|TrasBev_1cellv2_Tras_Light_Chain;TrasBev_2cell_Tras_LC|TrasBev_2cell_Tras_Light_Chain;hA33_LC|hA33_LC;A0A087WTX5|A0A087WTX5_HUMAN;Herceptin_signalseqVHS_LC|Trastuzumab_signalseqVHS_LC;Tecentriq_signalseqNAYA_LC|Atezolizumab_signalseqNAYA_LC;Herceptin_signalseqNAYA_LC|Trastuzumab_signalseqNAYA_LC;JNJ61178104_TNFa_HC|JNJ61178104_TNFa_Heavy_Chain;Rybrevant_Met_LC|Amivantamab_Met_Light_Chain;Humira_LC|Adalimumab_LC;Q6PJF2|Q6PJF2_HUMAN;Lemtrada_LC|Alemtuzumab_LC;Ly3415244_LC2|Ly3415244_Light_Chain_2;BocoBev_Bev_LC|BocoBev_Bev_Light_Chain;A0A087X130|A0A087X130_HUMAN;Praluent_LC|Alirocumab_LC;A0A087WZW8|A0A087WZW8_HUMAN;KLK5KLK7_KLK5_LC|KLK5KLK7_KLK5_Light_Chain;METMab_LC|Onartuzumab;A0A075B6H6|A0A075B6H6_HUMAN;MPSK3169A_LC|MPSK3169A_LC
    ## 5:                                                 Keytruda_LC|Pembrolizumab_LC;A0A087WWV8|A0A087WWV8_HUMAN;Q8TCD0|Q8TCD0_HUMAN;Imfinzi_LC|Durvalumab_LC;Cosentyx_LC|Secukinumab_LC;Q6GMX0|Q6GMX0_HUMAN;Herceptin_LC|Trastuzumab_LC;aVb8-65_LC|aVb8-65_LC|aVb8-65_Light_Chain,;Tecentriq_LC|Atezolizumab_LC;BocoBev_Boco_LC|BocoBev_Boco_Light_Chain;Tecentriq_signalseqVHS_LC|Atezolizumab_signlaseqVHS_LC;Q6PIL8|Q6PIL8_HUMAN;Q0KKI6|Q0KKI6_HUMAN;Q6P5S8|Q6P5S8_HUMAN;Q5EFE6|Q5EFE6_HUMAN;V9HW34|V9HW34_HUMAN;Remicade_LC|Infliximab_LC;Bococizumab_LC|Bococizumab_LC;JNJ61178104_TNFa_LC|JNJ61178104_TNFa_Light_Chain;P01834|IGKC_HUMAN;Libtayo_LC|Cemiplimab_LC;Opdivo_LC|Nivolumab_LC;A0A087WYL9|A0A087WYL9_HUMAN;TrasBev_1cell_Tras_LC|TrasBev_1cell_Tras_Light_Chain;Rybrevant_EGFR_LC|Amivantamab_EGFR_Light_Chain;Q7Z3Y4|Q7Z3Y4_HUMAN;TrasBev_1cell_v2_Tras_LC|TrasBev_1cellv2_Tras_Light_Chain;TrasBev_2cell_Tras_LC|TrasBev_2cell_Tras_Light_Chain;hA33_LC|hA33_LC;A0A087WTX5|A0A087WTX5_HUMAN;Herceptin_signalseqVHS_LC|Trastuzumab_signalseqVHS_LC;Tecentriq_signalseqNAYA_LC|Atezolizumab_signalseqNAYA_LC;Herceptin_signalseqNAYA_LC|Trastuzumab_signalseqNAYA_LC;JNJ61178104_TNFa_HC|JNJ61178104_TNFa_Heavy_Chain;Rybrevant_Met_LC|Amivantamab_Met_Light_Chain;Humira_LC|Adalimumab_LC;Q6PJF2|Q6PJF2_HUMAN;Lemtrada_LC|Alemtuzumab_LC;Ly3415244_LC2|Ly3415244_Light_Chain_2;BocoBev_Bev_LC|BocoBev_Bev_Light_Chain;A0A087X130|A0A087X130_HUMAN;Praluent_LC|Alirocumab_LC;A0A087WZW8|A0A087WZW8_HUMAN;KLK5KLK7_KLK5_LC|KLK5KLK7_KLK5_Light_Chain;METMab_LC|Onartuzumab;A0A075B6H6|A0A075B6H6_HUMAN;MPSK3169A_LC|MPSK3169A_LC
    ## 6: A0A087WWV8|A0A087WWV8_HUMAN;Herceptin_LC|Trastuzumab_LC;aVb8-65_LC|aVb8-65_LC|aVb8-65_Light_Chain,;Tecentriq_LC|Atezolizumab_LC;Q6P5S8|Q6P5S8_HUMAN;Q5EFE6|Q5EFE6_HUMAN;V9HW34|V9HW34_HUMAN;JNJ61178104_TNFa_LC|JNJ61178104_TNFa_Light_Chain;Opdivo_LC|Nivolumab_LC;A0A087WYL9|A0A087WYL9_HUMAN;Rybrevant_EGFR_LC|Amivantamab_EGFR_Light_Chain;hA33_LC|hA33_LC;Herceptin_signalseqVHS_LC|Trastuzumab_signalseqVHS_LC;Tecentriq_signalseqNAYA_LC|Atezolizumab_signalseqNAYA_LC;Herceptin_signalseqNAYA_LC|Trastuzumab_signalseqNAYA_LC;JNJ61178104_TNFa_HC|JNJ61178104_TNFa_Heavy_Chain;Q6PJF2|Q6PJF2_HUMAN;Lemtrada_LC|Alemtuzumab_LC;Ly3415244_LC2|Ly3415244_Light_Chain_2;BocoBev_Bev_LC|BocoBev_Bev_Light_Chain;A0A087X130|A0A087X130_HUMAN;Praluent_LC|Alirocumab_LC;MPSK3169A_LC|MPSK3169A_LC;Keytruda_LC|Pembrolizumab_LC;Q8TCD0|Q8TCD0_HUMAN;Imfinzi_LC|Durvalumab_LC;Cosentyx_LC|Secukinumab_LC;Q6GMX0|Q6GMX0_HUMAN;Etrolizumab_LC|Etrolizumab;BocoBev_Boco_LC|BocoBev_Boco_Light_Chain;Tecentriq_signalseqVHS_LC|Atezolizumab_signlaseqVHS_LC;Q6PIL8|Q6PIL8_HUMAN;Q0KKI6|Q0KKI6_HUMAN;Remicade_LC|Infliximab_LC;Bococizumab_LC|Bococizumab_LC;P01834|IGKC_HUMAN;Libtayo_LC|Cemiplimab_LC;TrasBev_1cell_Tras_LC|TrasBev_1cell_Tras_Light_Chain;Q7Z3Y4|Q7Z3Y4_HUMAN;TrasBev_1cell_v2_Tras_LC|TrasBev_1cellv2_Tras_Light_Chain;TrasBev_2cell_Tras_LC|TrasBev_2cell_Tras_Light_Chain;hC6D4_LC|hC6D4.hIgG1;A0A087WTX5|A0A087WTX5_HUMAN;Rybrevant_Met_LC|Amivantamab_Met_Light_Chain;Humira_LC|Adalimumab_LC;A0A087WZW8|A0A087WZW8_HUMAN;KLK5KLK7_KLK5_LC|KLK5KLK7_KLK5_Light_Chain;METMab_LC|Onartuzumab;A0A075B6H6|A0A075B6H6_HUMAN
    ##                     PTM                           AScore  Donor
    ##                  <char>                           <char> <char>
    ## 1: Carbamidomethylation C11:Carbamidomethylation:1001.00     D1
    ## 2: Carbamidomethylation C11:Carbamidomethylation:1001.00     D1
    ## 3: Carbamidomethylation C11:Carbamidomethylation:1001.00     D1
    ## 4: Carbamidomethylation C11:Carbamidomethylation:1001.00     D1
    ## 5: Carbamidomethylation C11:Carbamidomethylation:1001.00     D1
    ## 6: Carbamidomethylation C11:Carbamidomethylation:1001.00     D1
    ##                  Sequence
    ##                    <char>
    ## 1:      ADYEKHKVYACEVTHQG
    ## 2:      ADYEKHKVYACEVTHQG
    ## 3:    ADYEKHKVYACEVTHQGLS
    ## 4:    ADYEKHKVYACEVTHQGLS
    ## 5:    ADYEKHKVYACEVTHQGLS
    ## 6: ADYEKHKVYACEVTHQGLSSPV

# Extract modifications information

This function takes outputs from multiple platform, a data frame with a column containing modified peptide sequence with the detailed post translational modification(PTM) information and converts it into a new dataframe with plain peptide sequences and associated PTM information.

    # Extract modifications information
    PTM_table <- data.frame(PTM_mass = c("15.99", "0.98", "57.02", "42.01"),
                            PTM_type = c("Ox", "Deamid", "Cam", "Acetyl"))
    converted_data_peaks <- obtain_mod(
      striped_data_peaks,
      "Peptide",
      "PEAKS",
      seq_column = NULL,
      PTM_table,
      PTM_annotation = TRUE,
      PTM_mass_column = "PTM_mass"
    )
    head(converted_data_peaks)

    ## Key: <PTM_mass>
    ##    PTM_mass PTM_position  reps
    ##      <char>        <num> <num>
    ## 1:     <NA>           NA     1
    ## 2:     <NA>           NA     1
    ## 3:     <NA>           NA     1
    ## 4:     <NA>           NA     1
    ## 5:     <NA>           NA     1
    ## 6:     <NA>           NA     1
    ##                                                                      Source File
    ##                                                                           <char>
    ## 1: 20230208_TTS1_ptran0117_OBJ42352_IDB001031_9D1_Boco_IP1_L243_MAPPs_1_1_1419.d
    ## 2: 20230208_TTS1_ptran0117_OBJ42352_IDB001031_9D1_Boco_IP1_L243_MAPPs_1_1_1419.d
    ## 3: 20230208_TTS1_ptran0117_OBJ42352_IDB001031_9D1_Boco_IP1_L243_MAPPs_1_1_1419.d
    ## 4: 20230208_TTS1_ptran0117_OBJ42352_IDB001031_9D1_Boco_IP1_L243_MAPPs_1_1_1419.d
    ## 5: 20230208_TTS1_ptran0117_OBJ42352_IDB001031_9D1_Boco_IP1_L243_MAPPs_1_1_1419.d
    ## 6: 20230208_TTS1_ptran0117_OBJ42352_IDB001031_9D1_Boco_IP1_L243_MAPPs_1_1_1419.d
    ##                Peptide -10LgP     Mass Length Delta 1/k0   ppm      m/z     z
    ##                 <char>  <num>    <num>  <int>      <int> <num>    <num> <int>
    ## 1: AENTLQSFRQDVDNASLAR  26.93 2134.040     19          0   0.9 712.3613     3
    ## 2:     AKVQWKVDNALQSGN  32.89 1656.858     15          0  -0.1 829.4441     2
    ## 3:      AKVQWKVDNALQSG  24.38 1542.815     14          0   3.9 772.4252     2
    ## 4:    AKVQWKVDNALQSGNS  46.89 1743.890     16          0   6.4 872.9662     2
    ## 5:    AKVQWKVDNALQSGNS  42.78 1743.890     16          0   6.4 872.9662     2
    ## 6:    AKVQWKVDNALQSGNS  39.31 1743.890     16          0   6.4 872.9662     2
    ##         RT    1/k0 Range       Area  Intensity    Scan Precursor Id
    ##      <num>        <char>      <num>      <num>   <int>        <int>
    ## 1: 64.0846 0.9642-0.9743   802.0634   9006.403 3270489       198105
    ## 2: 51.1203 1.0806-1.0907  1093.7975  12566.528 2586900       136308
    ## 3: 51.9183 1.0480-1.0581         NA         NA 2630329       140113
    ## 4: 50.9561 1.0983-1.1084 32295.9060 333551.380 2576838       135390
    ## 5: 50.9561 1.0951-1.1051 32295.9060 333551.380 2575164       135240
    ## 6: 50.9561 1.0999-1.1100 32295.9060 333551.380 2575182       135258
    ##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           Accession
    ##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              <char>
    ## 1:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        B0YJC5|B0YJC5_HUMAN;Q5JVS8|Q5JVS8_HUMAN;B0YJC4|B0YJC4_HUMAN;P08670|VIME_HUMAN;Q53HU8|Q53HU8_HUMAN;B3KRK8|B3KRK8_HUMAN;V9HWE1|V9HWE1_HUMAN
    ## 2: A0A087WWV8|A0A087WWV8_HUMAN;S6B2A1|S6B2A1_HUMAN;S6AWF4|S6AWF4_HUMAN;Herceptin_LC|Trastuzumab_LC;aVb8-65_LC|aVb8-65_LC|aVb8-65_Light_Chain,;Tecentriq_LC|Atezolizumab_LC;Q6P5S8|Q6P5S8_HUMAN;Q5EFE6|Q5EFE6_HUMAN;V9HW34|V9HW34_HUMAN;Q569I7|Q569I7_HUMAN;JNJ61178104_TNFa_LC|JNJ61178104_TNFa_Light_Chain;Opdivo_LC|Nivolumab_LC;A0A087WYL9|A0A087WYL9_HUMAN;Rybrevant_EGFR_LC|Amivantamab_EGFR_Light_Chain;S6AWD6|S6AWD6_HUMAN;hA33_LC|hA33_LC;Herceptin_signalseqVHS_LC|Trastuzumab_signalseqVHS_LC;Tecentriq_signalseqNAYA_LC|Atezolizumab_signalseqNAYA_LC;Herceptin_signalseqNAYA_LC|Trastuzumab_signalseqNAYA_LC;Lemtrada_LC|Alemtuzumab_LC;Q6PJF2|Q6PJF2_HUMAN;Ly3415244_LC2|Ly3415244_Light_Chain_2;BocoBev_Bev_LC|BocoBev_Bev_Light_Chain;A0A087X130|A0A087X130_HUMAN;Praluent_LC|Alirocumab_LC;MPSK3169A_LC|MPSK3169A_LC;Keytruda_LC|Pembrolizumab_LC;Q8TCD0|Q8TCD0_HUMAN;S6AWE3|S6AWE3_HUMAN;Imfinzi_LC|Durvalumab_LC;Q6GMX0|Q6GMX0_HUMAN;S6B2C3|S6B2C3_HUMAN;BocoBev_Boco_LC|BocoBev_Boco_Light_Chain;Tecentriq_signalseqVHS_LC|Atezolizumab_signlaseqVHS_LC;Q6PIL8|Q6PIL8_HUMAN;Q0KKI6|Q0KKI6_HUMAN;Remicade_LC|Infliximab_LC;Bococizumab_LC|Bococizumab_LC;P01834|IGKC_HUMAN;Libtayo_LC|Cemiplimab_LC;S6BGE9|S6BGE9_HUMAN;Q7Z3Y4|Q7Z3Y4_HUMAN;TrasBev_2cell_Tras_LC|TrasBev_2cell_Tras_Light_Chain;A0A087WTX5|A0A087WTX5_HUMAN;Humira_LC|Adalimumab_LC;S6AWD3|S6AWD3_HUMAN;A0A087WZW8|A0A087WZW8_HUMAN;KLK5KLK7_KLK5_LC|KLK5KLK7_KLK5_Light_Chain;METMab_LC|Onartuzumab;A0A075B6H6|A0A075B6H6_HUMAN
    ## 3: A0A087WWV8|A0A087WWV8_HUMAN;S6B2A1|S6B2A1_HUMAN;S6AWF4|S6AWF4_HUMAN;Herceptin_LC|Trastuzumab_LC;aVb8-65_LC|aVb8-65_LC|aVb8-65_Light_Chain,;Tecentriq_LC|Atezolizumab_LC;Q6P5S8|Q6P5S8_HUMAN;Q5EFE6|Q5EFE6_HUMAN;V9HW34|V9HW34_HUMAN;Q569I7|Q569I7_HUMAN;JNJ61178104_TNFa_LC|JNJ61178104_TNFa_Light_Chain;Opdivo_LC|Nivolumab_LC;A0A087WYL9|A0A087WYL9_HUMAN;Rybrevant_EGFR_LC|Amivantamab_EGFR_Light_Chain;S6AWD6|S6AWD6_HUMAN;hA33_LC|hA33_LC;Herceptin_signalseqVHS_LC|Trastuzumab_signalseqVHS_LC;Tecentriq_signalseqNAYA_LC|Atezolizumab_signalseqNAYA_LC;Herceptin_signalseqNAYA_LC|Trastuzumab_signalseqNAYA_LC;Lemtrada_LC|Alemtuzumab_LC;Q6PJF2|Q6PJF2_HUMAN;Ly3415244_LC2|Ly3415244_Light_Chain_2;BocoBev_Bev_LC|BocoBev_Bev_Light_Chain;A0A087X130|A0A087X130_HUMAN;Praluent_LC|Alirocumab_LC;MPSK3169A_LC|MPSK3169A_LC;Keytruda_LC|Pembrolizumab_LC;Q8TCD0|Q8TCD0_HUMAN;S6AWE3|S6AWE3_HUMAN;Imfinzi_LC|Durvalumab_LC;Q6GMX0|Q6GMX0_HUMAN;S6B2C3|S6B2C3_HUMAN;BocoBev_Boco_LC|BocoBev_Boco_Light_Chain;Tecentriq_signalseqVHS_LC|Atezolizumab_signlaseqVHS_LC;Q6PIL8|Q6PIL8_HUMAN;Q0KKI6|Q0KKI6_HUMAN;Remicade_LC|Infliximab_LC;Bococizumab_LC|Bococizumab_LC;P01834|IGKC_HUMAN;Libtayo_LC|Cemiplimab_LC;S6BGE9|S6BGE9_HUMAN;Q7Z3Y4|Q7Z3Y4_HUMAN;TrasBev_2cell_Tras_LC|TrasBev_2cell_Tras_Light_Chain;A0A087WTX5|A0A087WTX5_HUMAN;Humira_LC|Adalimumab_LC;S6AWD3|S6AWD3_HUMAN;A0A087WZW8|A0A087WZW8_HUMAN;KLK5KLK7_KLK5_LC|KLK5KLK7_KLK5_Light_Chain;METMab_LC|Onartuzumab;A0A075B6H6|A0A075B6H6_HUMAN
    ## 4:                                                             Keytruda_LC|Pembrolizumab_LC;A0A087WWV8|A0A087WWV8_HUMAN;Q8TCD0|Q8TCD0_HUMAN;S6AWE3|S6AWE3_HUMAN;Imfinzi_LC|Durvalumab_LC;Q6GMX0|Q6GMX0_HUMAN;Herceptin_LC|Trastuzumab_LC;aVb8-65_LC|aVb8-65_LC|aVb8-65_Light_Chain,;S6B2C3|S6B2C3_HUMAN;Tecentriq_LC|Atezolizumab_LC;BocoBev_Boco_LC|BocoBev_Boco_Light_Chain;Tecentriq_signalseqVHS_LC|Atezolizumab_signlaseqVHS_LC;Q6PIL8|Q6PIL8_HUMAN;Q0KKI6|Q0KKI6_HUMAN;Q6P5S8|Q6P5S8_HUMAN;Q5EFE6|Q5EFE6_HUMAN;V9HW34|V9HW34_HUMAN;Remicade_LC|Infliximab_LC;Q569I7|Q569I7_HUMAN;Bococizumab_LC|Bococizumab_LC;JNJ61178104_TNFa_LC|JNJ61178104_TNFa_Light_Chain;P01834|IGKC_HUMAN;Libtayo_LC|Cemiplimab_LC;Opdivo_LC|Nivolumab_LC;A0A087WYL9|A0A087WYL9_HUMAN;S6BGE9|S6BGE9_HUMAN;Rybrevant_EGFR_LC|Amivantamab_EGFR_Light_Chain;hA33_LC|hA33_LC;Q7Z3Y4|Q7Z3Y4_HUMAN;TrasBev_2cell_Tras_LC|TrasBev_2cell_Tras_Light_Chain;A0A087WTX5|A0A087WTX5_HUMAN;Herceptin_signalseqVHS_LC|Trastuzumab_signalseqVHS_LC;Tecentriq_signalseqNAYA_LC|Atezolizumab_signalseqNAYA_LC;Herceptin_signalseqNAYA_LC|Trastuzumab_signalseqNAYA_LC;Lemtrada_LC|Alemtuzumab_LC;Q6PJF2|Q6PJF2_HUMAN;Humira_LC|Adalimumab_LC;Ly3415244_LC2|Ly3415244_Light_Chain_2;BocoBev_Bev_LC|BocoBev_Bev_Light_Chain;A0A087X130|A0A087X130_HUMAN;Praluent_LC|Alirocumab_LC;S6AWD3|S6AWD3_HUMAN;A0A087WZW8|A0A087WZW8_HUMAN;KLK5KLK7_KLK5_LC|KLK5KLK7_KLK5_Light_Chain;METMab_LC|Onartuzumab;A0A075B6H6|A0A075B6H6_HUMAN;MPSK3169A_LC|MPSK3169A_LC
    ## 5:                                                             Keytruda_LC|Pembrolizumab_LC;A0A087WWV8|A0A087WWV8_HUMAN;Q8TCD0|Q8TCD0_HUMAN;S6AWE3|S6AWE3_HUMAN;Imfinzi_LC|Durvalumab_LC;Q6GMX0|Q6GMX0_HUMAN;Herceptin_LC|Trastuzumab_LC;aVb8-65_LC|aVb8-65_LC|aVb8-65_Light_Chain,;S6B2C3|S6B2C3_HUMAN;Tecentriq_LC|Atezolizumab_LC;BocoBev_Boco_LC|BocoBev_Boco_Light_Chain;Tecentriq_signalseqVHS_LC|Atezolizumab_signlaseqVHS_LC;Q6PIL8|Q6PIL8_HUMAN;Q0KKI6|Q0KKI6_HUMAN;Q6P5S8|Q6P5S8_HUMAN;Q5EFE6|Q5EFE6_HUMAN;V9HW34|V9HW34_HUMAN;Remicade_LC|Infliximab_LC;Q569I7|Q569I7_HUMAN;Bococizumab_LC|Bococizumab_LC;JNJ61178104_TNFa_LC|JNJ61178104_TNFa_Light_Chain;P01834|IGKC_HUMAN;Libtayo_LC|Cemiplimab_LC;Opdivo_LC|Nivolumab_LC;A0A087WYL9|A0A087WYL9_HUMAN;S6BGE9|S6BGE9_HUMAN;Rybrevant_EGFR_LC|Amivantamab_EGFR_Light_Chain;hA33_LC|hA33_LC;Q7Z3Y4|Q7Z3Y4_HUMAN;TrasBev_2cell_Tras_LC|TrasBev_2cell_Tras_Light_Chain;A0A087WTX5|A0A087WTX5_HUMAN;Herceptin_signalseqVHS_LC|Trastuzumab_signalseqVHS_LC;Tecentriq_signalseqNAYA_LC|Atezolizumab_signalseqNAYA_LC;Herceptin_signalseqNAYA_LC|Trastuzumab_signalseqNAYA_LC;Lemtrada_LC|Alemtuzumab_LC;Q6PJF2|Q6PJF2_HUMAN;Humira_LC|Adalimumab_LC;Ly3415244_LC2|Ly3415244_Light_Chain_2;BocoBev_Bev_LC|BocoBev_Bev_Light_Chain;A0A087X130|A0A087X130_HUMAN;Praluent_LC|Alirocumab_LC;S6AWD3|S6AWD3_HUMAN;A0A087WZW8|A0A087WZW8_HUMAN;KLK5KLK7_KLK5_LC|KLK5KLK7_KLK5_Light_Chain;METMab_LC|Onartuzumab;A0A075B6H6|A0A075B6H6_HUMAN;MPSK3169A_LC|MPSK3169A_LC
    ## 6:                                                             Keytruda_LC|Pembrolizumab_LC;A0A087WWV8|A0A087WWV8_HUMAN;Q8TCD0|Q8TCD0_HUMAN;S6AWE3|S6AWE3_HUMAN;Imfinzi_LC|Durvalumab_LC;Q6GMX0|Q6GMX0_HUMAN;Herceptin_LC|Trastuzumab_LC;aVb8-65_LC|aVb8-65_LC|aVb8-65_Light_Chain,;S6B2C3|S6B2C3_HUMAN;Tecentriq_LC|Atezolizumab_LC;BocoBev_Boco_LC|BocoBev_Boco_Light_Chain;Tecentriq_signalseqVHS_LC|Atezolizumab_signlaseqVHS_LC;Q6PIL8|Q6PIL8_HUMAN;Q0KKI6|Q0KKI6_HUMAN;Q6P5S8|Q6P5S8_HUMAN;Q5EFE6|Q5EFE6_HUMAN;V9HW34|V9HW34_HUMAN;Remicade_LC|Infliximab_LC;Q569I7|Q569I7_HUMAN;Bococizumab_LC|Bococizumab_LC;JNJ61178104_TNFa_LC|JNJ61178104_TNFa_Light_Chain;P01834|IGKC_HUMAN;Libtayo_LC|Cemiplimab_LC;Opdivo_LC|Nivolumab_LC;A0A087WYL9|A0A087WYL9_HUMAN;S6BGE9|S6BGE9_HUMAN;Rybrevant_EGFR_LC|Amivantamab_EGFR_Light_Chain;hA33_LC|hA33_LC;Q7Z3Y4|Q7Z3Y4_HUMAN;TrasBev_2cell_Tras_LC|TrasBev_2cell_Tras_Light_Chain;A0A087WTX5|A0A087WTX5_HUMAN;Herceptin_signalseqVHS_LC|Trastuzumab_signalseqVHS_LC;Tecentriq_signalseqNAYA_LC|Atezolizumab_signalseqNAYA_LC;Herceptin_signalseqNAYA_LC|Trastuzumab_signalseqNAYA_LC;Lemtrada_LC|Alemtuzumab_LC;Q6PJF2|Q6PJF2_HUMAN;Humira_LC|Adalimumab_LC;Ly3415244_LC2|Ly3415244_Light_Chain_2;BocoBev_Bev_LC|BocoBev_Bev_Light_Chain;A0A087X130|A0A087X130_HUMAN;Praluent_LC|Alirocumab_LC;S6AWD3|S6AWD3_HUMAN;A0A087WZW8|A0A087WZW8_HUMAN;KLK5KLK7_KLK5_LC|KLK5KLK7_KLK5_Light_Chain;METMab_LC|Onartuzumab;A0A075B6H6|A0A075B6H6_HUMAN;MPSK3169A_LC|MPSK3169A_LC
    ##       PTM AScore  Donor            Sequence PTM_type
    ##    <char> <char> <char>              <char>   <char>
    ## 1:                   D1 AENTLQSFRQDVDNASLAR     <NA>
    ## 2:                   D1     AKVQWKVDNALQSGN     <NA>
    ## 3:                   D1      AKVQWKVDNALQSG     <NA>
    ## 4:                   D1    AKVQWKVDNALQSGNS     <NA>
    ## 5:                   D1    AKVQWKVDNALQSGNS     <NA>
    ## 6:                   D1    AKVQWKVDNALQSGNS     <NA>

# Match peptide sequence with provided sequence and calculate positions

This function matches peptide sequences from the ‘peptide_data’ data frame to corresponding provided whole sequences in the ‘whole_seq’ data frame. It calculates the start and end positions of the matched sequences and returns data frame with information about the matching positions.

    # Match peptide sequence with provided sequence and calculate positions
    whole_seq <- data.frame(
      Epitope = c("Boco", "Boco"),
      Chain = c("HC", "LC"),
      Region_Sequence = c("QVQLVQSGAEVKKPGASVKVSCKASGYTFTSYYMHWVRQAPGQGLEWMGEISPFGGRTNYNEKFKSRVTMTRDTSTSTVYMELSSLRSEDTAVYYCARERPLYASDLWGQGTTVTVSSASTKGPSVFPLAPCSRSTSESTAALGCLVKDYFPEPVTVSWNSGALTSGVHTFPAVLQSSGLYSLSSVVTVPSSNFGTQTYTCNVDHKPSNTKVDKTVERKCCVECPPCPAPPVAGPSVFLFPPKPKDTLMISRTPEVTCVVVDVSHEDPEVQFNWYVDGVEVHNAKTKPREEQFNSTFRVVSVLTVVHQDWLNGKEYKCKVSNKGLPSSIEKTISKTKGQPREPQVYTLPPSREEMTKNQVSLTCLVKGFYPSDIAVEWESNGQPENNYKTTPPMLDSDGSFFLYSKLTVDKSRWQQGNVFSCSVMHEALHNHYTQKSLSLSPGK",
                          "DIQMTQSPSSLSASVGDRVTITCRASQGISSALAWYQQKPGKAPKLLIYSASYRYTGVPSRFSGSGSGTDFTFTISSLQPEDIATYYCQQRYSLWRTFGQGTKLEIKRTVAAPSVFIFPPSDEQLKSGTASVVCLLNNFYPREAKVQWKVDNALQSGNSQESVTEQDSKDSTYSLSSTLTLSKADYEKHKVYACEVTHQGLSSPVTKSFNRGEC"
      )
    )
    matching_result <- match_and_calculate_positions(
      converted_data_peaks,
      'Sequence',
      whole_seq,
      match_columns = NULL,
      sequence_length = c(10, 30),
      column_keep = c(
        "PTM_mass",
        "PTM_position",
        "reps",
        "Area",
        "Donor",
        "PTM_type"
      )
    )
    head(matching_result)

    ##           Sequence PTM_mass PTM_position reps     Area Donor PTM_type Epitope
    ## 2  AKVQWKVDNALQSGN     <NA>         <NA>    1 1093.797    D1     <NA>    Boco
    ## 3   AKVQWKVDNALQSG     <NA>         <NA>    1     <NA>    D1     <NA>    Boco
    ## 4 AKVQWKVDNALQSGNS     <NA>         <NA>    1 32295.91    D1     <NA>    Boco
    ## 5 AKVQWKVDNALQSGNS     <NA>         <NA>    1 32295.91    D1     <NA>    Boco
    ## 6 AKVQWKVDNALQSGNS     <NA>         <NA>    1 32295.91    D1     <NA>    Boco
    ## 7 AKVQWKVDNALQSGNS     <NA>         <NA>    1 32295.91    D1     <NA>    Boco
    ##   Chain start_position end_position
    ## 2    LC            144          158
    ## 3    LC            144          157
    ## 4    LC            144          159
    ## 5    LC            144          159
    ## 6    LC            144          159
    ## 7    LC            144          159

# Quantify matched peptide sequences

This function takes peptide matching result and quantifies the matched peptide sequences based on the provided quantification method. If the quantification method is ‘PSM’, the function calculates the number of matched peptide sequences in each positions of the provided whole sequence. If the quantification method is ‘Area’, the function select the max value in area column of identical peptide sequences and calculates the sum of the areas of the matched peptide sequences in each positions of the provided whole sequence.

    # Quantify matched peptide sequences by PSM
    # Customize the matching_columns and distinct_columns variables to align with your dataset specifics.
    matching_columns = c("Chain", "Epitope")
    distinct_columns = c("Donor")

    data_with_psm <- peptide_quantification(
      whole_seq,
      matching_result,
      matching_columns,
      distinct_columns,
      quantify_method = "PSM",
      with_PTM = TRUE,
      reps = TRUE
    )
    head(data_with_psm)

    ##   Character Position Chain Epitope PSM Donor   PTM PTM_type
    ## 1         Q        1    HC    Boco   0    D1 FALSE     <NA>
    ## 2         V        2    HC    Boco   0    D1 FALSE     <NA>
    ## 3         Q        3    HC    Boco   0    D1 FALSE     <NA>
    ## 4         L        4    HC    Boco   0    D1 FALSE     <NA>
    ## 5         V        5    HC    Boco   0    D1 FALSE     <NA>
    ## 6         Q        6    HC    Boco   0    D1 FALSE     <NA>

# Plotting peptide in whole provided sequence

This function takes the quantified peptide data frame and plots the matched peptide sequences in the provided whole sequence. The function returns a ggplot object that visually represents the matched peptide sequences in the context of the entire sequence, allowing for comprehensive analysis and visualization.

Users have the flexibility to customize the presentation of sequences, deciding whether to separate them in the display. This can be achieved using the facet_nested function from ggplot2, which organizes sequences into distinct columns. For instance, users can separate heavy chain (HC) and light chain (LC) regions for major sequence categories by specifying them in the x_axis_vars parameters of the function. By default, facet_nested introduces spacing to ensure clear visual separation between facets. However, users can adjust these spaces through theme settings in ggplot2, using parameters like panel.spacing and strip.background to control the separation between subplots.

To maintain sequence continuity, users can define domains using a domain table, which enables the annotation of specific domains such as VH, CH1, CH2, CH3, VL, and CL. This approach ensures that continuous sequences are accurately depicted without unnecessary breaks, providing precise visual cues for domain boundaries.

    # Plotting peptide in whole provided sequence
    domain <- data.frame(
      domain_type = c("VH", "CH1", "CH2", "CH3", "VL", "CL", "CDR H1", "CDR H2", "CDR H3", "CDR L1", "CDR L2", "CDR L3"),
      Chain = c("HC", "HC", "HC", "HC",  "LC", "LC", "HC", "HC", "HC",  "LC", "LC", "LC"),
      Epitope = c("Boco", "Boco", "Boco", "Boco", "Boco", "Boco", "Boco", "Boco", "Boco", "Boco", "Boco", "Boco"),
      domain_start = c(1, 119, 229, 338, 1, 108, 26, 50, 97, 24, 50, 89),
      domain_end = c(118, 228, 337, 444, 107, 214, 35, 66, 107,  34, 56, 97),
      domain_color = c("black", "black", "black", "black", "black", "black", "#F8766D", "#B79F00", "#00BA38", "#00BFC4", "#619CFF", "#F564E3"),
      domain_fill_color = c("white", "white", "white", "white", "white", "white", "yellow", "yellow", "yellow", "yellow", "yellow", "yellow"),
      domain_label_y = c(1.7, 1.7, 1.7, 1.7, 1.7, 1.7, 1.4, 1.4, 1.4, 1.4, 1.4, 1.4)
    )
    x_axis_vars <- c("Chain")
    y_axis_vars <- c("Donor")
    column_order <- list(
        Donor = "D1,D2,D3,D4,D5,D6,D7,D8",
        Chain = "HC,LC"
    )
    PTM_color <- c(
      "Ox" = "red",
      "Deamid" = "cyan",
      "Cam" = "blue",
      "Acetyl" = "magenta"
    )
    label_filter = list(Donor = "D1")
    p_psm <- create_peptide_plot(
      data_with_psm,
      y_axis_vars,
      x_axis_vars,
      y_expand = c(0.2, 0.2),
      x_expand = c(0.5, 0.5),
      theme_options = list(legend.box = "horizontal", legend.position = "bottom"),
      labs_options = list(title = "PSM Plot", x = "Position", fill = "PSM"),
      color_fill_column = 'PSM',
      fill_gradient_options = list(),  # Set the limits for the color scale
      label_size = 1.3,
      add_domain = TRUE,
      domain = domain,
      domain_start_column = "domain_start",
      domain_end_column = "domain_end",
      domain_type_column = "domain_type",
      domain_border_color_column = "domain_color",
      domain_fill_color_column = "domain_fill_color",
      add_domain_label = TRUE,
      domain_label_size = 2,
      domain_label_y_column = "domain_label_y",
      domain_label_color = "black",
      PTM = TRUE,
      PTM_type_column = "PTM_type",
      PTM_color = PTM_color,
      add_label = TRUE,
      label_column = "Character",
      label_filter = label_filter,
      label_y = 1,
      column_order = column_order
    )
    print(p_psm)

# Launching the Shiny App

You can interactively explore your data and visualization options using the built-in Shiny application provided by PepMapViz. Simply run the following command in your R console to launch the app.

PepMapViz::run_pepmap_app()