Skip to main content
Topic: Passing parameters to the xcmsRaw image method (Read 4732 times) previous topic - next topic

Passing parameters to the xcmsRaw image method

Hi,
      I think I checked all the obvious answers to this...

How do I change the title, etc. when I create an image of a single chromatogram? Using main="" did not work.

Thanks!

Alan

Re: Passing parameters to the xcmsRaw image method

Reply #1
No it is not implemented to change the title at the moment. The ... are used to pass all additional arguments to profRange(...).
I think the easiest way is to simply copy a few lines of source code and create a function "image2" with the changes that you want, e.g.

Code: [Select]
image2 <- function(x, col = rainbow(256), main="XC/MS Log Intensity Image", ...) {
    sel <- profRange(x, ...)

    zlim <- log(range(x@env$intensity))

    if (zlim[1] < 0) {
        zlim <- log(exp(zlim)+1)
        image(profMz(x)[sel$massidx], x@scantime[sel$scanidx],
              log(x@env$profile[sel$massidx, sel$scanidx]+1),
              col = col, zlim = zlim, main = main, xlab="m/z", ylab="Seconds")
    } else
        image(profMz(x)[sel$massidx], x@scantime[sel$scanidx],
              log(x@env$profile[sel$massidx, sel$scanidx]),
              col = col, zlim = zlim, main = main, xlab="m/z", ylab="Seconds")
}

Re: Passing parameters to the xcmsRaw image method

Reply #2
Ralf,

thanks for the fast reply... Perfect!

In the line of teaching me to fish, instead of giving me fish....

In general, how do I get to see the code? As I understand it, the standard way is typing in functions with no parameters at the command line, but that didn't work in this case.

Thanks for the great support.

Alan

Re: Passing parameters to the xcmsRaw image method

Reply #3
Hi,

just typing the function name does not work for object methods
in R's object orientation with S4 objects.

You can download the xcms source from bioconductor,
http://bioconductor.org/packages/2.11/b ... /xcms.html (Package Sources)
or view files directly in the version control system
https://hedgehog.fhcrc.org/bioconductor ... acks/xcms/
(user: readonly, pass: readonly).

Yours,
Steffen
--
IPB Halle                          Mass spectrometry & Bioinformatics
Dr. Steffen Neumann         http://www.IPB-Halle.DE
Weinberg 3 06120 Halle     Tel. +49 (0) 345 5582 - 1470
sneumann(at)IPB-Halle.DE