Question: Can Pymsxml Run Under Activepython V2.5.5?
gravatar for Neilfws
8.4 years ago by
Sydney, Australia
Neilfws48k wrote:

This is a long post, detailing my observations with questions at the end.

I have (foolishly) volunteered to look at some proteomics data in a proprietary format. My aim is to convert it to mzXML, then generate "annotated PMF spectra" - that is, a plot of intensity v. m/z ratio where peaks are labelled with mass and perhaps peptide and positions in the protein.

The data are from a Voyager DE-STR MALDI-TOF instrument; the file suffix is ".dat". It seems from this information that there are few options. One is to install PyMsXML on a Windows machine which also has the proprietary Data Explorer software. PyMsXML appears not to have been updated since 2007. Another possibility might be the executables from ProteoWizard, again requiring Data Explorer.

This is tremendously painful for me, since I never use Windows. However, I do have a version of WinXP installed as a virtual machine using VirtualBox (Ubuntu). I have worked through the PyMsXML installation guide, with the following results:

1. Download and install ActivePython

The latest version from ActiveState is (or for Python3, However, the 2.7 version does not appear to include the "COM Makepy utility" referred to in the PyMsXML instructions. I downloaded and installed the earliest available free version,, which does include the utility.

2. Install Data Explorer

I have been sent a zip archive. Confusingly it is named ", but the actual version seems to be Anyway, it seems to install and run OK.

3. Install COM library interfaces

The instructions are to open the COM Makepy utility and look for "ExploreDataObjects 1.0 Type Library (1.0)" and "IDAExplorer 1.0 Type Library (1.0)" - the latter is for .dat files. Neither of these exist. However, there is a library named "Data Explorer 4.2 Type Library (4.2)". The interface to this appears to install correctly.

The PyMsXML instructions then refer to a couple of tests to check installation. The test for Analyst files fails, but the one for Data Explorer appears to pass.

4. Download, install and edit the PyMsXML scripts

This step is fine. Next - run on a test file. I run:

pymsxml -R voyager -o myfile.mzXML myfile.dat

And I get the error:

Traceback (most recent call last):
  File "C:\bin\", line 1796, in <module>
  File "C:\bin\", line 83, in write
  File "C:\bin\", line 300, in write_scans
    for (s,d) in self.reader.spectra():
  File "C:\bin\", line 1528, in spectra
    (tf,fixedMass) = doc.InstrumentSettings.GetSetting(self.delib.constants.dePr
AttributeError: class constants has no attribute 'dePreCursorIon'

I have much less to say about the ProteoWizard executables: they all fail to run with the message "The system cannot execute the specified program." I briefly attempted to build from source under Cygwin, but gave that up as a waste of time.

So my questions are:

  • Has anyone got PyMsXML to run using ActivePython > 2.4 ?
  • Any idea what the PyMsXML error message means ?
  • Any tips at all for getting PyMsXML, ProteoWizard or any other tool to convert Voyager .dat files to mzXML ?
python conversion • 2.5k views
ADD COMMENTlink modified 4.0 years ago by Biostar ♦♦ 20 • written 8.4 years ago by Neilfws48k

@neilfws: Enjoyed reading your blog on this question:

ADD REPLYlink written 8.3 years ago by Blunders1.1k

and congrats for the paper !:

ADD REPLYlink written 8.0 years ago by Pierre Lindenbaum118k
gravatar for Brad Chapman
8.4 years ago by
Brad Chapman9.3k
Boston, MA
Brad Chapman9.3k wrote:

This one is tough to debug fully without Windows and the Data Explorer software. The problem is that the Data Explorer library, which is loaded via COM, is missing a constant that PyMsXML is expecting. Here are the relevant lines of code plucked from the source:

from win32com.client import Dispatch, gencache
self.delib = gencache.EnsureModule('{06972F50-13F6-11D3-A5CB-0060971CB54B}',
(tf,fixedMass) = doc.InstrumentSettings.GetSetting(

Since PyMsXML is from 2007, the best guess is that something has changed in the Data Explorer API since then that is breaking it. One thing you could do is put a:

print dir(self.delib.constants)

In front of the error line and see what the available constants are; if you're lucky maybe the constant will have changed names to something you can recognize and you'll be able to update the code and get it running.

ADD COMMENTlink written 8.4 years ago by Brad Chapman9.3k

Terrific - I think that may have worked! I used "print dir(self.delib.constants)" and there is one named "deExtractedIonMass". I substituted that in the line that begins (tf,fixedMass) and a mzXML file was generated with no error messages. Time will tell if the file has the correct data, but this deserves best answer; thanks so much.

ADD REPLYlink written 8.4 years ago by Neilfws48k
gravatar for Istvan Albert
8.4 years ago by
Istvan Albert ♦♦ 79k
University Park, USA
Istvan Albert ♦♦ 79k wrote:

If you knew what the constant was renamed to you could probably use that in the Python source instead of dePreCursorIon. Sadly it is unlikely that this alone will be the sole problem that you encounter.

For compiling extensions you should always use the Visual C++ that was used to build Python itself. Often once you have this compiler the compilation can be surprisingly painless and as seamless as Unix (besides tracking down and buying the right version of Visual C++).

ADD COMMENTlink written 8.4 years ago by Istvan Albert ♦♦ 79k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 834 users visited in the last hour