Read Me
HOW TO BUILD NIST.PYD
This folder contains the NIST.pyd project. This project was built with Microsoft Visual Studio 2010.
To build the project, you will need the nistdl32_2gb.lib file. To use the resulting NIST.pyd file, you will need two DLLs:
- nistdl32_2gb.dll
- ctNT66.dll
All of these files can be found in this NIST archive (in the 'x86' folder) [1]:
- ftp://chemdata.nist.gov/mass-spc/v1_7/NISTDLL2.ZIP
You will also need Python 2.7 installed. The project assumes it is installed in “C:\Python27”—you may need to modify project settings if this is not the case.
- Python.h can be found in "C:\Python27\include"
- python27.lib can be found in "C:\Python27\libs"
To build the project, open the NIST.sln solution file with Visual Studio and build in Release mode. If the build succeeds, the Release folder will contain NIST.pyd. To import NIST into Python, nistdl32_2gb.dll and ctNT66.dll must be in the same folder.
If you do not have access to Visual Studio, you can download a compiled version of NIST.pyd from our Sourceforge site (http://sourceforge.net/projects/mzapi-live/files/). This version should work with any 32-bit Python 2.7 (compiled against 2.7.3) but this is not guaranteed.
USING NIST.PYD
To use the library, you will also need to install a spectral library on your computer. Currently this is hard-coded into the project and must be located at "C:\NIST_PEPLIB\LIBS\known" [2].
You can download libraries from http://peptide.nist.gov -- the correct file ends with [species]_nist.tar.gz and can be extracted directly into the LIBS directory (the resulting folder will have a bunch of .INU and .DBU files in it). Rename the folder to 'known' and NIST.pyd will find it.
The test.py script is a simple way to test that NIST.pyd is working correctly. It contains a single spectrum from yeast, which it searches using the NIST.dot_product() function to get the best score from the installed spectral library.
The spectrum is from a yeast peptide—searching a yeast library will yield a very high score (e.g. 897 on the library tested) whereas searching against an E. coli database yields a poor score (e.g. 78). The script performs the search 100 times to show that these searches take on the order of milliseconds.
[1] We believe this URL is stable and will not change. If you cannot find NISTDLL2.zip, let us know.
[2] Allowing for alternate locations is a planned future improvement for the project.