Mercurial > repos > qfabrepo > metadegalaxy_symmetric_plot
annotate symmetric_plot.r @ 2:91fb94d203df draft default tip
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit 9767e7d8ab085c7d6323b8323d9047cb68bc0211"
author | qfabrepo |
---|---|
date | Wed, 16 Sep 2020 06:32:20 +0000 |
parents | 0cac08094b86 |
children |
rev | line source |
---|---|
0
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
1 library('getopt') |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
2 library('tidyr') |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
3 suppressPackageStartupMessages(library('dplyr')) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
4 suppressPackageStartupMessages(library('phyloseq')) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
5 suppressPackageStartupMessages(library('DESeq2')) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
6 suppressPackageStartupMessages(library('ggplot2')) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
7 suppressPackageStartupMessages(library('data.table')) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
8 Sys.setenv("DISPLAY"=":1") |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
9 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
10 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
11 options(warn= -1) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
12 option_specification = matrix(c( |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
13 'input.data','i',2,'character', |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
14 'meta.data','m',2,'character', |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
15 'obs.data','t',2,'character', |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
16 'record','r',2,'numeric', |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
17 'taxrank','x',2,'character', |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
18 'norm','n',2,'logical', |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
19 'n.column','c',2,'numeric', |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
20 'g.group','g',2,'character', |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
21 'outdir','o',2,'character', |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
22 'htmlfile','h',2,'character' |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
23 ),byrow=TRUE,ncol=4); |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
24 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
25 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
26 options <- getopt(option_specification); |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
27 options(bitmapType="cairo") |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
28 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
29 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
30 if (!is.null(options$outdir)) { |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
31 # Create the directory |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
32 dir.create(options$outdir,FALSE) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
33 } |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
34 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
35 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
36 input.table<-read.table(options$input.data,header=T,sep="\t",stringsAsFactors = F) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
37 metadata.table<-read.table(options$meta.data,header=T,sep="\t",stringsAsFactors = F,comment.char="") |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
38 obs.table<-read.table(options$obs.data,header=F,sep="\t",stringsAsFactors = F,comment.char="") |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
39 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
40 colnames(obs.table)<-c("OTUID","taxonomy") |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
41 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
42 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
43 tax_col <- c("OTUID","Kingdom","Phylum","Class","Order","Family","Genus","Species") |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
44 tax_col_extra <- c("OTUID","None","Kingdom","Phylum","Class","Order","Family","Genus","Species") |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
45 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
46 ### remove the leading #sign in column name if the column name begins with number |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
47 colnames(input.table)<-gsub("^X","",colnames(input.table)) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
48 colnames(metadata.table)<-gsub("^X.","",colnames(metadata.table)) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
49 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
50 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
51 column.name<-colnames(metadata.table)[options$n.column] |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
52 #in.column<-options$g.column |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
53 in.group<-options$g.group |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
54 nrecord<-options$record |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
55 ranking<-options$taxrank |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
56 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
57 ### create data frame for group |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
58 group.df<-data.frame(group=unlist(strsplit(in.group,",")),stringsAsFactors = F) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
59 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
60 ### get the number of group |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
61 number.of.group<-dim(group.df)[1] |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
62 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
63 if(number.of.group != 2){ |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
64 print(paste("Number of group for comparision is",number.of.group,sep="")) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
65 quit("yes") |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
66 } |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
67 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
68 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
69 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
70 group1<-metadata.table[which(metadata.table[,column.name] %in% group.df$group[1]),]$SampleID |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
71 group2<-metadata.table[which(metadata.table[,column.name] %in% group.df$group[2]),]$SampleID |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
72 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
73 sample2group.map <- data.frame(sample=colnames(input.table[,c(group1,group2)]), |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
74 groups=c(rep(group.df$group[1],length(group1)), |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
75 rep(group.df$group[2],length(group2)))) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
76 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
77 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
78 if(options$norm =="false"){ |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
79 ### raw count table |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
80 count.table<-input.table |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
81 rownames(count.table)<-count.table[,1] |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
82 count.table<-count.table[,-1] |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
83 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
84 suppressMessages(raw.count.deseq.obj<-DESeqDataSetFromMatrix(countData = count.table,colData=metadata.table, as.formula(paste('~',column.name,sep="")))) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
85 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
86 gm_mean = function(x, na.rm=TRUE){ |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
87 exp(sum(log(x[x > 0]), na.rm=na.rm) / length(x)) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
88 } |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
89 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
90 geoMeans = apply(counts(raw.count.deseq.obj), 1, gm_mean) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
91 deseq_obj = estimateSizeFactors(raw.count.deseq.obj, geoMeans = geoMeans) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
92 deseq_obj_norm<-counts(deseq_obj,normalized=T) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
93 } else { |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
94 deseq_obj_norm<-input.table |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
95 rownames(deseq_obj_norm)<-deseq_obj_norm[,1] |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
96 deseq_obj_norm<-deseq_obj_norm[,-1] |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
97 } |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
98 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
99 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
100 #first.50.otu.id<-rownames(counts(raw.count.deseq.obj))[1:50] |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
101 first.50.otu.id<-rownames(deseq_obj_norm)[1:nrecord] |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
102 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
103 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
104 #filtered.data<-counts(raw.count.deseq.obj)[first.50.otu.id,c(group1,group2)] |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
105 filtered.data<-deseq_obj_norm[first.50.otu.id,c(group1,group2)] |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
106 filtered.data<-as.data.frame(cbind(OTUID=rownames(filtered.data),filtered.data),stringsAsFactors=F) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
107 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
108 nc <- match('OTUID',colnames(filtered.data)) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
109 filtered.data[,-nc]<-sapply(filtered.data[,-nc],as.integer) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
110 stopifnot(min(range(filtered.data[,-nc]))>=0) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
111 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
112 long <- gather(filtered.data,sample,expr,-OTUID) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
113 suppressMessages((long <- left_join(long, sample2group.map))) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
114 long$expr[long$groups == group.df$group[1]] <- long$expr*-1 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
115 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
116 sorted.OTU <- rev(sort(unique(long$OTUID))) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
117 long$OTUID <- factor(long$OTUID, levels=sorted.OTU) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
118 long$sample <- as.factor(long$sample) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
119 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
120 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
121 tax.table.new<-as.data.frame(cbind(obs.table[,1],t(as.data.table(strsplit(obs.table[,2],";"))))) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
122 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
123 if(length(colnames(tax.table.new)) != length(tax_col_extra)) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
124 { |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
125 colnames(tax.table.new)<-tax_col |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
126 } else { |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
127 colnames(tax.table.new)<-tax_col_extra |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
128 } |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
129 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
130 long<-cbind(long,tax.table.new[match(long$OTUID,tax.table.new$OTUID),-1]) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
131 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
132 comparison<-paste(column.name,paste(group.df$group[1],group.df$group[2],sep="-"),sep=" ") |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
133 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
134 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
135 p<-ggplot(long,aes(x=reorder(OTUID,expr),y=expr, fill=groups)) + |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
136 geom_bar(stat='identity') + theme_bw() + |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
137 xlab("OTU ID") + |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
138 labs(title=comparison) + facet_grid( as.formula(paste(ranking,"~ .",sep="")),scales = "free", space = "free" ) + theme(strip.text.y = element_text(angle = 0)) + |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
139 coord_flip() |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
140 q<-ggplot_build(p) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
141 q$layout$panel_ranges[[1]]$x.labels <- gsub("-","",q$layout$panel_ranges[[1]]$x.labels) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
142 #Reassemble the plot using ggplot_gtable() |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
143 q<-ggplot_gtable(q) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
144 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
145 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
146 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
147 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
148 pdffile <- gsub("[ ]+", "", paste(options$outdir,"/symmetric.pdf")) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
149 pngfile_symmetric <- gsub("[ ]+", "", paste(options$outdir,"/symmetric.png")) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
150 htmlfile <- gsub("[ ]+", "", paste(options$htmlfile)) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
151 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
152 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
153 # Produce PDF file |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
154 pdf(pdffile); |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
155 plot(q) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
156 garbage<-dev.off(); |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
157 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
158 #png('richness.png') |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
159 bitmap(pngfile_symmetric,"png16m",height=10,width=10,res=100) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
160 plot(q) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
161 garbage<-dev.off() |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
162 |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
163 # Produce the HTML file |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
164 htmlfile_handle <- file(htmlfile) |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
165 html_output = c('<html><body>', |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
166 '<table align="center">', |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
167 '<tr>', |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
168 '<td valign="middle" style="vertical-align:middle;">', |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
169 '<a href="pdffile.pdf"><img src="symmetric.png"/></a>', |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
170 '</td>', |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
171 '</tr>', |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
172 '</table>', |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
173 '</html></body>'); |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
174 writeLines(html_output, htmlfile_handle); |
0cac08094b86
"planemo upload for repository https://github.com/QFAB-Bioinformatics/metaDEGalaxy/tree/master/symmetric_plot commit a68579d7bdde7420b8f04346d3b6e361588acf50"
qfabrepo
parents:
diff
changeset
|
175 close(htmlfile_handle); |