annotate edgeR.pl @ 4:e0e1518e56f6 draft

Uploaded
author rouan
date Thu, 26 Dec 2013 05:35:56 -0500
parents 0f51cd8ddfb0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
1 #/bin/perl
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
2
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
3 use strict;
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
4 use warnings;
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
5 use Getopt::Std;
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
6 use File::Basename;
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
7 use File::Path qw(make_path remove_tree);
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
8 $| = 1;
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
9
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
10 # Grab and set all options
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
11 my %OPTIONS = (a => "glm", d => "tag", f => "BH", r => 5, u => "movingave");
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
12
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
13 getopts('a:d:e:f:h:lmn:o:r:tu:', \%OPTIONS);
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
14
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
15 die qq(
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
16 Usage: edgeR.pl [OPTIONS] factor::factor1::levels [factor::factor2::levels ...] cp::cont_pred1::values [cp::cont_pred2::values ...] cnt::contrast1 [cnt::contrast2] matrix
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
17
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
18 OPTIONS: -a STR Type Of Analysis [glm, pw, limma] (default: $OPTIONS{a})
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
19 -d STR The dispersion estimate to use for GLM analysis [tag, trend, common] (default: $OPTIONS{d})
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
20 -e STR Path to place additional output files
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
21 -f STR False discovery rate adjustment method [BH, holm, hochberg, hommel, BY, none] (default: $OPTIONS{f})
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
22 -h STR Name of html file for additional files
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
23 -l Output the normalised digital gene expression matrix in log2 format (only applicable when using limma and -n is also specified)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
24 -m Perform all pairwise comparisons
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
25 -n STR File name to output the normalised digital gene expression matrix (only applicable when usinf glm or limma model)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
26 -o STR File name to output csv file with results
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
27 -r INT Common Dispersion Rowsum Filter, ony applicable when 1 factor analysis selected (default: $OPTIONS{r})
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
28 -t Estimate Tagwise Disp when performing 1 factor analysis
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
29 -u STR Method for allowing the prior distribution for the dispersion to be abundance- dependent ["movingave", "tricube", "none"] (default: $OPTIONS{u})
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
30
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
31 ) if(!@ARGV);
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
32
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
33 my $matrix = pop @ARGV;
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
34
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
35 make_path($OPTIONS{e});
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
36 open(Rcmd,">$OPTIONS{e}/r_script.R") or die "Cannot open $OPTIONS{e}/r_script.R\n\n";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
37 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
38 zz <- file(\"$OPTIONS{e}/r_script.err\", open=\"wt\")
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
39 sink(zz)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
40 sink(zz, type=\"message\")
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
41
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
42 library(edgeR)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
43 library(limma)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
44
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
45 # read in matrix and groups
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
46 toc <- read.table(\"$matrix\", sep=\"\\t\", comment=\"\", as.is=T)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
47 groups <- sapply(toc[1, -1], strsplit, \":\")
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
48 for(i in 1:length(groups)) { g <- make.names(groups[[i]][2]); names(groups)[i] <- g; groups[[i]] <- groups[[i]][-2] }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
49 colnames(toc) <- make.names(toc[2,])
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
50 toc[,1] <- gsub(\",\", \".\", toc[,1])
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
51 tagnames <- toc[-(1:2), 1]
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
52 rownames(toc) <- toc[,1]
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
53 toc <- toc[-(1:2), -1]
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
54 for(i in colnames(toc)) toc[, i] <- as.numeric(toc[,i])
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
55 norm_factors <- calcNormFactors(as.matrix(toc))
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
56
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
57 pw_tests <- list()
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
58 uniq_groups <- unique(names(groups))
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
59 for(i in 1:(length(uniq_groups)-1)) for(j in (i+1):length(uniq_groups)) pw_tests[[length(pw_tests)+1]] <- c(uniq_groups[i], uniq_groups[j])
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
60 DGE <- DGEList(toc, lib.size=norm_factors*colSums(toc), group=names(groups))
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
61 pdf(\"$OPTIONS{e}/MA_plots_normalisation.pdf\", width=14)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
62 for(i in 1:length(pw_tests)) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
63 j <- c(which(names(groups) == pw_tests[[i]][1])[1], which(names(groups) == pw_tests[[i]][2])[1])
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
64 par(mfrow = c(1, 2))
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
65 maPlot(toc[, j[1]], toc[, j[2]], normalize = TRUE, pch = 19, cex = 0.2, ylim = c(-10, 10), main=paste(\"MA Plot\", colnames(toc)[j[1]], \"vs\", colnames(toc)[j[2]]))
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
66 grid(col = \"blue\")
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
67 abline(h = log2(norm_factors[j[2]]), col = \"red\", lwd = 4)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
68 maPlot(DGE\$counts[, j[1]]/DGE\$samples\$lib.size[j[1]], DGE\$counts[, j[2]]/DGE\$samples\$lib.size[j[2]], normalize = FALSE, pch = 19, cex = 0.2, ylim = c(-8, 8), main=paste(\"MA Plot\", colnames(toc)[j[1]], \"vs\", colnames(toc)[j[2]], \"Normalised\"))
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
69 grid(col = \"blue\")
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
70 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
71 dev.off()
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
72 pdf(file=\"$OPTIONS{e}/MDSplot.pdf\")
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
73 plotMDS(DGE, main=\"MDS Plot\", col=as.numeric(factor(names(groups)))+1, xlim=c(-3,3))
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
74 dev.off()
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
75 tested <- list()
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
76 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
77
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
78 my $all_cont;
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
79 my @add_cont;
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
80 my @fact;
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
81 my @fact_names;
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
82 my @cp;
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
83 my @cp_names;
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
84 if(@ARGV) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
85 foreach my $input (@ARGV) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
86 my @tmp = split "::", $input;
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
87 if($tmp[0] eq "factor") {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
88 $tmp[1] =~ s/[ \?\(\)\[\]\/\\=+<>:;\"\',\*\^\|\&-]/./g;
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
89 push @fact_names, $tmp[1];
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
90 $tmp[2] =~ s/:/\", \"/g;
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
91 $tmp[2] = "\"".$tmp[2]."\"";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
92 push @fact, $tmp[2];
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
93 } elsif($tmp[0] eq "cp") {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
94 $tmp[1] =~ s/[ \?\(\)\[\]\/\\=+<>:;\"\',\*\^\|\&-]/./g;
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
95 push @cp_names, $tmp[1];
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
96 $tmp[2] =~ s/:/, /g;
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
97 push @cp, $tmp[2];
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
98 } elsif($tmp[0] eq "cnt") {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
99 push @add_cont, $tmp[1];
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
100 } else {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
101 die("Unknown Input: $input\n");
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
102 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
103 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
104 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
105
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
106 if($OPTIONS{a} eq "pw") {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
107 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
108 disp <- estimateCommonDisp(DGE, rowsum.filter=$OPTIONS{r})
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
109 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
110 if(defined $OPTIONS{t}) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
111 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
112 disp <- estimateTagwiseDisp(disp, trend=\"$OPTIONS{u}\")
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
113 pdf(file=\"$OPTIONS{e}/Tagwise_Dispersion_vs_Abundance.pdf\")
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
114 plotBCV(disp, cex=0.4)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
115 abline(h=disp\$common.dispersion, col=\"firebrick\", lwd=3)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
116 dev.off()
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
117 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
118 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
119 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
120 for(i in 1:length(pw_tests)) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
121 tested[[i]] <- exactTest(disp, pair=pw_tests[[i]])
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
122 names(tested)[i] <- paste(pw_tests[[i]][2], \"-\", pw_tests[[i]][1], sep=\"\")
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
123 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
124 pdf(file=\"$OPTIONS{e}/Smear_Plots.pdf\")
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
125 for(i in 1:length(pw_tests)) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
126 dt <- decideTestsDGE(tested[[i]], p.value=0.05, adjust.method=\"$OPTIONS{f}\")
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
127 if(sum(dt) > 0) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
128 de_tags <- rownames(disp)[which(dt != 0)]
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
129 ttl <- \"Diff. Exp. Genes With adj. Pvalue < 0.05\"
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
130 } else {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
131 de_tags <- rownames(topTags(tested[[i]], n=100)\$table)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
132 ttl <- \"Top 100 tags\"
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
133 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
134
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
135 if(length(dt) < 5000) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
136 pointcex = 0.5
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
137 } else {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
138 pointcex = 0.2
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
139 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
140 plotSmear(disp, pair=pw_tests[[i]], de.tags = de_tags, main = paste(\"Smear Plot\", names(tested)[i]), cex=0.5)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
141 abline(h = c(-1, 1), col = \"blue\")
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
142 legend(\"topright\", c(\"2 Fold Change\", ttl) , lty=c(1, NA), pch=c(NA, 19), pt.cex=0.5, col=c(\"blue\", \"red\"), bty=\"n\")
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
143 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
144 dev.off()
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
145 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
146 } elsif($OPTIONS{a} eq "glm") {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
147 for(my $fct = 0; $fct <= $#fact_names; $fct++) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
148 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
149 $fact_names[$fct] <- c($fact[$fct])
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
150 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
151 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
152 for(my $fct = 0; $fct <= $#cp_names; $fct++) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
153 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
154 $cp_names[$fct] <- c($cp[$fct])
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
155 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
156 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
157 my $all_fact = "";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
158 if(@fact_names) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
159 foreach (@fact_names) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
160 $all_fact .= " + factor($_)";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
161 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
162 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
163 my $all_cp = "";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
164 if(@cp_names) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
165 $all_cp = " + ".join(" + ", @cp_names);
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
166 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
167 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
168 group_fact <- factor(names(groups))
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
169 design <- model.matrix(~ -1 + group_fact${all_fact}${all_cp})
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
170 colnames(design) <- sub(\"group_fact\", \"\", colnames(design))
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
171 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
172 foreach my $fct (@fact_names) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
173 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
174 colnames(design) <- make.names(sub(\"factor.$fct.\", \"\", colnames(design)))
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
175 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
176 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
177 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
178 disp <- estimateGLMCommonDisp(DGE, design)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
179 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
180 if($OPTIONS{d} eq "tag" || $OPTIONS{d} eq "trend") {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
181 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
182 disp <- estimateGLMTrendedDisp(disp, design)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
183 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
184 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
185 if($OPTIONS{d} eq "tag") {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
186 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
187 disp <- estimateGLMTagwiseDisp(disp, design)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
188 fit <- glmFit(disp, design)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
189 pdf(file=\"$OPTIONS{e}/Tagwise_Dispersion_vs_Abundance.pdf\")
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
190 plotBCV(disp, cex=0.4)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
191 dev.off()
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
192 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
193 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
194 if(@add_cont) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
195 $all_cont = "\"".join("\", \"", @add_cont)."\"";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
196 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
197 cont <- c(${all_cont})
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
198 for(i in uniq_groups) cont <- gsub(paste(groups[[i]], \"([^0-9])\", sep=\"\"), paste(i, \"\\\\1\", sep=\"\"), cont)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
199 for(i in uniq_groups) cont <- gsub(paste(groups[[i]], \"\$\", sep=\"\"), i, cont)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
200 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
201 } else {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
202 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
203 cont <- NULL
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
204 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
205 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
206 if(defined $OPTIONS{m}) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
207 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
208 for(i in 1:length(pw_tests)) cont <- c(cont, paste(pw_tests[[i]][2], \"-\", pw_tests[[i]][1], sep=\"\"))
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
209 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
210 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
211 if(!defined $OPTIONS{m} && !@add_cont){
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
212 die("No Contrasts have been specified, you must at least either select multiple pairwise comparisons or specify a custom contrast\n");
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
213 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
214 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
215 fit <- glmFit(disp, design)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
216 cont <- makeContrasts(contrasts=cont, levels=design)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
217 for(i in colnames(cont)) tested[[i]] <- glmLRT(fit, contrast=cont[,i])
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
218 pdf(file=\"$OPTIONS{e}/Smear_Plots.pdf\")
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
219 for(i in colnames(cont)) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
220 dt <- decideTestsDGE(tested[[i]], p.value=0.05, adjust.method=\"$OPTIONS{f}\")
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
221 if(sum(dt) > 0) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
222 de_tags <- rownames(disp)[which(dt != 0)]
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
223 ttl <- \"Diff. Exp. Genes With adj. Pvalue < 0.05\"
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
224 } else {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
225 de_tags <- rownames(topTags(tested[[i]], n=100)\$table)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
226 ttl <- \"Top 100 tags\"
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
227 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
228
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
229 if(length(dt) < 5000) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
230 pointcex = 0.5
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
231 } else {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
232 pointcex = 0.2
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
233 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
234 plotSmear(disp, de.tags = de_tags, main = paste(\"Smear Plot\", i), cex=pointcex)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
235 abline(h = c(-1, 1), col = \"blue\")
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
236 legend(\"topright\", c(\"2 Fold Change\", ttl) , lty=c(1, NA), pch=c(NA, 19), pt.cex=0.5, col=c(\"blue\", \"red\"), bty=\"n\")
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
237 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
238 dev.off()
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
239 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
240 if(defined $OPTIONS{n}) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
241 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
242 tab <- data.frame(ID=rownames(fit\$fitted.values), fit\$fitted.values, stringsAsFactors=F)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
243 write.table(tab, \"$OPTIONS{n}\", quote=F, sep=\"\\t\", row.names=F)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
244 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
245 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
246 } elsif($OPTIONS{a} eq "limma") {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
247 for(my $fct = 0; $fct <= $#fact_names; $fct++) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
248 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
249 $fact_names[$fct] <- c($fact[$fct])
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
250 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
251 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
252 for(my $fct = 0; $fct <= $#cp_names; $fct++) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
253 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
254 $cp_names[$fct] <- c($cp[$fct])
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
255 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
256 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
257 my $all_fact = "";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
258 if(@fact_names) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
259 foreach (@fact_names) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
260 $all_fact .= " + factor($_)";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
261 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
262 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
263 my $all_cp = "";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
264 if(@cp_names) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
265 $all_cp = " + ".join(" + ", @cp_names);
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
266 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
267 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
268 group_fact <- factor(names(groups))
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
269 design <- model.matrix(~ -1 + group_fact${all_fact}${all_cp})
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
270 colnames(design) <- sub(\"group_fact\", \"\", colnames(design))
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
271 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
272 foreach my $fct (@fact_names) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
273 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
274 colnames(design) <- make.names(sub(\"factor.$fct.\", \"\", colnames(design)))
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
275 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
276 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
277 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
278 isexpr <- rowSums(cpm(toc)>1) >= 2
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
279 toc <- toc[isexpr, ]
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
280 pdf(file=\"$OPTIONS{e}/LIMMA_voom.pdf\")
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
281 y <- voom(toc, design, plot=TRUE, lib.size=colSums(toc)*norm_factors)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
282 dev.off()
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
283
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
284 pdf(file=\"$OPTIONS{e}/LIMMA_MDS_plot.pdf\")
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
285 plotMDS(y, labels=colnames(toc), col=as.numeric(factor(names(groups)))+1, gene.selection=\"common\")
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
286 dev.off()
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
287 fit <- lmFit(y, design)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
288 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
289 if(defined $OPTIONS{n}) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
290 if(defined $OPTIONS{l}) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
291 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
292 tab <- data.frame(ID=rownames(y\$E), y\$E, stringsAsFactors=F)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
293 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
294 } else {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
295 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
296 tab <- data.frame(ID=rownames(y\$E), 2^y\$E, stringsAsFactors=F)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
297 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
298 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
299 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
300 write.table(tab, \"$OPTIONS{n}\", quote=F, sep=\"\\t\", row.names=F)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
301 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
302 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
303 if(@add_cont) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
304 $all_cont = "\"".join("\", \"", @add_cont)."\"";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
305 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
306 cont <- c(${all_cont})
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
307 for(i in uniq_groups) cont <- gsub(paste(groups[[i]], \"([^0-9])\", sep=\"\"), paste(i, \"\\\\1\", sep=\"\"), cont)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
308 for(i in uniq_groups) cont <- gsub(paste(groups[[i]], \"\$\", sep=\"\"), i, cont)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
309 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
310 } else {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
311 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
312 cont <- NULL
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
313 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
314 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
315 if(defined $OPTIONS{m}) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
316 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
317 for(i in 1:length(pw_tests)) cont <- c(cont, paste(pw_tests[[i]][2], \"-\", pw_tests[[i]][1], sep=\"\"))
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
318 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
319 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
320 if(!defined $OPTIONS{m} && !@add_cont){
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
321 die("No Contrasts have been specified, you must at least either select multiple pairwise comparisons or specify a custom contrast\n");
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
322 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
323 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
324 cont <- makeContrasts(contrasts=cont, levels=design)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
325 fit2 <- contrasts.fit(fit, cont)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
326 fit2 <- eBayes(fit2)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
327 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
328 } else {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
329 die("Anaysis type $OPTIONS{a} not found\n");
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
330
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
331 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
332
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
333 if($OPTIONS{a} ne "limma") {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
334 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
335 options(digits = 6)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
336 tab <- NULL
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
337 for(i in names(tested)) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
338 tab_tmp <- topTags(tested[[i]], n=Inf, adjust.method=\"$OPTIONS{f}\")[[1]]
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
339 colnames(tab_tmp) <- paste(i, colnames(tab_tmp), sep=\":\")
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
340 tab_tmp <- tab_tmp[tagnames,]
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
341 if(is.null(tab)) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
342 tab <- tab_tmp
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
343 } else tab <- cbind(tab, tab_tmp)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
344 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
345 tab <- cbind(Feature=rownames(tab), tab)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
346 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
347 } else {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
348 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
349 tab <- NULL
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
350 options(digits = 6)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
351 for(i in colnames(fit2)) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
352 tab_tmp <- topTable(fit2, coef=i, n=Inf, sort.by=\"none\", adjust.method=\"$OPTIONS{f}\")
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
353 colnames(tab_tmp)[-1] <- paste(i, colnames(tab_tmp)[-1], sep=\":\")
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
354 if(is.null(tab)) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
355 tab <- tab_tmp
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
356 } else tab <- cbind(tab, tab_tmp[,-1])
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
357 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
358 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
359 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
360 print Rcmd "
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
361 write.table(tab, \"$OPTIONS{o}\", quote=F, sep=\"\\t\", row.names=F)
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
362 sink(type=\"message\")
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
363 sink()
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
364 ";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
365 close(Rcmd);
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
366 system("R --no-restore --no-save --no-readline < $OPTIONS{e}/r_script.R > $OPTIONS{e}/r_script.out");
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
367
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
368 open(HTML, ">$OPTIONS{h}");
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
369 print HTML "<html><head><title>EdgeR: Empirical analysis of digital gene expression data</title></head><body><h3>EdgeR Additional Files:</h3><p><ul>\n";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
370 print HTML "<li><a href=MA_plots_normalisation.pdf>MA_plots_normalisation.pdf</a></li>\n";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
371 print HTML "<li><a href=MDSplot.pdf>MDSplot.pdf</a></li>\n";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
372 if($OPTIONS{a} eq "pw") {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
373 if(defined $OPTIONS{t}) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
374 print HTML "<li><a href=Tagwise_Dispersion_vs_Abundance.pdf>Tagwise_Dispersion_vs_Abundance.pdf</a></li>\n";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
375 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
376 print HTML "<li><a href=Smear_Plots.pdf>Smear_Plots.pdf</a></li>\n";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
377 } elsif($OPTIONS{a} eq "glm" && $OPTIONS{d} eq "tag") {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
378 print HTML "<li><a href=Tagwise_Dispersion_vs_Abundance.pdf>Tagwise_Dispersion_vs_Abundance.pdf</a></li>\n";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
379 print HTML "<li><a href=Smear_Plots.pdf>Smear_Plots.pdf</a></li>\n";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
380 } elsif($OPTIONS{a} eq "glm" && ($OPTIONS{d} eq "trend" || $OPTIONS{d} eq "common")) {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
381 print HTML "<li><a href=Smear_Plots.pdf>Smear_Plots.pdf</a></li>\n";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
382 } elsif($OPTIONS{a} eq "limma") {
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
383 print HTML "<li><a href=LIMMA_MDS_plot.pdf>LIMMA_MDS_plot.pdf</a></li>\n";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
384 print HTML "<li><a href=LIMMA_voom.pdf>LIMMA_voom.pdf</a></li>\n";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
385 }
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
386 print HTML "<li><a href=r_script.R>r_script.R</a></li>\n";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
387 print HTML "<li><a href=r_script.out>r_script.out</a></li>\n";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
388 print HTML "<li><a href=r_script.err>r_script.err</a></li>\n";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
389 print HTML "</ul></p>\n";
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
390 close(HTML);
0f51cd8ddfb0 Uploaded
rouan
parents:
diff changeset
391