Skip to main content

NuXL_rescore: rescoring pipeline for protein‐nucleic acid cross‐links.

Project description

NuXL_rescore

This repository created for percolator base rescoring investigations of protein-nucleic acid crosslinking protocols with the addition of retention time prediction features from fine-tuned deepLC models and predictions of MS2PIP base peak intensity features.
Siraj, A., Bouwmeester, R., Declercq, A., Welp, L., Chernev, A., Wulf, A., ... & Sachsenberg, T. (2024). Intensity and retention time prediction improves the rescoring of protein‐nucleic acid cross‐links. Proteomics, 24(8), 2300144. https://doi.org/10.1002/pmic.202300144



Usage

Command line interface

usage: nuxl_rescore run [-h] [-id id] [-rt_model rt_model] [-calibration calibration] [-model_path model_path]
                        [-unimod unimod] [-out out] [-ms2pip] [-ms2pip_rescore] [-perc_exec perc_exec]
                        [-perc_adapter perc_adapter] [-feat_out] [-ms2pip_path MS2PIP_PATH]
                        [-ms2pip_rescore_path MS2PIP_RESCORE_PATH] [-mgf MGF] [-peprec PEPREC] [-feat_config feat_config]
                        [-entrap] [-actual_db actual_db] [-plot_results]

options:
  -h, --help            show this help message and exit
  -id id                Input file (idXML format) …
  -rt_model rt_model    if None no RT feature consider
  -calibration calibration DeepLC calibration data path (.csv)
  -model_path model_path  model path with name like full_hc_Train_RNA_All
  -unimod unimod  unimod/NuXL modification example /unimod/unimod_to_formula.csv
  -out out output folder path
  -ms2pip               Extract ms2pip features {bool}
  -ms2pip_rescore       Extract ms2pip_rescore features {bool}
  -perc_exec perc_exec  percolater executable path (Full path)
  -perc_adapter perc_adapter
                        percolater Adapter path (Full path)
  -feat_out             Write all extra feature output file at Out-folder (.csv)
  -ms2pip_path ms2pip_path
                        MS2PIP features file path (.csv file)
  -ms2pip_rescore_path ms2pip_rescore_path
                        MS2PIP rescore features file path (.pin file)
  -mgf mgf              Path for mgf file (.mgf file) need for MS2Rescore if results files not given
  -peprec peprec        Path for peprec (.peprec file) need for MS2Rescore if file not given generate from idXML
  -feat_config feat_config
                        Path for feature config (.json file) need for features used for rescoring
  -entrap               Entrapment testing {bool}
  -actual_db actual_db  Path for database (.fasta file) actual protein correspond to actual protocol
  -plot_results Plots PseudoROC comparison plot, percolator weight plot {bool}

What format of file should be given for analysis?

.idXML format of identification file
For extraction of MS2PIP intensities or MS2Rescore features
.peprec if not given, will generated from idXML
.mgf require
If already MS2Rescore features extracted
.pin MS2Rescore feature file

How to do different analysis?

Used only retention time features in rescoring

nuxl_rescore run -id -model_path -unimod -calibration -perc_exec -perc_adapter -out

Used only intensity features in rescoring

nuxl_rescore run -id -rt_model None -perc_exec -perc_adapter -out -ms2pip (store_true) -ms2pip_path or -mgf

Used only MS2Rescore features in rescoring

nuxl_rescore run -id -rt_model None -perc_exec -perc_adapter -out -ms2pip_rescore (store_true) -ms2pip_rescore_path or -mgf

*will work for adaptation of multiple features e-g RT+intensities as

nuxl_rescore run -id model_path -calibration -unimod -perc_exec -perc_adapter -out -ms2pip (store_true) -ms2pip_path or -mgf

entrapment testing

nuxl_rescore run.py -entrap (store_true) -actual_db (actual database of sample)

Feature configuration

The corresponding features can be update from features-config.json

  { 
  "RT_features": ["rt_diff", "rt_diff_best", "observed_retention_time_best", "predicted_retention_time_best"],
  "MSPIP_features":["ions_series", "ions_mz", "ions_pred", "ions_targ"],
  "//comment": "ions extract from MSPIP_features with no. of ions_b, ions_y e-g b1, b2, b3 & y1, y2, y3",
  "ions_b":3, 
  "ions_y":3, 
  "//comment": "specify in intensities so, it will extract correspondings _pred: predictions ; _targ: Target ; _diff: Target - predictions; _mz: M/Z of intensities of ions, if want all feat leave empty, b_y_corr compulsory",
  "intensities":["b_y_corr"],
  "//comment": "please specify, if want to use all ions intensity correlation or not", 
  "corr_all": false,
  "MSPIP_rescore_features":["spec_pearson_norm", "ionb_pearson_norm", "iony_pearson_norm", "spec_mse_norm", "ionb_mse_norm", 
                            "iony_mse_norm", "min_abs_diff_norm",	"max_abs_diff_norm", "abs_diff_Q1_norm", 
                            "abs_diff_Q2_norm", "abs_diff_Q3_norm", "mean_abs_diff_norm", "std_abs_diff_norm",
                           	"ionb_min_abs_diff_norm", "ionb_max_abs_diff_norm", "ionb_abs_diff_Q1_norm", 
                            "ionb_abs_diff_Q2_norm", "ionb_abs_diff_Q3_norm", "ionb_mean_abs_diff_norm", 
                            "ionb_std_abs_diff_norm",	"iony_min_abs_diff_norm", "iony_max_abs_diff_norm", 
                            "iony_abs_diff_Q1_norm", "iony_abs_diff_Q2_norm", "iony_abs_diff_Q3_norm", 
                            "iony_mean_abs_diff_norm",	"iony_std_abs_diff_norm", "dotprod_norm", "dotprod_ionb_norm",
                            "dotprod_iony_norm", "cos_norm", "cos_ionb_norm", "cos_iony_norm", "spec_pearson",	
                            "ionb_pearson", "iony_pearson", "spec_spearman", "ionb_spearman", "iony_spearman", 
                            "spec_mse", "ionb_mse", "iony_mse", "min_abs_diff_iontype",	"max_abs_diff_iontype", 
                            "min_abs_diff", "max_abs_diff", "abs_diff_Q1", "abs_diff_Q2", "abs_diff_Q3", "mean_abs_diff", 
                            "std_abs_diff", "ionb_min_abs_diff",	"ionb_max_abs_diff", "ionb_abs_diff_Q1", "ionb_abs_diff_Q2", 
                            "ionb_abs_diff_Q3", "ionb_mean_abs_diff", "ionb_std_abs_diff", "iony_min_abs_diff", 
                            "iony_max_abs_diff", "iony_abs_diff_Q1", "iony_abs_diff_Q2", "iony_abs_diff_Q3", "iony_mean_abs_diff", 
                            "iony_std_abs_diff", "dotprod", "dotprod_ionb", "dotprod_iony", "cos", "cos_ionb",	"cos_iony"],
  "//comment": "modification for ms2pip e-g Carbamidomethyl,57.021464,opt,C ",
  "ms2pip_mod":["Oxidation,15.994915,opt,M"] 
  }
}

