-
Notifications
You must be signed in to change notification settings - Fork 80
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
Some updates and bug fixes #761
Changes from all commits
b9901c4
149272b
d0c71d0
1bd6d3d
b4ed18b
986075e
e39e248
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Package: xcms | ||
Version: 4.3.2 | ||
Version: 4.3.3 | ||
Title: LC-MS and GC-MS Data Analysis | ||
Description: Framework for processing and visualization of chromatographically | ||
separated and single-spectra mass spectral data. Imports from AIA/ANDI NetCDF, | ||
|
@@ -54,7 +54,7 @@ Imports: | |
methods, | ||
Biobase, | ||
BiocGenerics, | ||
ProtGenerics (>= 1.35.4), | ||
ProtGenerics (>= 1.37.1), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's needed because only the newer has a generic for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Exactly. The |
||
lattice, | ||
MassSpecWavelet (>= 1.66.0), | ||
S4Vectors, | ||
|
@@ -63,7 +63,7 @@ Imports: | |
MsCoreUtils (>= 1.15.5), | ||
MsFeatures, | ||
MsExperiment (>= 1.5.4), | ||
Spectra (>= 1.13.7), | ||
Spectra (>= 1.15.7), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I Guess needed because only the newer has There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, because for |
||
progress, | ||
RColorBrewer, | ||
MetaboCoreUtils (>= 1.11.2) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1136,6 +1136,78 @@ featureArea <- function(object, mzmin = min, mzmax = max, rtmin = min, | |
} | ||
|
||
#' function to create an empty `XcmsExperiment` object | ||
#' | ||
#' @noRd | ||
XcmsExperiment <- function() { | ||
as(MsExperiment(), "XcmsExperiment") | ||
} | ||
|
||
#' function to convert an XcmsExperiment into an XCMSnExp. | ||
#' | ||
#' @author Johannes Rainer | ||
#' | ||
#' @noRd | ||
.xcms_experiment_to_xcms_n_exp <- function(from) { | ||
requireNamespace("MSnbase", quietly = TRUE) | ||
n <- new("XCMSnExp") | ||
if (!length(from)) | ||
return(n) | ||
m <- new("MsFeatureData") | ||
## works only if we have a MsBackendMzR | ||
if (!inherits(spectra(from)@backend, "MsBackendMzR")) | ||
stop("Can not convert 'from' to a 'XCMSnExp' object: 'spectra(x)' uses", | ||
"an MS backend other than 'MsBackendMzR'. Currently, only", | ||
" coercion of an object with a 'MsBackendMzR' is supported.") | ||
## works only if we have an empty processing queue | ||
if (length(spectra(from)@processingQueue) > 0) | ||
stop("Can not convert 'from' to a 'XCMSnExp' object: processing queue", | ||
" of the Spectra object is not empty.") | ||
## -> OnDiskMSnExp | ||
n@processingData <- new("MSnProcess", | ||
processing = paste0("Data converted [", date(), "]"), | ||
files = fileNames(from), | ||
smoothed = NA) | ||
n@phenoData <- new("NAnnotatedDataFrame", as.data.frame(sampleData(from))) | ||
fd <- as.data.frame(from@spectra@backend@spectraData) | ||
fnames <- unique(fd$dataStorage) | ||
fd$fileIdx <- match(fd$dataStorage, fnames) | ||
fd <- fd[, !colnames(fd) %in% c("dataStorage", "dataOrigin")] | ||
colnames(fd) <- sub("scanIndex", "spIdx", colnames(fd)) | ||
colnames(fd) <- sub("rtime", "retentionTime", colnames(fd)) | ||
colnames(fd) <- sub("precScanNum", "precursorScanNum", colnames(fd)) | ||
colnames(fd) <- sub("precursorMz", "precursorMZ", colnames(fd)) | ||
fd$spectrum <- seq_len(nrow(fd)) | ||
rownames(fd) <- MSnbase:::formatFileSpectrumNames( | ||
fd$fileIdx, fd$spIdx, | ||
max(fd$fileIdx), max(fd$spIdx)) | ||
n@featureData <- new("AnnotatedDataFrame", fd) | ||
nf <- length(fnames) | ||
n@experimentData <- new("MIAPE", | ||
instrumentManufacturer = rep(NA_character_, nf), | ||
instrumentModel = rep(NA_character_, nf), | ||
ionSource = rep(NA_character_, nf), | ||
analyser = rep(NA_character_, nf), | ||
detectorType = rep(NA_character_, nf)) | ||
n@processingData <- new("MSnProcess", | ||
processing = paste0("Coercion from ", | ||
class(from)[1L], | ||
" [", date(), "]"), | ||
files = fnames) | ||
## -> XCMSnExp | ||
if (hasChromPeaks(from)) { | ||
chromPeaks(m) <- chromPeaks(from) | ||
chromPeakData(m) <- chromPeakData(from) | ||
} | ||
if (hasAdjustedRtime(from)) { | ||
art <- fd$retentionTime_adjusted | ||
names(art) <- rownames(fd) | ||
adjustedRtime(m) <- split(art, fd$fileIdx) | ||
} | ||
if (hasFeatures(from)) | ||
featureDefinitions(m) <- DataFrame(featureDefinitions(from)) | ||
lockEnvironment(m, bindings = TRUE) | ||
n@msFeatureData <- m | ||
[email protected] <- from@processHistory | ||
validObject(n) | ||
n | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
brew install harfbuzz fribidi
seriously ? Somebody was creative there :-) Certainly very google'able...