Skip to content

pipasic - peptide intensity-weighted proteome abundance similarity correction

License

Notifications You must be signed in to change notification settings

duocang/pipasic

Repository files navigation

pipasic - peptide intensity-weighted proteome abundance similarity correction

Abstract

Metaproteomic analysis allows studying the interplay of organisms or functional groups and has become increasingly popular also for diagnostic purposes. However, difficulties arise due to the high sequence similarity between related organisms. Further, the state of conservation of proteins between species can be correlated with their expression level which can lead to significant bias in results and interpretation. These challenges are similar but not identical to the challenges arising in the analysis of metagenomic samples and require specific solutions.

We developed pipasic (peptide intensity-weighted proteome abundance similarity correction) as a tool which corrects identification and spectral counting based quantification results using peptide similarity estimation and expression level weighting within a non-negative lasso framework. pipasic has distinct advantages over approaches only regarding unique peptides or aggregating results to the lowest common ancestor, as demonstrated on examples of viral diagnostics and an acid mine drainage dataset.

Requirements

pipasic might be able to work with different software versions, but we tested it using the given configuration.

file structure

data
├── reference
│   ├── species1.fasta
│   ├── species1_decoy.fasta
│   ├── species2.fasta
│   └── species2_decoy.fasta
└── spectra
    └──example.mgf

Python 2.7 is a must.

  1. Install Anaconda ( conda command shoudl work in your console)

  2. conda create -n pipasic python=2.7.13 in consoele to create a new Python environment

  3. conda activate pipasic in console to activate your environment, named pipasic

Spectrum identification

Spectrum identification can be done with Inspect or Tide. We used the following versions:

Example run

Data has been prepared in local data folder, but you can download from here too.

Test InspecT

Automatized configuration and execution of Inspect peptide identification for a list of spectrum files and a list of reference proteomes.

Users can compile Inspect from source code by using make command (Linux/MacOS), or build Inspect.exe with Inspect.sln in Visual Studio (Windows). But you don’t need to do it at all.

# For Linux/MacOS
./inspect -i ./config_files/config_Inspect_py.txt -o ./example/data/example_species2_InspectOut.txt -r ./inspect/
# Windows
 InsPecT.exe -i ./config_files/config_Inspect_py.txt -o ./example/data/example_species2_InspectOut.txt -r ./inspect/

Result:

  1. example_species1_InspectOut.txt
  2. example_species2_InspectOut.txt
  3. .index and .trie file of database

Full workflow

  • Option 1

    Run console command:

    pip install pipasic==1.6
    pipasic example species1,species2 -s ./data/spectra/ -d ./data/reference/ -I  -o ./result/output -V
  • Option 2

    Run Python script:

    # Install independencies
    pip install -r requirements.txt
    # Change directory now.
    cd ./src/trunk # change directory to trunk folder
    python pipasic.py example species1,species2 -s ../data/spectra/ -d ../data/reference/ -I -o ../result/output -V
  • Option 3

    Run Docker

    Inside Docker image, there is a folder named shared, you can used -v to indicate the shared folder between Docker and host.

    The Python script in Docker will have the access to the content of the shared folder.

    File structure in host:

    container-data
    ├── reference
    │   ├── species1.fasta
    │   ├── species1_decoy.fasta
    │   └── species2.fasta
    └── spectra
        └──example.mgf

    File structure in Docker:

    shared
    ├── reference
    │   ├── species1.fasta
    │   ├── species1_decoy.fasta
    │   └── species2.fasta
    └── spectra
        └──example.mgf
    # ~/Downloads/pipasic_docker/container-data is the folder you save your spectra and db files
    docker build  -t  pipasic --no-cache .
    
    docker run --rm -v [path to container-data]:/pipasic/shared pipasic python ./pipasic_src/pipasic.py example species1,species2 -I -V -s ./shared/spectra/ -d ./shared/reference/  -o ./shared/output

Unit test

  1. Match spectra against database with Inspect

    python runInspect_user_config.py --easy True
    # Result: 
    # 1. example_species1_InspectOut.txt
    # 2. example_species2_InspectOut.txt
    # 3. .index and .trie file of database
  2. Extract selected information from InsPecT output files and produce a specified peptide identification (PSM) list for further analyses.

    python nspectparser.py --easy True 
    # Result:
    # 1. result_counts.dat: number of peptides not in decoy returned
    # 2. specified  peptide identification: 
  3. Search identified peptides in tryptic peptide list of a proteome in order to weight each peptide (return: path to output file with line structure: "weight sequence")

    python trypticpeptides.py --easy true
    # Result:
    # 1. peptides_species1.fasta:
    # 2. peptides_species2.fasta
  4. Todo

    1. Windows test

Details

Usage: pipasic.py SPECTRA DB [module options] [input and configuration options]

Overall pipasic calling tool, including:

  • weighted (always) and unweighted (optional) similarity estimation
  • correction, using matrix from similarity estimation
  • peptide Identification by InsPecT/Tide

SPECTRA: Comma-separated string of spectrum files (mgf) - without file-extension! DB: Comma-separated string of reference proteomes (fasta-files) - without file-extension! if -S or -I: decoy database must exist as db_name+"_decoy.fasta"

Options:

  -h, --help            show this help message and exit
  -U, --Unweighted      calculate unweighted similarities for all given
                        proteomes
  -I, --Identify        identify given spectra with all given proteomes
  -T, --Tide            use Tide instead of InsPecT
  -V                    Visualize results using matplotlib
  -o OUTFILE, --outfile=OUTFILE
                        Output filename for results. Also serves as trunk for
                        other result files (graphics, data).  [default:
                        results.txt]
  -s SPEC_DIR, --spec_dir=SPEC_DIR
                        Directory of SPECTRA (mgf) files. Search in current
                        directory, if not given. [default: none]
  -d DB_DIR, --db_dir=DB_DIR
                        Directory of proteinDBs. Search for DB files current
                        directory, if not given. [default: none]
  -m MODS, --mods=MODS  A string containing all modifications in question,
                        modification choice by filename if not given.
                        [default: none]
  -i INSP_DIR, --inspect_dir=INSP_DIR
                        Inspect directory. [default: none]
  -f FDR, --fdr_cutoff=FDR
                        False discovery rate cut-off for identification lists.
                        [default: 0.05]
  -l LABELS, --labels=LABELS
                        Comma-separated string of short names for organisms in
                        the reference proteomes. If not given, the file name
                        is used. [default: none]
  -N N, --N_spectra=N   Number of spectra in original dataset, comma-separated
                        list if multiple datasets. [default: none]
  -c COUNTS, --C_spectra=COUNTS
                        File containing numbers of spectra found by
                        identification (Numpy Array dump). [default: none]
  -q, --quiet           don\'t print status messages to stdout

License

Copyright (c) 2013, Martin S. Lindner, LindnerM@rki.de, and Anke Penzlin, Robert Koch-Institut, Germany, All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MARTIN S. LINDNER OR ANKE PENZLIN BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

About

pipasic - peptide intensity-weighted proteome abundance similarity correction

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published