annotate deseq/deseq.R @ 0:d7f27b43b8ff draft

Uploaded
author nikhil-joshi
date Thu, 05 Jul 2012 21:02:43 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
1 ## Run DESeq (oversimplified) in Galaxy.
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
2 ## Format: Rscript deseq3.R tab-delimited-counts.txt comma,delimited,col,names,except,first,gene,id,col comparison,here outputfile
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
3 ##
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
4 ## The incoming data must have the first column be the gene names, and
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
5 ## the rest raw counts. The next argument is the list of groups
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
6 ## (i.e. liver,liver,kidney,kidney), and the final argument is the
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
7 ## comparison, i.e. kidney,liver. This produces a top-table called
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
8 ## top-table.txt ordered by p-value.
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
9
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
10 cargs <- commandArgs()
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
11 cargs <- cargs[(which(cargs == "--args")+1):length(cargs)]
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
12
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
13 countstable <- cargs[1]
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
14 conds <- unlist(strsplit(cargs[2], ','))
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
15 comparison <- unlist(strsplit(cargs[3], ','))
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
16 outputfile <- cargs[4]
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
17 diag.html = cargs[5]
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
18 temp.files.path = cargs[6]
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
19 counts.name = cargs[7]
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
20
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
21 # the comparison must only have two values and the conds must
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
22 # be a vector from those values, at least one of each.
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
23 if (length(unique(conds)) != 2) {
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
24 stop("You can only have two columns types: ", cargs[2])
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
25 }
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
26
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
27 if (length(comparison) != 2) {
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
28 stop("Comparison type must be a tuple: ", cargs[3])
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
29 }
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
30
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
31 if (!identical(sort(comparison), sort(unique(conds)))) {
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
32 stop("Column types must use the two names from Comparison type, and vice versa. Must have at least one of each in the Column types.\nColumn types: ", cargs[2], "\n", "Comparison type: ", cargs[3])
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
33 }
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
34
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
35 sink("/dev/null")
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
36 dir.create(temp.files.path, recursive=TRUE)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
37 library(DESeq)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
38
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
39 d <- read.table(countstable, sep="\t", header=TRUE, row.names=1)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
40
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
41 if (length(d) != length(conds)) {
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
42 stop("Number of total sample columns in counts file must correspond to the columns types field. E.g. if column types is 'kidney,kidney,liver,liver' then number of sample columns in counts file must be 4 as well.")
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
43 }
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
44
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
45 cds <- newCountDataSet(d, conds)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
46 cds <- estimateSizeFactors(cds)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
47
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
48 cdsBlind <- estimateDispersions( cds, method="blind" )
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
49
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
50 if (length(conds) != 2) {
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
51 cds <- estimateDispersions( cds )
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
52 norep = FALSE
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
53 }
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
54
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
55 if (length(conds) == 2) {
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
56 cds <- estimateDispersions( cds, method="blind", sharingMode="fit-only" )
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
57 norep = TRUE
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
58 }
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
59
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
60 plotDispEsts <- function( cds )
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
61 {
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
62 plot(
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
63 rowMeans( counts( cds, normalized=TRUE ) ),
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
64 fitInfo(cds)$perGeneDispEsts,
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
65 pch = '.', log="xy" )
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
66 xg <- 10^seq( -.5, 5, length.out=300 )
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
67 lines( xg, fitInfo(cds)$dispFun( xg ), col="red" )
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
68 }
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
69
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
70 temp.disp.est.plot = file.path( temp.files.path, "DispersionEstimatePlot.png" )
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
71 png( temp.disp.est.plot, width=500, height=500 )
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
72 plotDispEsts( cds )
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
73 dev.off()
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
74
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
75 res <- nbinomTest(cds, comparison[1], comparison[2])
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
76
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
77 write.table(res[order(res$padj), ], file=outputfile, quote=FALSE, row.names=FALSE, sep="\t")
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
78
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
79
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
80 plotDE <- function( res )
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
81 plot(
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
82 res$baseMean,
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
83 res$log2FoldChange,
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
84 log="x", pch=20, cex=.3,
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
85 col = ifelse( res$padj < .1, "red", "black" ) )
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
86
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
87 temp.de.plot = file.path( temp.files.path, "DiffExpPlot.png")
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
88 png( temp.de.plot, width=500, height=500 )
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
89 plotDE( res )
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
90 dev.off()
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
91
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
92
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
93 temp.pval.plot = file.path( temp.files.path, "PvalHist.png")
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
94 png( temp.pval.plot, width=500, height=500 )
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
95 hist(res$pval, breaks=100, col="skyblue", border="slateblue", main="")
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
96 dev.off()
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
97
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
98 vsd <- getVarianceStabilizedData( cdsBlind )
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
99
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
100 temp.heatmap.plot = file.path( temp.files.path, "heatmap.png" )
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
101 png( temp.heatmap.plot, width=500, height=500 )
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
102 select <- order(res$pval)[1:100]
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
103 colors <- colorRampPalette(c("white","darkblue"))(100)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
104 heatmap( vsd[select,], col = colors, scale = "none", Rowv=NULL, main="")
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
105 dev.off()
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
106
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
107
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
108 mod_lfc <- (rowMeans( vsd[, conditions(cds)==comparison[2], drop=FALSE] ) - rowMeans( vsd[, conditions(cds)==comparison[1], drop=FALSE] ))
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
109 lfc <- res$log2FoldChange
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
110 finite <- is.finite(lfc)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
111 table(as.character(lfc[!finite]), useNA="always")
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
112 largeNumber <- 10
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
113 lfc <- ifelse(finite, lfc, sign(lfc) * largeNumber)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
114
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
115 temp.modlfc.plot = file.path( temp.files.path, "modlfc.png" )
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
116 png( temp.modlfc.plot, width=500, height=500 )
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
117 plot( lfc, mod_lfc, pch=20, cex=.3, col = ifelse( finite, "#80808040", "red" ) )
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
118 abline( a=0, b=1, col="#40404040" )
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
119 dev.off()
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
120
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
121 temp.sampclust.plot = file.path( temp.files.path, "sampclust.png" )
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
122 png( temp.sampclust.plot, width=500, height=500 )
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
123 dists <- dist( t( vsd ) )
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
124 heatmap( as.matrix( dists ),
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
125 symm=TRUE, scale="none", margins=c(10,10),
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
126 col = colorRampPalette(c("darkblue","white"))(100),
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
127 labRow = paste( pData(cdsBlind)$condition, pData(cdsBlind)$type ) )
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
128 dev.off()
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
129
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
130
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
131 library(aroma.light)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
132 library(lattice)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
133
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
134 mdsPlot <- function(x, conds=NULL, cex=1, ...) {
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
135 d <- dist(x)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
136
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
137 mds.fit <- cmdscale(d, eig=TRUE, k=2)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
138
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
139 mds.d <- data.frame(x1=mds.fit$points[, 1],
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
140 x2=mds.fit$points[, 2],
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
141 labels=rownames(x))
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
142 if (!is.null(conds))
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
143 mds.d$treatment <- as.factor(conds)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
144
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
145 if (!is.null(conds)) {
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
146 p <- xyplot(x2 ~ x1, group=treatment, data=mds.d, panel=function(x, y, ..., groups, subscripts) {
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
147 panel.text(x, y, mds.d$labels[subscripts], cex=cex, col=trellis.par.get()$superpose.line$col[groups])
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
148 }, ...)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
149 } else {
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
150 p <- xyplot(x2 ~ x1, data=mds.d, panel=function(x, y, ..., groups, subscripts) {
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
151 panel.text(x, y, mds.d$labels[subscripts], cex=cex)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
152 }, ...)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
153 }
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
154 return(p)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
155 }
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
156
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
157 if (!norep) {
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
158 dn = normalizeQuantileRank(as.matrix(d))
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
159 p = mdsPlot(t(log10(dn+1)), conds=conds, xlab="dimension 1", ylab="dimension 2", main="")
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
160
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
161 temp.mds.plot = file.path( temp.files.path, "mds.png" )
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
162 png( temp.mds.plot, width=500, height=500 )
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
163 print(p)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
164 dev.off()
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
165 }
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
166
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
167 file.conn = file(diag.html, open="w")
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
168 writeLines( c("<html><body bgcolor='lightgray'>"), file.conn)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
169 writeLines( c("<h2><u>Diagnostic Plots for ", counts.name, "</u></h2>"), file.conn)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
170 writeLines( c("<h3>Dispersion Estimates</h3>"), file.conn)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
171 writeLines( c("<img src='DispersionEstimatePlot.png'><br/><br/>"), file.conn)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
172 writeLines( c("<h3>Differential Expression - Base Mean vs. Log2 Fold Change</h3>"), file.conn)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
173 writeLines( c("<img src='DiffExpPlot.png'><br/><br/>"), file.conn)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
174 writeLines( c("<h3>P-value histogram</h3>"), file.conn)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
175 writeLines( c("<img src='PvalHist.png'><br/><br/>"), file.conn)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
176 writeLines( c("<h3>Top 100 Genes/Transcripts by P-value</h3>"), file.conn)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
177 writeLines( c("<img src='heatmap.png'><br/><br/>"), file.conn)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
178 writeLines( c("<h3>Moderated LFC vs. LFC</h3>"), file.conn)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
179 writeLines( c("<img src='modlfc.png'><br/><br/>"), file.conn)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
180 writeLines( c("<h3>VST Sample Clustering</h3>"), file.conn)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
181 writeLines( c("<img src='sampclust.png'><br/><br/>"), file.conn)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
182 writeLines( c("<h3>MDS Plot</h3>"), file.conn)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
183
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
184 if (!norep) {
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
185 writeLines( c("<img src='mds.png'><br/><br/>"), file.conn)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
186 }
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
187
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
188 if (norep) {
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
189 writeLines( c("<h4>MDS plot not produced for unreplicated data</h4>"), file.conn)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
190 }
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
191
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
192 writeLines( c("</body></html>"), file.conn)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
193 close(file.conn)
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
194
d7f27b43b8ff Uploaded
nikhil-joshi
parents:
diff changeset
195 sink(NULL)