R: Display the analysis code from the 2009 Nature protocols...
NP2009code
R 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=[1;24r[?12;25h[?12l[?25h[27m[23m[m[H[2J[?25l[24;1H"~/local/lib64/R/library/biomaRt/scripts/Integration-NP.R" </library/biomaRt/scripts/Integration-NP.R" [noeol] 1L, 6106C[1;1H[34m###--------------------------------------------------^M### Step 1^M###-----------[2;1H----------------------------------------^Mlibrary('biomaRt')^Mlibrary('affy')^Mll[3;1Hibrary('gplots')^Mlibrary('lattice')^M^M^M###------------------------------------[4;1H---------------^M### Step 2^M###-------------------------------------------------[5;1H--^MsampleAnnot = read.AnnotatedDataFrame('E-TABM-157.txt',row.names = 'Array.Daa[6;1Hta.File')^MmRNAraw = ReadAffy(phenoData = sampleAnnot, ^M sampleNames = sampleAA[7;1Hnnot$Source.Name)^M^M^M###--------------------------------------------------^M###[8;1H# Step 3^M###--------------------------------------------------^MmRNA = rma(mRNAA[9;1Hraw)^M^M^M###--------------------------------------------------^M### Step 4^M####[10;1H--------------------------------------------------^Mprobesetvar = apply(exprs(mRR[11;1HNA), 1, var)^Mord = order(probesetvar, decreasing=TRUE)[1:200]^Mpca = prcomp(t(ee[12;1Hxprs(mRNA)[ord,]), scale=TRUE)^MtypeColors = c('Lu'='firebrick1','BaA'='dodgerbll[13;1Hue2','BaB'='darkblue')^Mplot(pca$x[, 1:2], pch=16, col=typeColors[as.character(mm[14;1HRNA$CancerType)], ^M xlab='PC1', ylab='PC2', asp=1)^Mlegend('topleft', c('luu[15;1Hminal', 'basal A', 'basal B'), fill=typeColors)^M^M^M###-------------------------[16;1H--------------------------^M### Step 5^M###--------------------------------------[17;1H-------------^McghData = read.csv('aCGH.csv', header=TRUE, row.names=1)^Mcgh = nn[18;1Hew('ExpressionSet', exprs = as.matrix(cghData[,4:56]))^MfeatureData(cgh) = as(cgg[19;1HhData[,1:3], 'AnnotatedDataFrame')^M^M^M###--------------------------------------[20;1H-------------^M### Step 6^M###---------------------------------------------------[21;1H^Mchr1 = which(featureData(cgh)$Chrom == 1)^MclColors = c('MCF10A' = 'dodgerbluee[22;1H3', 'BT483' = 'orange', 'BT549' =^M 'olivedrab')^MlogRatio = exprs(cgh)[chr1, [23;1Hnames(clColors)]^Mkb = rep(featureData(cgh)$kb[chr1], times=ncol(logRatio))^MclN[m[24;63H1,1[11CAll[1;1H[?12l[?25h