wkumler / RaMS

R-based access to Mass-Spectrometry data
Other
22 stars 7 forks source link

.wiff2 files appear to contain no data when opened with RaMS #5

Closed wkumler closed 2 years ago

wkumler commented 2 years ago

Apparently .wiff2 files incorrectly return empty data.tables. Using grabMSdata on them causes the object returned to have MS1, MS2, BPC, and TIC data.tables of zero rows.

wkumler commented 2 years ago

This seems to be happening because the original indexing for MS1/MS2 scans finds MS1 and MS2 scans by using the compiled base peak intensity that's provided in each scan. Previously, RaMS used the following xpath to find scans:

ms1_xpath <- paste0('//d1:spectrum[d1:cvParam[@name="ms level" and ',
                      '@value="1"]][d1:cvParam[@name="base peak intensity"]]')

which will of course only find scans that have a cvParam with name attribute of "base peak intensity". The .wiff2 file this bug was found in didn't have a compiled BPC so no scans were found. I'm not sure why I included this in the xpath initially, but all my unit tests have passed and the R CMD CHECK returns no errors so I've pushed this change to main.

Now, the xpath used to find scans is simpler and more intuitive, only searching for scans of the given MS level:

ms1_xpath <- '//d1:spectrum[d1:cvParam[@name="ms level" and @value="1"]]'
wkumler commented 2 years ago

Closed with #fbc2d5d1a2015d4a262040faf04f59cfd01a1fe2