Last data update: 2014.03.03

R: Display the analysis code from the 2009 Nature protocols...
NP2009codeR Documentation

Display the analysis code from the 2009 Nature protocols paper

Description

This function opens an editor displaying the analysis code of the Nature Protocols 2009 paper

Usage

NP2009code()

Details

The edit function uses getOption("editor") to select the editor. Use, for instance, options(editor="emacs") to set another editor.

Author(s)

Steffen Durinck, Wolfgang Huber

See Also

edit

Examples

if(interactive()){
NP2009code()
}

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(biomaRt)
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/biomaRt/NP2009code.Rd_%03d_medium.png", width=480, height=480)
> ### Name: NP2009code
> ### Title: Display the analysis code from the 2009 Nature protocols paper
> ### Aliases: NP2009code
> ### Keywords: methods
> 
> ### ** Examples
> 
> #if(interactive()){
> NP2009code()
Vim: Warning: Output is not to a terminal
Vim: Warning: Input is not from a terminal
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"~/local/lib64/R/library/biomaRt/scripts/Integration-NP.R" </library/biomaRt/scripts/Integration-NP.R" [noeol] 1L, 6106C###--------------------------------------------------^M### Step 1^M###---------------------------------------------------^Mlibrary('biomaRt')^Mlibrary('affy')^Mllibrary('gplots')^Mlibrary('lattice')^M^M^M###---------------------------------------------------^M### Step 2^M###---------------------------------------------------^MsampleAnnot = read.AnnotatedDataFrame('E-TABM-157.txt',row.names = 'Array.Daata.File')^MmRNAraw = ReadAffy(phenoData = sampleAnnot, ^M  sampleNames = sampleAAnnot$Source.Name)^M^M^M###--------------------------------------------------^M#### Step 3^M###--------------------------------------------------^MmRNA = rma(mRNAAraw)^M^M^M###--------------------------------------------------^M### Step 4^M####--------------------------------------------------^Mprobesetvar = apply(exprs(mRRNA), 1, var)^Mord = order(probesetvar, decreasing=TRUE)[1:200]^Mpca = prcomp(t(eexprs(mRNA)[ord,]), scale=TRUE)^MtypeColors = c('Lu'='firebrick1','BaA'='dodgerbllue2','BaB'='darkblue')^Mplot(pca$x[, 1:2], pch=16, col=typeColors[as.character(mmRNA$CancerType)], ^M     xlab='PC1', ylab='PC2', asp=1)^Mlegend('topleft', c('luuminal', 'basal A', 'basal B'), fill=typeColors)^M^M^M###---------------------------------------------------^M### Step 5^M###---------------------------------------------------^McghData = read.csv('aCGH.csv', header=TRUE, row.names=1)^Mcgh = nnew('ExpressionSet', exprs = as.matrix(cghData[,4:56]))^MfeatureData(cgh) = as(cgghData[,1:3], 'AnnotatedDataFrame')^M^M^M###---------------------------------------------------^M### Step 6^M###---------------------------------------------------^Mchr1 = which(featureData(cgh)$Chrom == 1)^MclColors = c('MCF10A' = 'dodgerbluee3',  'BT483' = 'orange', 'BT549' =^M  'olivedrab')^MlogRatio = exprs(cgh)[chr1,  names(clColors)]^Mkb = rep(featureData(cgh)$kb[chr1], times=ncol(logRatio))^MclN1,1All[?12l[?25h