Question: unimod through pwiz library?
gravatar for jlp
4.1 years ago by
United States
jlp0 wrote:


I'd like to access some of the information contained in a recent version of unimod.xml. I've been looking into how to access the proteowizard classes that handle this data but have never used Rcpp or worked directly with accessing underlying C or C++ functions from R before.

Is this relatively straightforward - is it possible to access these functions via something like ".Call" or would I need to write a C++ module or ...?

Alternatively, I may just parse the XML myself but that seems like a waste if it can be avoided. I'd rather spend a bit more time creating a useful way to access the proteowizard API for unimod than to just make some custom "single-use" type code.

Thanks very much for any advice you can provide.

mzr rcpp • 666 views
ADD COMMENTlink modified 4.1 years ago by Laurent Gatto1.2k • written 4.1 years ago by jlp0
Answer: unimod through pwiz library?
gravatar for Laurent Gatto
4.1 years ago by
Laurent Gatto1.2k
Laurent Gatto1.2k wrote:

There is currently no infrastructure within mzR to provide users access to UniMod, but any contribution would be welcome. However, as mzR is rather big, providing such functionality in a specialised and lightweight package might possibly be a better solution.

Depending on what your goal is, you might want to have a look at the  rols package, which provides an R interface to the Ontology lookup service at the EBI. Among the 80+ ontologies which can be accessed, there is the Protein Modifications (PSI-MOD), which can be browsed here.

Hope this helps.



ADD COMMENTlink written 4.1 years ago by Laurent Gatto1.2k

Thanks very much for the information.

My goal isn't so much to provide access to unimod through mzR itself. Rather, it seems as though the inclusion of proteowizard code by mzR now, and specifically unimod.o if I'm reading correctly, may mean that the functionality is already being included when mzR is installed. I haven't gone through building from source myself, however. If you have a chance to answer, how easy would it be to provide access to the function pwiz::data::unimod::modifications in principle? Any tips or pointers to a wrapper tutorial or piece of code in mzR say that could clarify things a bit?

My need is rudimentary right now and I'm pressed for time so I may simply resort to rols - thanks for that tip. I really appreciate your time and advice!

Quick edit: now that I've looked at rols and GO.db, it seems as though these provide very useful solutions to my needs already. I'll probably go that route for now then. Thanks!

Edit 2: oh well, spoke too soon, PSI-MOD doesn't provide all the mods I need. I converted to csv using xslt with MS Visual Studio 2013 Community Edition (but an OSS tool such as Saxon could be used)... here's the xslt for anyone looking to easily get a table of mods _into_ R... hope this is helpful. Note: probably should have some strip-space and normalize-space(.) elements/attributes and perhaps explicit carriage returns but seems to be working for me:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl=""
     exclude-result-prefixes="xs fn xsl"
    <xsl:output method="text" indent="yes" omit-xml-declaration="yes"/>

    <xsl:template match="/">
      <xsl:for-each select="/*/umod:modifications/umod:mod">"<xsl:value-of select="@title"/>",<xsl:value-of select="umod:delta/@mono_mass"/>,"<xsl:value-of select="umod:delta/@composition"/>"
ADD REPLYlink modified 4.1 years ago • written 4.1 years ago by jlp0

The uniprot code from pwiz is used by the pwiz C++ code. As far as I know, we haven't made any attempts to use it ourselves directly. While it would probably be possible to use what is in mzR, I think it would not be straightforward.

ADD REPLYlink written 4.1 years ago by Laurent Gatto1.2k

Thanks. Appreciate the advice.

Perhaps in the future, if I learn more about the interface between R and C++, I'll roll something up.

ADD REPLYlink written 4.1 years ago by jlp0
Please log in to add an answer.


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