Matrix Science header

Python toolkit installation
[Installing Mascot Parser]

To use the toolkit, a Python interpreter must be installed.

In Windows, the only supported versions of Python are ActiveState ActivePython 2.6, 2.7 and 3.4. ActivePython is available for download from http://www.activestate.com/. ActivePython is fully compatible with python.org Python builds, which means Mascot Parser may work with other versions of Python on Windows as well, but this is not guaranteed.

On Linux systems, the only supported versions of Python are 2.6, 2.7 (both 32 and 64 bit) and 3.4 (64 bit only) from http://python.org/.

Note:
Mascot Parser Python modules are not Unicode-aware. Make sure that any string objects you pass as parameters to Mascot Parser functions are non-Unicode string objects.

To use Mascot Parser in your program, the files msparser.py and _msparser.pyd (msparser.so on Linux) must either be in the same directory as your program, or in a directory searched by the Python interpreter. In the latter case, there are three alternatives.

Define or modify PYTHONPATH:

You can define the PYTHONPATH environment variable to point to the directory where Mascot Parser Python files are located.

Use sys.path.append():

You can use sys.path.append() in your program to add the directory where Mascot Parser files are located to the module search path. This is equivalent to modifying PYTHONPATH, except that the path is hardcoded in your program.

Global installation:

You can copy the Mascot Parser Python files to the site-packages directory of your Python installation.

  • In Windows, assuming ActivePython 2.6, this is C:\Python26\Lib\site-packages.
  • In Linux, this is similar to /usr/local/lib/python2.6/site-packages, assuming Python 2.6. The exact path depends on how the Python version has been configured.

Visual C++ Redistributable Package (Windows)

You may also need to install the Microsoft Visual C++ 2012 Update 3 (or later) Redistributable Package
To check if you need this:

  1. Download and run depends.exe from http://www.dependencywalker.com/.
  2. Open msparser.dll in the program.
  3. If depends.exe reports that the dependent MSVCR110.dll and MSVCP110.dll are missing, download the Visual C++ 2012 Update 3 (or later) redistributable package from the Microsoft Download Center: https://www.microsoft.com/en-us/download/details.aspx?id=30679
  4. Choose vcredist_x86.EXE for 32-bit and vcredist_x64.EXE for 64-bit

Running a Python example on Windows

Open a command prompt, and change to the example_python directory. To run, say, resfile_error.py:

    resfile_error.py C:\Inetpub\mascot\data\F981119.dat

Running a Python example on Linux

Open a terminal window, and change to the example_python directory. To run, say, resfile_error.py:

    resfile_error.py /usr/local/mascot/data/F981119.dat

This only works if resfile_error.py has the executable bit set, and if the script has the correct "shebang" line. The "shebang" line is the first line of the script, and gives the location of the Python interpreter:

    #!/usr/bin/python

You can use the Python interpreter directly:

    python resfile_error.py /usr/local/mascot/data/F981119.dat

Using the Python toolkit

Reasonable proficiency in Python programming will be required. Please see Quickstart: how to open a results file and Examples for the results file module.

Copyright © 2016 Matrix Science Ltd.  All Rights Reserved. Generated on Fri Jun 2 2017 01:44:51