Question: Can Pymsxml Run Under Activepython V2.5.5?
2
gravatar for Neilfws
9.0 years ago by
Neilfws48k
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 2.7.0.2 (or for Python3, 3.1.2.4). 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, 2.5.5.7, which does include the utility.

2. Install Data Explorer

I have been sent a zip archive. Confusingly it is named "DataExplorer5.1.zip, but the actual version seems to be 4.0.0.0. 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\pymsxml.py", line 1796, in <module>
    x.write(debug=opts.debug)
  File "C:\bin\pymsxml.py", line 83, in write
    self.write_scans(tmpFile,debug)
  File "C:\bin\pymsxml.py", line 300, in write_scans
    for (s,d) in self.reader.spectra():
  File "C:\bin\pymsxml.py", line 1528, in spectra
    (tf,fixedMass) = doc.InstrumentSettings.GetSetting(self.delib.constants.dePr
eCursorIon,i-1,None)
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.7k views
ADD COMMENTlink modified 4.7 years ago by Biostar ♦♦ 20 • written 9.0 years ago by Neilfws48k
2

@neilfws: Enjoyed reading your blog on this question.

ADD REPLYlink modified 9 weeks ago by RamRS24k • written 9.0 years ago by Blunders1.1k

and congrats for the paper !

ADD REPLYlink modified 9 weeks ago by RamRS24k • written 8.7 years ago by Pierre Lindenbaum124k
5
gravatar for Brad Chapman
9.0 years ago by
Brad Chapman9.5k
Boston, MA
Brad Chapman9.5k 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}',
                                   0,4,2)
(tf,fixedMass) = doc.InstrumentSettings.GetSetting(
                   self.delib.constants.dePreCursorIon,i-1,None)

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 modified 9 weeks ago by RamRS24k • written 9.0 years ago by Brad Chapman9.5k

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 modified 9 weeks ago by RamRS24k • written 9.0 years ago by Neilfws48k
1
gravatar for Istvan Albert
9.0 years ago by
Istvan Albert ♦♦ 81k
University Park, USA
Istvan Albert ♦♦ 81k 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 9.0 years ago by Istvan Albert ♦♦ 81k
Please log in to add an answer.

Help
Access

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