unimod through pwiz library?
1
0
Entering edit mode
jlp • 0
@jlp-9315
Last seen 9.0 years ago
United States

Hello,

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 • 1.7k views
ADD COMMENT
1
Entering edit mode
@laurent-gatto-5645
Last seen 6 weeks ago
Belgium

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.

Laurent

 

ADD COMMENT
0
Entering edit mode

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 https://github.com/sneumann/mzR/blob/master/src/Makefile.libpwiz 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="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
     xmlns:fn="http://www.w3.org/2005/xpath-functions"
     xmlns:umod="http://www.unimod.org/xmlns/schema/unimod_2"
     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"/>"
</xsl:for-each>
    </xsl:template>
</xsl:stylesheet>
ADD REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY

Login before adding your answer.

Traffic: 511 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6