Output

Rescoring analysis output

Not included any extra features in rescoring

 1% XL FDR XLs and peptides output (will be the same name of input file name)

Included extra features in rescoring

 1% XL FDR XLs and peptides output (start with updated_ input file name)

Extra file

  All_extra_features.csv, percolator.weights, percolator feature plot, 1% XL FDR report (.csv)
*All identifications ouput files will be in .idXML format

Fine tunning and feature extraction

Fine tunning for protein-RNA XL protocols

we fine tunned one generic and four specific models (4SU, UV, NM, and DEB) with the help DeepLCRetrainer
The set of three models are used to finetunned for protein-RNA crosslinking protocols as

models = deeplcretrainer.retrain(
    [df_train_file], #traning file DeepLC format
    mods_transfer_learning=[
        base_model +"/full_hc_train_1fd8363d9af9dcad3be7553c39396960.hdf5",
        base_model +"/full_hc_train_8c22d89667368f2f02ad996469ba157e.hdf5",
        base_model +"/full_hc_train_cb975cfdd4105f97efa0b3afffe075cc.hdf5"
    ],
    #other hyper parameters
)

Taking predictions from fine-tunned model

The set of three fine tunned models are used to take predictions from generic/specific models with the help of DeepLC as

dlc = DeepLC(
        path_model=[
                generic_model + "/full_hc_Train_RNA_All_1fd8363d9af9dcad3be7553c39396960.hdf5",
                generic_model + "/full_hc_Train_RNA_All_8c22d89667368f2f02ad996469ba157e.hdf5",
                generic_model + "/full_hc_Train_RNA_All_cb975cfdd4105f97efa0b3afffe075cc.hdf5"
        ]
        
)

Intensities and MS2Rescore feature

we extract the MS2PIP intensities and MS2Rescore features from MS2Rescore repository, the config file as

CONFIG = {  'ms2rescore': 
                {   'tmp_path': '', 
                    'spectrum_path': mgf_file, 
                    'output_path': out_pin_file,
                    'psm_file': psm_file,
                    'psm_id_pattern': None, 
                    'spectrum_id_pattern': ".*_(controllerType=0 controllerNumber=1 scan=[0-9]+)_.*", 
                    'num_cpu': 32}, 
                'ms2pip': {
                    'model': 'HCD', 
                    'frag_error': 0.02}
        }

Run example script

Create environment

conda create -n "nuxl_rescore_env" python==3.10
conda activate nuxl_rescore_env
pip install nuxl-rescore==0.4.0

then run the nuxl_rescore pipline from example_script/run_rescore_pipeline.py. it will automatically download the nuxl_rescore resources and example files.
here is the example files and nuxl_rescore resources: https://github.com/Arslan-Siraj/NuXL_rescore_resources/tree/main

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nuxl_rescore-0.4.0.tar.gz (37.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nuxl_rescore-0.4.0-py3-none-any.whl (36.1 kB view details)

Uploaded Python 3

File details

Details for the file nuxl_rescore-0.4.0.tar.gz.

File metadata

  • Download URL: nuxl_rescore-0.4.0.tar.gz
  • Upload date:
  • Size: 37.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.12

File hashes

Hashes for nuxl_rescore-0.4.0.tar.gz
Algorithm Hash digest
SHA256 86e459f93e1fc8a9b2a37bb46f6f2d5055c41452fdca2c20d6f08f01d628c22a
MD5 7743491d30439801a52aad4e99b90316
BLAKE2b-256 38fc825b4ebd394bc336c4cbdcb424c9556158852e6718cadd42d1901a85e329

See more details on using hashes here.

File details

Details for the file nuxl_rescore-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: nuxl_rescore-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 36.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.12

File hashes

Hashes for nuxl_rescore-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 19dd729263bddb7119e288cfeaa4b7c91cf2efc3485a01c3ab6d143567e4af13
MD5 9385fcd37e61f85b9e1f7cbbe0155c85
BLAKE2b-256 e19da1ff8dd8184efc500398468b67bd5da987254026b8808f5416d3a30a829f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page