# reduce an chromatoplots object to its xcms root object
setGeneric('.reduce', function(object,...) standardGeneric('.reduce'))
setMethod('.reduce', 'cpSample', function(object){
out <- new('xcmsRaw')
sapply(slotNames('xcmsRaw'), FUN = function(x){
slot(out, x) <- slot(object, x)
assign('out', out, envir = parent.env(environment()))
})
return(out)
})
setMethod('.reduce', 'cpExperiment', function(object){
out <- new('xcmsSet')
sapply(slotNames('xcmsSet'), FUN = function(x){
slot(out, x) <- slot(object, x)
assign('out', out, envir = parent.env(environment()))
})
})
setMethod('.reduce', 'cpPeaks', function(object){
out <- new('xcmsPeaks')
sapply(slotNAmes('xcmsPeaks'), FUN = function(x){
slot(out, x) <- slot(object, x)
assign('out', out, envir = parent.env(environment()))
})
return(out)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.