Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to R / sma / Bioconductor Statistics for Microarray Data Analysis The Fields Institute for Research in Mathematical Sciences May 25, 2002.

Similar presentations


Presentation on theme: "Introduction to R / sma / Bioconductor Statistics for Microarray Data Analysis The Fields Institute for Research in Mathematical Sciences May 25, 2002."— Presentation transcript:

1 Introduction to R / sma / Bioconductor Statistics for Microarray Data Analysis The Fields Institute for Research in Mathematical Sciences May 25, 2002

2 Web sites + References http://www.R-project.org/ An introduction to R W.N.Venables, D.M.Smith and the R Development Core Team http://lib.stat.cmu.edu/R/CRAN/ http://www.bioconductor.org/

3 Need to read files such as “swirl1.spot” or “samples.swirl” into the R programs. Functions: read.table scan Save your workspace in R Using the function save.image You will only see name.RData or.RData In your directory

4 Download ? Download SetupR.exe from http://cran.r-project.org/,http://cran.r-project.org/

5 A few basics Working Directory -getwd() -setwd() or click on File and then click on Change Dir, use Browse to determine your working directory. Workspace -save(a, b, file=“my.RData”) : save objects a and b into the workpace “my.RData” -save.image(“my.RData”) : click on File and then click on Save Workspace -load(“my.RData”) : click on File and then click on Load Workspace Help -help.start() -help(): e.g. help(plot)

6 Search paths + packages search() > search() [1] ".GlobalEnv" "package:ctest" "Autoloads" "package:base" library(cluster) search() > library(cluster) Loading required package: mva > search() [1] ".GlobalEnv" "package:mva" "package:cluster" "package:ctest" [5] "Autoloads" "package:base" ls() : list objects in the GlovalEnv ls(3) : list objects in search position number 3, in the above example, it is package:cluster

7 R Base packages: base ctest mva tcltk etc… Contributed packages: ellipse cluster sma GeneSOM hdarray affy GeneClust bioconductor etc … mypackage Submit to CRAN

8 An introduction to R based on the documents produced by W.N.Venables, D.M.Smith and the R Development Core Team

9 Vectors and assignment R operates on named data structures. The simplest such structure is the numeric vector, which is a single entity consisting of an ordered collection of numbers. To set up a vector named x, say, consisting of five numbers, namely 10.4, 5.6, 3.1, 6.4 and 21.7, use the R command x <- c(10.4, 5.6, 3.1, 6.4, 21.7) or assign(“x”, c(10.4, 5.6, 3.1, 6.4, 21.7)) This is an assignment statement using the function c() This is a numeric vector > is.numeric(x) [1] TRUE

10 Character numeric vector logical X <- c(1:5, 6, 9,3, 10) X <- c(“a”, “b”, “c3”, “4”) X <- c(1, 1, 0, TRUE, FALSE)

11 Other types of objects matrices or more generally arrays are multi-dimensional generalizations of vectors. lists provide a convenient way to return the results of a statistical computation. data frames are matrix-like structures, in which the columns can be of different types. Think of data frames as `data matrices' with one row per observational unit but with (possibly) both numerical and categorical variables. functions are themselves objects in R which can be stored in the project's workspace. This provides a simple and convenient way to extend R.

12 Introduction to Bioconductor (taken from http://www.bioconductor.org) The packages in the initial release include tools which facilitate: - annotation (AnnBuilder, annotate) - data management and organization through the use of the S4 class structure (Biobase, marrayClasses) - identification of differentially expressed genes and clustering (edd, genefilter, geneplotter, multtest, ROC) - analysis of Affymetrix expression array data (affy) - diagnostic plots and normalization for cDNA array data (marrayInput, marrayNorm, marrayPlots) - storage and retrieval of large datasets (rhdf5).

13 Character numeric logical Slots Most packages rely on the class/method mechanism provided by John Chambers’ R methods package, which allows object-oriented programming in R Class

14 marrayInfo maLabels character maInfo data.frame maNotes character This class can be used to store either the gene names Information or samples information

15 marrayLayout maNsc numeric maNsr numeric maNgc numeric maNgr numeric maNspots numeric maSub logical maPlate factor maControls factor maSpotRow numeric maSpotCol numeric maGridRow numeric maGridCol numeric maPrintTip numeric Methods for quantities that are not slots of marrayLayout

16 marrayRaw Methods for quantities that are not slots of marrayRaw maLayout marrayLayout maGnames marrayInfo maTargets marrayInfo maNotes character maRf matrix maRb matrix maGf matrix maGb matrix maW matrix maLR matrix maLG matrix maM matrix maA matrix

17 marrayNorm maLayout marrayLayout maGnames marrayInfo maTargets marrayInfo maNotes character maNormCall call maA matrix maM matrix maMloc matrix maMscale matrix maW matrix

18 Swirl data Data (Spot Files) swirl.1.spot swirl.2.spot swirl.3.spot swirl.4.spot Target information files SwirlSample.txt Gene List fish.gal Layout: Grid size: 4 by 4 Spot matrix: 22 by 24


Download ppt "Introduction to R / sma / Bioconductor Statistics for Microarray Data Analysis The Fields Institute for Research in Mathematical Sciences May 25, 2002."

Similar presentations


Ads by Google