-
Notifications
You must be signed in to change notification settings - Fork 46
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
New/update quantify method #297
Comments
Re Re |
I think it would be good to keep I will into your |
@jotsetung - a few questions following up from the discussion above. In What would you think of me reusing the Re parameters above, I saw that you have the qx <- quantify(x, method = "CentWaveParam") |
Problem is that the quantification in xcms is a multi-step approach:
Already step 1) returns an The idea of having a single Now re To me it would make sense to apply a quantification method once the features have been defined (i.e. the 2d areas on the rt-m/z space). This can be done with a combination of Re re-using the |
That wasn't my intention. Now that I understand better, I would see something like
No, the 2-dimensional object is an I hope this clarifies what I am looking for. I think these needs are essentially what you have. |
Looks good to me! I think the Also for me it might be helpful to have then a |
That was implied in my If this looks good an feasible, my next concrete question is:
Or do you see another possibility? Same for the
Yes! |
See |
I really like the idea to merge metabolomics and proteomics workflows and to use a
While it would be great to link quantitation data to raw data I am against the BTW: Do we want to start a repository for this linkage stuff to discuss goal/problems from time to time? (Starting point could be the document you wrote at EuroBioc2017.) |
In principle there shouldn't be a big problem moving the object - there will be stuff that you have to implement in Re @sgibb about the monster object: for me it was key to have both the link to the raw and quantified data in the same object. I really need to get back to exactly the same data on which the quantification was performed to check if the e.g. identified peaks are well aligned across samples etc. Having that in different objects would make it very hard (this is how it was in the old |
In principle, I agree. But at this point, given that The long-term goals, as discussed at EuroBioc2017, is to integrate raw data, quantitation, protein database, peptide sequences, ... and I don't want to rush this. The r-bioc-ms-challenges repo can be used for discussions. I am open for discussion though. I will think about keeping |
I would have thought the class and accessors would suffice, and all the Re naming, I got the reason of the name1 <- name2 <- ... for functions. |
Is it possible to have the same object with two different names? Also here, I don't have any strong feeling regarding the name of the object - Why I'm not euphoric about moving the object is that, as it is now, it is hardly of any use for you - because you don't need the adjusted retention times, the matrix of identified chromatographic peaks and the If you're already thinking that you will need the object to implement the label free identification in |
Is In you case, the environment contains adjusted retention times, the matrix of identified chromatographic peaks and the Basically, I would do setClass("FeatureMSnExp",
slots = c(
.processHistory = "list", ## optional
msFeatureData = "MsFeatureData"
),
contains = c("OnDiskMSnExp"))
setMethod("[", "FeatureMSnExp",
## also subset object@msFeatureData$exprs
)
setMethod("exprs", "FeatureMSnExp",
function(object) object@msFeatureData$exprs)
setMethod("show", "FeatureMSnExp",
## just say that there's something in the msFeatureData slot,
## possibly say what it is, then call show,OnDiskMSnExp
)
## all the other accessors would be inherited form OnDiskMSnExp For a later tighter integration, I think it would be good that |
Ah, and here comes the trouble: #' @description The \code{[} method allows to subset a \code{\link{XCMSnExp}}
#' object by spectra. Be aware that the \code{[} method removes all
#' preprocessing results, except adjusted retention times if
#' \code{keepAdjustedRtime = TRUE} is passed to the method.
#'
#' @param x For \code{[} and \code{[[}: an \code{\link{XCMSnExp}} object.
#'
#' @param i For \code{[}: \code{numeric} or \code{logical} vector specifying to
#' which spectra the data set should be reduced.
#' For \code{[[}: a single integer or character.
#'
#' @param j For \code{[} and \code{[[}: not supported.
#'
#' @param drop For \code{[} and \code{[[}: not supported.
#'
#' @rdname XCMSnExp-filter-methods
setMethod("[", "XCMSnExp", function(x, i, j, ..., drop = TRUE) {
if (!missing(j))
stop("subsetting by columns ('j') not supported")
if (missing(i))
return(x)
else if (!(is.numeric(i) | is.logical(i)))
stop("'i' has to be either numeric or logical")
## Check if we have keepAdjustedRtime as an additional parameter
## in ...
keepAdjustedRtime <- list(...)$ke
if (is.null(keepAdjustedRtime))
keepAdjustedRtime <- FALSE
if (hasFeatures(x) | hasChromPeaks(x)) {
suppressMessages(
x <- dropFeatureDefinitions(x, keepAdjustedRtime =
keepAdjustedRtime))
suppressMessages(
x <- dropChromPeaks(x, keepAdjustedRtime =
keepAdjustedRtime))
warning("Removed preprocessing results")
}
if (hasAdjustedRtime(x)) {
if (keepAdjustedRtime) {
## Subset the adjusted rtime
new_adj <- rtime(x, adjusted = TRUE)[i]
newFd <- new("MsFeatureData")
newFd@.xData <- .copy_env(x@msFeatureData)
adjustedRtime(newFd) <-
unname(split(new_adj, f = fromFile(x)[i]))
lockEnvironment(newFd, bindings = TRUE)
x@msFeatureData <- newFd
} else {
suppressMessages(x <- dropAdjustedRtime(x))
}
}
callNextMethod()
}) so, if there is a Actually, what if we keep the |
Here's what I was thinking of: we would have a top class in setClass("FeatureMSnExp",
slots = c(
.processHistory = "list", ## optional
msFeatureData = "MsFeatureData"
),
representation = "VIRTUAL",
contains = c("OnDiskMSnExp"))
## possibly a show,FeatureMSnExp method
## common infrastructure inherited from OnDiskMSnExp and in setClass("MSnExpSet", contains = "FeatureMSnExp") ## horrible name
setMethod("[", "MSnExpSet", ...) ## accessing exprs
## all the specific proteomics processing methods/functions and in setClass("XCMSnExp", contains = "FeatureMSnExp")
setMethod("[", "XCMSnExp", ...) ## accessing other elements
## all the specific metabolomics processing methods/functions This allows us to keep a link between the Let's see tomorrow if this still makes sense... |
Looks good to me. So, you're moving the |
From the above, I rather meant I won't have time to further test/think about this today, so no hurry. |
I am going to wait before doing this, that I have the new interface with |
Given the new
OnDiskMSnExp
infrastructure, it is time to upgrade thequantify
method. I am considering the following signature (only focusing on the most important arguments for now):with the following behaviour:
Another possibility would be to have a
QuantitationParams
class (with essentially the arguments shown above) and pre-defined instances for the most used methods. At this point it feels overkill, but could be a way to more easily extend quantification parametrisation in the future. This could by the way also be useful forxcms
.Another point I am considering is to allow to either returns an
MSnSet
containing the feature of the MS level defined as argument toquantify
(current behaviour), or to return a newOnDiskMSnExp
and the quantification matrix (for all feature) would be stored in amatrix
in theassayData
slot, similar to whatxcms
does in theXCMSnExp
object.@sgibb @jotsetung - any comments or suggestions?
The text was updated successfully, but these errors were encountered: