Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: mzR
Type: Package
Title: parser for netCDF, mzXML and mzML and mzIdentML files
(mass spectrometry data)
Version: 2.41.1
Version: 2.41.2
Author: Bernd Fischer, Steffen Neumann, Laurent Gatto, Qiang Kou, Johannes Rainer
Authors@R: c(
person("Steffen", "Neumann", email="[email protected]", role=c("aut","cre")),
Expand Down
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
CHANGES IN VERSION 2.41.2
-------------------------
o Report also electron beam energy (MS:1003410) for EAD data.

CHANGES IN VERSION 2.41.1
-------------------------
o Fix compilation error with stricter compiler checks
Expand Down
2 changes: 2 additions & 0 deletions inst/unitTests/test_pwiz.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ test_mzXML <- function() {
checkTrue(any(colnames(hdr) == "scanWindowUpperLimit"))
checkTrue(all(!is.na(hdr$scanWindowLowerLimit)))
checkTrue(all(!is.na(hdr$scanWindowUpperLimit)))
checkTrue(any(colnames(hdr) == "electronBeamEnergy"))
checkTrue(all(is.na(hdr$electronBeamEnergy)))
hdr <- header(mzxml,1)
checkTrue(is.list(hdr))
hdr <- header(mzxml, 2:3)
Expand Down
10 changes: 8 additions & 2 deletions src/RcppPwiz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ Rcpp::DataFrame RcppPwiz::getScanHeaderInfo (Rcpp::IntegerVector whichScan) {
Rcpp::NumericVector isolationWindowUpperOffset(N_scans);
Rcpp::NumericVector scanWindowLowerLimit(N_scans);
Rcpp::NumericVector scanWindowUpperLimit(N_scans);

Rcpp::NumericVector electronBeamEnergy(N_scans);

for (size_t i = 0; i < N_scans; i++) {
int current_scan = whichScan[i];
size_t current_index = static_cast<size_t>(current_scan - 1);
Expand Down Expand Up @@ -262,6 +263,8 @@ Rcpp::DataFrame RcppPwiz::getScanHeaderInfo (Rcpp::IntegerVector whichScan) {
const Precursor& precursor = sp->precursors[0];
// collisionEnergy
collisionEnergy[i] = precursor.activation.cvParam(MS_collision_energy).valueAs<double>();
// electronBeamEnergy - for EAD
electronBeamEnergy[i] = precursor.activation.cvParam(MS_electron_beam_energy).value.empty() ? NA_REAL : precursor.activation.cvParam(MS_electron_beam_energy).valueAs<double>();
// precursorScanNum
size_t precursorIndex = slp->find(precursor.spectrumID);
if (precursorIndex < N) {
Expand All @@ -288,6 +291,7 @@ Rcpp::DataFrame RcppPwiz::getScanHeaderInfo (Rcpp::IntegerVector whichScan) {
}
} else {
collisionEnergy[i] = NA_REAL;
electronBeamEnergy[i] = NA_REAL;
precursorScanNum[i] = NA_INTEGER;
precursorMZ[i] = NA_REAL;
precursorCharge[i] = NA_INTEGER;
Expand All @@ -302,7 +306,7 @@ Rcpp::DataFrame RcppPwiz::getScanHeaderInfo (Rcpp::IntegerVector whichScan) {
}
}

Rcpp::List header(31);
Rcpp::List header(32);
std::vector<std::string> names;
size_t i = 0;
names.push_back("seqNum");
Expand Down Expand Up @@ -367,6 +371,8 @@ Rcpp::DataFrame RcppPwiz::getScanHeaderInfo (Rcpp::IntegerVector whichScan) {
header[i++] = Rcpp::wrap(scanWindowLowerLimit);
names.push_back("scanWindowUpperLimit");
header[i++] = Rcpp::wrap(scanWindowUpperLimit);
names.push_back("electronBeamEnergy");
header[i++] = Rcpp::wrap(electronBeamEnergy);
header.attr("names") = names;

return header;
Expand Down
Loading