xml - Complex xPath query with getNodeSet in R -


I have an XML file downloaded from the uniprot protein database.

  Protein & lt; - XmlRoot (xmlTreeParse ("http://www.uniprot.org/uniprot/Q01974.xml"))   

From the many annotated features, I am interested in starting and ending the following Keynes domain stored in the xml node:

  & lt; Feature type = "domain" description = "protein keyrings" & gt; & Lt; Location & gt; & Lt; Starting position = "288" /> & Lt; End position = "539" /> & Lt; / Location & gt; & Lt; / Feature & gt; With GetNodeSet, I can find out this tag well:  
  getNodeSet (Protein, "// uniprot: feature [@type = \" domain \ "and @ description = \" Unfortunately, I could not reduce the query, except for any other criteria. Example:    

GetNodeSet (Protein, "// Uniprot: Feature [@ type = \" domain \ "and @ description = \" protein keynes \ "] / location" , C (Uniprote = an online xpath tester On the basis, it should be a valid xpath query, but empty returns:

   

code> list () attr (, "class") [1] "XMLNodeSet "Can anyone help me with this question? I am sure this is normal behavior of getNodeSet, but I do not know what is rational behind it. In general What is the most appropriate method for such a relatively complex question in R? Should I consolidate the result and then reduce it further

Thanks a lot!

Also use the same prefix for the following elements:

  // uniprot: feature [...] / uniprot: location   

prefix + local-name identify each element if you have the default namespace With XML (it seems that you have it), all elements without the prefix that were considered in the default namespace. This is the reason why you need to use the prefix * for each element in Expedition (not only the first element).

*) Prefix which points to the default namespace URI

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -