Mascot: The trusted reference standard for protein identification by mass spectrometry for 25 years

Posted by Patrick Emery (March 18, 2024)

Tutorial: Creating custom reports in Mascot Distiller

Mascot Distiller 2.8 reports are written in Python, a commonly used programming language, and use Mascot Parser to access the search and quantitation results. We supply a range of standard reports, including reports for quality, clustering and statistical analysis, which we took a look at in an earlier blog article. In addition to these, you can develop your own reports and run them directly from the Mascot Distiller GUI (or run them from the command line application).

To get started, you’ll need a good working knowledge of the Python programming language, and of our Mascot Parser library, and an Integrated Development Environment (IDE), such as Visual Studio Code.

Mascot Distiller 2.8 ships with an embedded version of Python 3.6 and includes a number of useful additional libraries which can be used to manipulate and format data, create graphs, export in any custom format or even upload data to another system via http etc. The additional libraries included are:

  • Mascot Parser – Our library for accessing Mascot search and quantitation results
  • statsmodels – A library for conducting statistical tests
  • Plotly – A graphing library which allows for user interaction using Javascript
  • SciPy – A library of algorithms for scientific computing
  • NumPy – A library for array creation and manipulation
  • pandas – A library for data analysis and manipulation
  • matplotlib – A graphing and visualisation library
  • scikit-learn – A machine learning library
  • seaborn – A data visualisation library based on matplotlib
These libraries should be sufficient for almost any kind of reporting and visualisation you can think of.

To simplify developing a Distiller Python report, we also supply several helper scripts, which you’ll find in the “reports” directory of your Mascot Distiller installation.

  • LoadQuantitation.py which includes methods to load search and quantitation results into msparser and returning them, reducing and simplifying the number of steps required to access your results
  • CreateQuantDataFrames.py which includes methods to load protein and peptide quantitation data into lists and arrays
  • WriteReports.py which includes methods to output logging and progress information from the script back to Mascot Distiller

You can use the Python supplied with Mascot Distiller as your development environment, which will ensure your script has access to the runtime libraries available in the Distiller GUI. To do this, select the python executable in the “python-3.6.5-embed-win-amd64″ directory of your Mascot Distiller installation as the Python environment in your IDE (your IDE should have instructions on how to do this). If you’re developing on a different PC, download and run the Mascot Distiller installer. This will install Mascot Distiller in viewer mode, which includes the embedded Python and will allow you to develop and test your custom reports.

A Distiller report consists of two files: an XML file, which defines the report inputs, and the actual Python script. The XML file can optionally define controls for a Wizard interface in the GUI, like dropdown menus and checkboxes. You can find the schema file which defines the report XML at “C:\ProgramData\Matrix Science\Mascot Distiller\schema\distiller_report_definition_1.xsd” on your Mascot Distiller workstation. The schema file is fully documented, but if you have any questions, please let us know at support@matrixscience.com

We’ve written a tutorial which takes you through the steps required to create a Python report and enable it on your local Mascot Distiller installation. The example script described by the tutorial calculates the Average (top-3) protein intensity for all sample components and generates a CSV export file. This report will be included in the next release of Mascot Distiller. In the meantime, you can download the tutorial pdf and report script files:

Keywords: , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*

HTML tags are not allowed.