Entering edit mode
cclark42
▴
10
@cclark42-15988
Last seen 6.0 years ago
Is it possible to access the "parentFile" tag (as seen below) for an mzXML file with mZR?
l version="1.0" encoding="ISO-8859-1"?>
<mzXML xmlns="<a href=" http:="" sashimi.sourceforge.net="" schema_revision="" mzXML_3.2"="" rel="nofollow">http://sashimi.sourceforge.net/schema_revision/mzXML_3.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://sashimi.sourceforge.net/schema_revision/mzXML_3.2 http://sashimi.sourceforge.net/schema_revision/mzXML_3.2/mzXML_idx_3.2.xsd">
<msRun scanCount="6" startTime="PT0S" endTime="PT0S">
<parentFile fileName="file://C:\Users\chase\Documents\MALDI\9-7-17\sm\0_A18\1\1SRef/fid" fileType="RAWData" fileSha1="5965ae8e78bef821459f64d903b498068c092679"/>
Thanks Dr. Gatto... I figured as much. I have a Shiny app that, after converting raw -> mzXML will allow creating spectral databases. So I'm interfacing an RSQLite database component now but lose provenance of the original raw files. (Maybe there's a way to directly serialize the mzXMl directly into a SQL blob from R?)
As for a PR- if you could point to the appropriate GH file(s) I can take a look if it's something I could help with.
Thanks!
RSQLite Code:
Access previously created RSQLite database
Display what used to be a mzXML file (that held 6 spectra)
Sorry about that.. it was just the context of why I needed to access that element. The database code is for a current project.
It looks like the package XML2 isn't part of mZR, but XML is in the 'Suggests' so I played with that. I really like that mZR doesn't pull files into memory until explicitly specified, and the code in this Gist stays with that premise.
I'm not sure what kind of API would be desired, one for just this 'parentFile' element or one that is more generic and can handle elements that aren't predefined by the API.
GIST:
Yes, it's exactly something like that I was thinking of. Note that there's the
fileNames
function to extract the file name of themz[X]ML
file, but that can be different than the original file.It would be useful to have a function that extracts that source file. I'm happy to add it as soon as I have time. (Or you can send a PR, of course.)