[R] Newbie question

Martin Morgan mtmorgan at fhcrc.org
Wed Mar 26 20:30:49 CET 2008


Hi Chaser --

Ask on the Bioconductor mailing list 
(http://www.bioconductor.org/docs/mailList.html) to connect with other 
Bioconductor users likely to have experience with the package.

Use an informative subject line, so that people able to help can see 
that the help they can provide is needed.

Use the facilities in R to find out about the required data, especially 
help on individual functions and the data set, e.g.,

 > ?exampleMS
 > ?peakDetectionCWT

Do you know about vignettes? After library(MassSpecWavelet), try

 > library(Biobase)
 > openVignette()

and select the appropriate vignette.

And then to get to your question: it looks like the example data is a 
matrix with 1 row and many columns (evenly spaced mass spec values).

 > data(exampleMS)
 > class(exampleMS)
[1] "matrix"
 > dim(exampleMS)
[1]     1 37656

You'll want to export your data from Excel as a 'comma-separated value' 
(csv) file, import it into R, and transform it as appropriate. These 
operations are described in manuals such as 'An Introduction to R', 'R 
Data Import / Export'. It might be as easy as

 > myMS <- t(as.matrix(read.csv("myFile.csv")))

Look up the help pages of read.csv, as.matrix, and t for more information.

Martin

Chaser wrote:
> Hey everyone,
> 
> For my research, I needed a peak detector algorithm that can spot peaks in
> an intensity graph. The excel 
> http://www.nabble.com/file/p16313309/sample%2Bdata.xls sample data   that
> I've attached contains columns of such intensity graphs. 
> 
> I came found an algorithm developed by the  http://www.bioconductor.com
> Bioconductor  team and was excited to test it out on my own data. However,
> it is written in R. With my own programming experience being Matlab and
> having little experience with programming to begin with, I've hit a bit of a
> road block and need whatever help you guys can offer.
> 
> I need to run my data through this algorithm and see what kind of peaks are
> detected. How do I format my excel data to a .rda format that the algorithm
> can work with?
> 
> The algorithm can be found 
> http://www.bioconductor.org/packages/bioc/html/MassSpecWavelet.html here .
> 
> To load the package, enter:
> 
> source("http://bioconductor.org/biocLite.R")
> biocLite("MassSpecWavelet")
> library(MassSpecWavelet)
> 
> The package comes with a sample data that is VERY similar to my own data
> (which is why I think it will work for my project)
> 
> To load the packaged example data and see what the package does, enter:
> 
> data(exampleMS)
> SNR.Th <- 3
> peakInfo <- peakDetectionCWT(exampleMS, SNR.Th=SNR.Th)
> majorPeakInfo = peakInfo$majorPeakInfo
> peakIndex <- majorPeakInfo$peakIndex
> plotPeak(exampleMS, peakIndex, main=paste('Identified peaks with SNR >',
> SNR.Th))
> 
> Any help you guys can offer will be greatly appreciated.
> 
> Thanks!


-- 
Martin Morgan
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M2 B169
Phone: (206) 667-2793



More information about the R-help mailing list