Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: change colnames of chromatogram() data.frame #305

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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="sneumann@ipb-halle.de", role=c("aut","cre")),
Expand Down
5 changes: 5 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
CHANGES IN VERSION 2.41.2
-------------------------
o Use "rtime" and "intensity" as column names for the data.frame returned by
chromatogram() (# 304).

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_chromatograms.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ test_chromatograms1 <- function() {
checkIdentical(nrow(chromatogram(x, 136L)), 527L)
checkIdentical(nrow(chromatogram(x, 137L)), 567L)
checkIdentical(nrow(chromatogram(x, 138L)), 567L)
chr <- chromatogram(x, 138L)
checkIdentical(colnames(chr), c("rtime", "intensity"))
}

test_chromatograms2 <- function() {
Expand Down
5 changes: 2 additions & 3 deletions man/peaks.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,8 @@

The \code{chromatogram} (\code{chromatograms}) accessors return
chromatograms for the MS file handle. If a single index is provided,
as \code{data.frame} containing the retention time (1st columns) and
intensities (2nd column) is returned. The name of the former is always
\code{time}, while the latter will depend on the run parameters.
as \code{data.frame} containing the retention time (\code{"rtime"},
1st column) and intensities (\code{"intensity"}, 2nd column) is returned.

If more than 1 or no chromatogram indices are provided, then a list of
chromatograms is returned; either those passed as argument or all of
Expand Down
4 changes: 2 additions & 2 deletions src/RcppPwiz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -866,8 +866,8 @@ Rcpp::DataFrame RcppPwiz::getChromatogramsInfo( int whichChrom )
intensity.push_back(p.intensity);
}

chromatogramsInfo = Rcpp::DataFrame::create(Rcpp::_["time"] = time,
Rcpp::_[c->id] = intensity);
chromatogramsInfo = Rcpp::DataFrame::create(Rcpp::_["rtime"] = time,
Rcpp::_["intensity"] = intensity);

}
return(chromatogramsInfo);
Expand Down
Loading