PyQuant

Download .zip View on GitHub

What is PyQuant?

PyQuant is a versatile tool for an assortment of mass spectrometry based analyses.

Installation Options

Docker

Those who are comfortable using Docker may run PyQuant via the image at chrismit7/pyquant.
One point to remember is that folders on your local drive must be mounted in docker. For instance, if your files are located at /home/chris/msexperiment, you would run docker as such: docker run -v /home/chris/msexperiment:/msexperiment chrismit7/pyquant --search-file /msexperiment/search_file.msf -o /msexperiment/pyquant_results

Mac/Linux

For mac and linux OS's, pip install pyquant-ms should be sufficient to install PyQuant (provided you have pip installed).

Windows

The easiest way

Use Docker

The easier way

This approach may not work for every configuration, but is considerably less involved.

  1. Install anaconda 64 bit for python 2.7: continuum.io/downloads#windows
  2. In the terminal: pip install pyquant-ms
  3. Confirm you can view PyQuant via pyQuant --help

The hard way

The difficult aspect of building on Windows is setting up a compilation environment. Those unfamiliar with compilation on Windows should seek someone comfortable with doing so.
To ease this pain, we recommend using the Anaconda python 2.7 distribution.
The steps here should be followed to get a working Cython installation on Windows:
https://github.com/cython/cython/wiki/InstallingOnWindows
For brevity, they are summarized here, but are not guaranteed to be up to date:

  1. conda install cython
  2. Install Microsoft Visual C++ Compiler for Python 2.7
  3. Patch C:\Anaconda2\Lib\distutils\msvc9compiler.py with the following code:
    def find_vcvarsall(version):
        """Find the vcvarsall.bat file
    
        At first it tries to find the productdir of VS 2008 in the registry. If
        that fails it falls back to the VS90COMNTOOLS env var.
        """
        vsbase = VS_BASE % version
        vcpath = os.environ['ProgramFiles']
        vcpath = os.path.join(vcpath, 'Common Files', 'Microsoft',
            'Visual C++ for Python', '9.0', 'vcvarsall.bat')
        if os.path.isfile(vcpath): return vcpath
        vcpath = os.path.join(os.environ['LOCALAPPDATA'], 'Programs', 'Common', 'Microsoft', 'Visual C++ for Python', '9.0', 'vcvarsall.bat')
        if os.path.isfile(vcpath): return vcpath
        ...
    
  4. Install pyquant via pip install pyquant-ms

PyQuant Arguments

Below are the parameters for use with PyQuant

scan-file
The scan file(s) for the raw data. If not provided, assumed to be in the directory of the processed/tabbed/peaklist file.
scan-file-dir
The directory containing raw data.
precision
The precision for storing m/z values. Defaults to 6 decimal places.
precursor-ppm
The mass accuracy for the first monoisotopic peak in ppm.
isotope-ppm
The mass accuracy for the isotopic cluster.
spread
Assume there is spread of the isotopic label.
search-file
A search output or Proteome Discoverer msf file
skip
If true, skip scans with missing files in the mapping.
peptide
The peptide(s) to limit quantification to.
peptide-file
A file of peptide(s) to limit quantification to.
scan
The scan(s) to limit quantification to.
mva
Analyze files in 'missing value' mode.
rt-window
The maximal deviation of a scan's retention time to be considered for analysis.
label-scheme
The file corresponding to the labeling scheme utilized.
label-method
Predefined labeling schemes to use.
reference-label
The label to use as a reference (by default all comparisons are taken).
tsv
A delimited file containing scan information.
label
The column indicating the label state of the peptide. If not found, entry assumed to be light variant.
peptide-col
The column indicating the peptide.
rt
The column indicating the retention time.
mz
The column indicating the MZ value of the precursor ion. This is not the MH+.
scan-col
The column indicating the scan corresponding to the ion.
charge
The column indicating the charge state of the ion.
source
The column indicating the raw file the scan is contained in.
msn-id
The ms level to search for the ion in. Default: 2 (ms2)
msn-quant-from
The ms level to quantify values from. i.e. if we are identifying an ion in ms2, we can quantify it in ms1 (or ms2). Default: msn value-1
msn-ion
M/Z values to search for in the scans.
msn-peaklist
A file containing peaks to search for in the scans.
msn-ppm
The error tolerance for identifying the ion(s).
quant-method
The process to use for quantification. Default: Integrate for ms1, sum for ms2+.
reporter-ion
Indicates that reporter ions are being used. As such, we only analyze a single scan.
isotopologue-limit
How many isotopologues to quantify
overlapping-mz
This declares the mz values will overlap. It is useful for data such as neucode, but not needed for only SILAC labeling.
labels-needed
How many labels need to be detected to quantify a scan (ie if you have a 2 state experiment and set this to 2, it will only quantify scans where both occur.
min-scans
How many quantification scans are needed to quantify a scan.
min-resolution
The minimal resolving power of a scan to consider for quantification. Useful for skipping low-res scans
no-mass-accuracy-correction
Disables the mass accuracy correction.
peak-cutoff
The threshold from the initial retention time a peak can fall by before being discarded
max-peaks
The maximal number of peaks to find in the XIC. A lower value is useful for noisy ms1.
html
Output a HTML summary.
resume
Will resume from the last run. Only works if not directing output to stdout.
sample
How much of the data to sample. Enter as a decimal (ie 1.0 for everything, 0.1 for 10%)
disable-stats
Disable confidence statistics on data.
out
The prefix for the file output
neucode
This will select parameters suitable for NeuCode data.
isobaric-tags
This will select parameters suitable for iTRAQ or TMT based data.
ms3
This will select parameters suitable for ms3 based TMT quantification.
maxquant
This will select parameters suitable for providing a MaxQuant 'evidence' txt file to PyQuant.

Usage Instructions

PyQuant is run through the pyQuant script. It may be invoked by using pyQuant from the command line following installation.

Here are some common cases and the commands used to run the given analysis

SILAC
--search-file xxx_evidence.txt --label-method K8R10 --maxquant
MS3 based TMT
--isobaric-tags --ms3 --label-method TMT10 --search-file xxx_.msf --reference-label 128N --precursor-ppm 10
Neucode
--neucode --resolution 200000 --search-file xxx.pep.xml --label-scheme neucode.tsv --overlapping-labels
iTRAQ
--label-method iTRAQ8 --isobaric-tags --search-file xxx_.msf --reference-label 114 --precursor-ppm 20

Graphics

PyQuant provides two graphical outputs -- the fitting for the extracted ion chromatogram as well as the ions selected from each scan. Currently, these graphs can be accessed by clicking on the 'peptide' entry for a given row for the XIC, or the 'retention time' entry for a row. In the future, a more full featured data analysis/graphing panel is planned