Skip to content
Snippets Groups Projects
Commit e3503fb4 authored by ermueller's avatar ermueller
Browse files

Removed function that makes no sense with new workspace structure

parent 78fc7b52
No related branches found
No related tags found
No related merge requests found
......@@ -91,8 +91,6 @@ analyzeMsMs.optimized <- function(msmsPeaks, mode="pH", detail=FALSE, run="preli
}
}
#' @export
analyzeMsMs.formula.optimized <- function(msmsPeaks, mode="pH", detail=FALSE, run="preliminary",
filterSettings = getOption("RMassBank")$filterSettings,
spectraList = getOption("RMassBank")$spectraList, fragData, fragDataIndex)
......
......@@ -848,73 +848,3 @@ addMB <- function(w, cpdID, fileName, mode){
w <- addPeaksManually(w, cpdID, peaklist[[1]], mode)
return(w)
}
#####
#####Should the following function be exported or not? I guess you could, but then again,
#####its purpose is very specific and there is much room to misunderstand it.
#####
#' Concatenation of raw spectra in msmsWorkspace
#'
#' Concatenates the (at)specs spectra of msmsWorkspace according to cpdIDs
#'
#' @usage c.msmsWSspecs(w1, w2)
#' @param w1,w2 The msmsWorkspaces of which the spectra should be concatenated
#' @return The \code{msmsWorkspace} with the spectra of two workspaces concatenated into one. Please note that the spectra from w2 will be concatenated to w1 and not vice versa.
#' @seealso \code{\link{addPeaksManually}}
#' @author Erik Mueller
#' @examples \dontrun{
#' c.msmsWSspecs(w1,w2)
#' }
#'@export
c.msmsWSspecs <- function(w1 = NA, w2 = NA){
if(class(w1) != "msmsWorkspace" || class(w2) != "msmsWorkspace"){
stop("At least one of the supplied arguments is not of the msmsWorkspace class.")
}
cpdIDsw1 <- sapply(w1@specs, function(x) x$id)
cpdIDsw2 <- sapply(w2@specs, function(x) x$id)
if(length(cpdIDsw2) == 0){
stop("w2 can't be empty.")
}
if(length(cpdIDsw1) == 0){
w1@specs <- w2@specs
w1@files <- w2@files
return(w1)
}
for(i in 1:length(cpdIDsw2)){
if(any(cpdIDsw2[i] == cpdIDsw1)){
index <- which(cpdIDsw2[i] == cpdIDsw1)
w1@specs[[index]]$peaks <- c(w1@specs[[index]]$peaks,w2@specs[[i]]$peaks)
w1@specs[[index]]$childScans <- c(w1@specs[[index]]$childScans,w2@specs[[i]]$childScans)
w1@specs[[index]]$childHeaders <- rbind(w1@specs[[index]]$childHeaders, w2@specs[[i]]$childHeaders)
##Fake seqNums and/or acquisitionNums if the concatenation has doubled some of them
seqNums <- w1@specs[[index]]$childHeaders[,"seqNum"]
if(length(seqNums) != length(unique(seqNums))){
w1@specs[[index]]$childHeaders[,"seqNum"] <- 2:(nrow(w1@specs[[index]]$childHeaders) + 1)
w1@specs[[index]]$childScans <- 2:(nrow(w1@specs[[index]]$childHeaders) + 1)
}
acqNums <- w1@specs[[index]]$childHeaders[,"acquisitionNum"]
if(length(acqNums) != length(unique(acqNums))){
w1@specs[[index]]$childHeaders[,"acquisitionNum"] <- 2:(nrow(w1@specs[[index]]$childHeaders) + 1)
}
}
if(all(cpdIDsw2[i] != cpdIDsw1)){
w1@specs[[length(w1@specs) + 1]] <- w2@specs[[i]]
w1@files <- c(w1@files,w2@files[i])
}
}
return(w1)
}
......@@ -280,8 +280,6 @@ msmsRead.ticms2 <- function(w, filetable = NULL, files = NULL, cpdids = NULL,
}
}
#' @export
findMsMsHR.ticms2.d <- function(msRaw, cpdID, mode = "pH", confirmMode = 0, useRtLimit = TRUE,
ppmFine = getOption("RMassBank")$findMsMsRawSettings$ppmFine,
mzCoarse = getOption("RMassBank")$findMsMsRawSettings$mzCoarse,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment