Skip to content

Commit c24f9af

Browse files
committed
add electronBeamEnergy
1 parent 27c8edb commit c24f9af

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

R/functions-utils.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
basePeakMZ = "numeric",
2525
basePeakIntensity = "numeric",
2626
collisionEnergy = "numeric",
27+
electronBeamEnergy = "numeric",
2728
ionisationEnergy = "numeric",
2829
lowMZ = "numeric",
2930
highMZ = "numeric",

R/methods-mzRnetCDF.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ setMethod("header", c("mzRnetCDF", "numeric"), function(object, scans) {
6767
basePeakMZ = empty_val,
6868
basePeakIntensity = empty_val,
6969
collisionEnergy = empty_val,
70+
electronBeamEnergy = empty_val,
7071
ionisationEnergy = empty_val,
7172
lowMZ = empty_val,
7273
highMZ = empty_val,

src/RcppPwiz.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,8 @@ Rcpp::DataFrame RcppPwiz::getScanHeaderInfo (Rcpp::IntegerVector whichScan) {
329329
header[i++] = Rcpp::wrap(basePeakIntensity);
330330
names.push_back("collisionEnergy");
331331
header[i++] = Rcpp::wrap(collisionEnergy);
332+
names.push_back("electronBeamEnergy");
333+
header[i++] = Rcpp::wrap(electronBeamEnergy);
332334
names.push_back("ionisationEnergy");
333335
header[i++] = Rcpp::wrap(ionisationEnergy);
334336
names.push_back("lowMZ");
@@ -371,8 +373,6 @@ Rcpp::DataFrame RcppPwiz::getScanHeaderInfo (Rcpp::IntegerVector whichScan) {
371373
header[i++] = Rcpp::wrap(scanWindowLowerLimit);
372374
names.push_back("scanWindowUpperLimit");
373375
header[i++] = Rcpp::wrap(scanWindowUpperLimit);
374-
names.push_back("electronBeamEnergy");
375-
header[i++] = Rcpp::wrap(electronBeamEnergy);
376376
header.attr("names") = names;
377377

378378
return header;
@@ -679,6 +679,7 @@ void RcppPwiz::addSpectrumList(MSData& msd,
679679
Rcpp::NumericVector basePeakMZ = spctr_header["basePeakMZ"];
680680
Rcpp::NumericVector basePeakIntensity = spctr_header["basePeakIntensity"];
681681
Rcpp::NumericVector collisionEnergy = spctr_header["collisionEnergy"];
682+
Rcpp::NumericVector electronBeamEnergy = spctr_header["electronBeamEnergy"];
682683
Rcpp::NumericVector ionisationEnergy = spctr_header["ionisationEnergy"];
683684
Rcpp::NumericVector lowMZ = spctr_header["lowMZ"];
684685
Rcpp::NumericVector highMZ = spctr_header["highMZ"];
@@ -719,6 +720,7 @@ void RcppPwiz::addSpectrumList(MSData& msd,
719720
// precursorIntensity numeric $precursorIntensity
720721
// precursorCharge integer $precursorCharge
721722
// collisionEnergy numeric $collisionEnergy
723+
// electronBeamEnergy numeric $electronBeamEnergy
722724

723725
// Now filling with new data
724726
shared_ptr<SpectrumListSimple> spectrumList(new SpectrumListSimple);
@@ -787,9 +789,15 @@ void RcppPwiz::addSpectrumList(MSData& msd,
787789
spct.precursors.resize(1);
788790
Precursor& prec = spct.precursors.front();
789791
if (collisionEnergy[i] != 0) {
790-
prec.activation.set(MS_collision_induced_dissociation);
791-
prec.activation.set(MS_collision_energy, collisionEnergy[i],
792-
UO_electronvolt);
792+
prec.activation.set(MS_collision_induced_dissociation);
793+
prec.activation.set(MS_collision_energy, collisionEnergy[i],
794+
UO_electronvolt);
795+
}
796+
// EAD
797+
if (electronBeamEnergy[i] != 0) {
798+
prec.activation.set(MS_electron_activated_dissociation);
799+
prec.activation.set(MS_electron_beam_energy, electronBeamEnergy[i],
800+
UO_electronvolt);
793801
}
794802
prec.selectedIons.resize(1);
795803
prec.selectedIons[0].set(MS_selected_ion_m_z, precursorMZ[i], MS_m_z);

0 commit comments

Comments
 (0)