Mercurial > repos > blankenberglab > gpca
annotate r-gpca.R @ 2:4865e7f4e9c5 draft
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit b72f398663cc133523cae0f5d7db2af1b4312f7a
| author | blankenberglab |
|---|---|
| date | Tue, 27 Nov 2018 12:29:58 -0500 |
| parents | d93629e79f5e |
| children | 8def7dda3bee |
| rev | line source |
|---|---|
|
0
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
1 #!/usr/bin/env Rscript |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
2 library(optparse) |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
3 library(gPCA) |
|
1
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
4 options(bitmapType='cairo') |
|
0
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
5 |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
6 |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
7 # parse options |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
8 option_list = list( |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
9 make_option( |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
10 c("--version"), |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
11 action = "store_true", |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
12 default = FALSE, |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
13 help = "Print version and exit" |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
14 ), |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
15 make_option( |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
16 c("-i", "--batch"), |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
17 action = "store", |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
18 default = NA, |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
19 type = 'character', |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
20 help = "Input batch" |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
21 ), |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
22 make_option( |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
23 c("-d", "--data"), |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
24 action = "store", |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
25 default = NA, |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
26 type = 'character', |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
27 help = "Input data" |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
28 ), |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
29 make_option( |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
30 c("-n", "--nperm"), |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
31 action = "store", |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
32 default = 1000, |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
33 type = 'numeric', |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
34 help = "Number of permutations to preform" |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
35 ), |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
36 make_option( |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
37 c("-c", "--center"), |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
38 action = "store_true", |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
39 default = FALSE, |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
40 help = "Is the input batch and data centered [default %default]" |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
41 ), |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
42 make_option( |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
43 c("-y", "--scaleY"), |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
44 action = "store_true", |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
45 default = FALSE, |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
46 help = "Scale to Y axis" |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
47 ), |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
48 make_option( |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
49 c("-f", "--filt"), |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
50 action = "store", |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
51 default = NULL, |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
52 type = 'numeric', |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
53 help = "Retain features" |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
54 ), |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
55 make_option( |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
56 c( "--npcs"), |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
57 action = "store", |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
58 default = 3, |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
59 type = 'numeric', |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
60 help = "Number of principal components to plot" |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
61 ), |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
62 make_option( |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
63 c("-p", "--path"), |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
64 action = "store", |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
65 default = '$html_outfile.extra_files_path', |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
66 type = 'character', |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
67 help = "File path" |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
68 ), |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
69 make_option( |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
70 c("-s", "--seed"), |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
71 action = "store", |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
72 default = NULL, |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
73 type = 'numeric', |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
74 help = "Set a seed number" |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
75 ), |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
76 make_option( |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
77 c("-x", "--numbers_outfile"), |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
78 action = "store", |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
79 default = NA, |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
80 type = 'character', |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
81 help = "Numbers output" |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
82 ), |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
83 make_option( |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
84 c("-o", "--html_outfile"), |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
85 action = "store", |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
86 default = NA, |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
87 type = 'character', |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
88 help = "Output", |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
89 ) |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
90 ) |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
91 |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
92 opt <-parse_args(OptionParser(option_list = option_list)) |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
93 |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
94 if (opt$version){ |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
95 # print version and exit |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
96 cat(paste("gPCA version", toString(packageVersion("gPCA"))), "\n") |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
97 quit() |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
98 } |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
99 |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
100 # Check parameter values |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
101 |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
102 if ( ! file.exists(opt$batch)){ |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
103 stop((paste('File for batch', opt$batch, 'does not exist'))) |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
104 } |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
105 if ( ! file.exists(opt$data)){ |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
106 stop((paste('File for data', opt$data, 'does not exist'))) |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
107 } |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
108 |
|
1
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
109 dir.create(opt$path); |
|
0
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
110 data<-t(as.matrix(read.delim(opt$data, row.names=1, header=TRUE, sep="\t"))) |
|
1
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
111 batch<-as.matrix(read.delim(opt$batch, header=TRUE, row.names=1, sep="\t")) |
|
0
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
112 |
|
1
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
113 write('#Batch\tDelta\tP-value\tCumulative Variance',file = opt$numbers_outfile, append=TRUE) |
|
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
114 |
|
2
4865e7f4e9c5
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit b72f398663cc133523cae0f5d7db2af1b4312f7a
blankenberglab
parents:
1
diff
changeset
|
115 write('<html><body><div align="left" id="top"><p><h1>Table of Contents</h1><ul>',file = opt$html_outfile, append=TRUE) |
|
1
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
116 for (row in 1:nrow(batch)) { |
|
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
117 write(paste0('<li><a href="#',row.names(batch)[row],'">',row.names(batch)[row],'</a></li>'), file=opt$html_outfile, append=TRUE) |
|
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
118 } |
|
2
4865e7f4e9c5
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit b72f398663cc133523cae0f5d7db2af1b4312f7a
blankenberglab
parents:
1
diff
changeset
|
119 write('</ul></p></div>', file=opt$html_outfile, append=TRUE) |
|
4865e7f4e9c5
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit b72f398663cc133523cae0f5d7db2af1b4312f7a
blankenberglab
parents:
1
diff
changeset
|
120 |
|
1
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
121 for (row in 1:nrow(batch)) { |
|
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
122 batch1<-as.numeric(factor(batch[row,])) |
|
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
123 |
|
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
124 out<-gPCA.batchdetect(x=data, batch=batch1, center=opt$center, scaleY=opt$scaleY, nperm=opt$nperm, filt=opt$filt, seed=opt$seed) |
|
0
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
125 |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
126 out$varPCg1<-((out$varPCg1-out$varPCu1)/out$varPCg1)*100 |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
127 |
|
1
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
128 write(paste(row.names(batch)[row],out$delta,out$p.val,out$varPCg1,sep="\t"),file = opt$numbers_outfile, append=TRUE) |
|
0
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
129 |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
130 # General Distribution |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
131 par(mai=c(0.8,0.8,0.1,0.1),cex=0.8) |
|
1
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
132 png(paste(opt$path,'/gDist_',row,'.png', sep=""), width=1020, height=800, units='px') |
|
0
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
133 gDist(out) |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
134 invisible(dev.off()) |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
135 |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
136 |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
137 # Guided/Unguided 1v2 |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
138 par(mai=c(0.8,0.8,0.1,0.1),cex=0.8) |
|
1
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
139 png(paste(opt$path,'/guided_1v2_',row,'.png', sep=""), width=1020, height=800, units='px') |
|
0
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
140 PCplot(out,ug="unguided",type="1v2") |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
141 invisible(dev.off()) |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
142 |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
143 par(mai=c(0.8,0.8,0.1,0.1),cex=0.8) |
|
1
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
144 png(paste(opt$path,'/unguided_1v2_',row,'.png', sep=""), width=1020, height=800, units='px') |
|
0
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
145 PCplot(out,ug="unguided",type="1v2") |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
146 invisible(dev.off()) |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
147 |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
148 |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
149 # Guided/Unguided comp,3 |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
150 par(mai=c(0.65,0.65,0.1,0.1),cex=0.8) |
|
1
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
151 png(paste(opt$path,'/guided_npcs_',row,'.png', sep=""), width=1020, height=800, units='px') |
|
0
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
152 PCplot(out,ug="guided",type="comp",npcs=opt$npcs) |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
153 invisible(dev.off()) |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
154 |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
155 par(mai=c(0.65,0.65,0.1,0.1),cex=0.8) |
|
1
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
156 png(paste(opt$path,'/unguided_npcs_',row,'.png', sep=""), width=1020, height=800, units='px') |
|
0
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
157 PCplot(out,ug="unguided",type="comp",npcs=opt$npcs) |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
158 invisible(dev.off()) |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
159 |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
160 |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
161 # Guided/Unguided CumlativeVarPlot |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
162 par(mai=c(0.8,0.8,0.1,0.1),cex=0.8) |
|
1
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
163 png(paste(opt$path,'/guided_var_',row,'.png', sep=""), width=1020, height=800, units='px') |
|
0
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
164 CumulativeVarPlot(out,ug="guided",col="blue") |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
165 invisible(dev.off()) |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
166 |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
167 par(mai=c(0.8,0.8,0.1,0.1),cex=0.8) |
|
1
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
168 png(paste(opt$path,'/unguided_var_',row,'.png', sep=""), width=1020, height=800, units='px') |
|
0
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
169 CumulativeVarPlot(out,ug="unguided",col="blue") |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
170 invisible(dev.off()) |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
171 |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
172 |
|
1
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
173 write(paste0(' |
|
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
174 <header id=',row.names(batch)[row],'><center><font size="11">',row.names(batch)[row],'</font><center></header> |
|
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
175 <br> |
|
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
176 <table align="center" border="1"> |
|
0
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
177 <tr> |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
178 <th>Delta</th><th>P-value</th><th>varPCg1</th> |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
179 </tr> |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
180 <tr> |
|
1
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
181 <td id="#">',out$delta,'</td><td id=p.val>',out$p.val,'</td><td id=varPCg1>',out$varPCg1,'</td> |
|
0
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
182 </tr> |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
183 </table> |
|
1
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
184 <center><img src="gDist_',row,'.png"/></center><br> |
|
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
185 <center><title>Guided 1v2</title><br><img src="guided_1v2_',row,'.png"/></center><br> |
|
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
186 <center><title>Unguided 1v2</title><br><img src="unguided_1v2_',row,'.png"/></center><br> |
|
0
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
187 |
|
1
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
188 <center><title>Guided Compare to ',opt$npcs,'</title><br><img src="guided_npcs_',row,'.png"/></center><br> |
|
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
189 <center><title>Unguided Compare to ',opt$npcs,'</title><br><img src="unguided_npcs_',row,'.png"/></center><br> |
|
0
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
190 |
|
1
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
191 <center><title>Guided Cumulative Variance</title><br><img src="guided_var_',row,'.png"/></center><br> |
|
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
192 <center><title>Unguided Cumulative Variance</title><br><img src="unguided_var_',row,'.png"/></center><br> |
|
0
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
193 |
|
1
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
194 '), file = opt$html_outfile, append=TRUE) |
|
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
195 } |
|
d93629e79f5e
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit 3b791d44853d8928046914cd93112bdcf89d4965
blankenberglab
parents:
0
diff
changeset
|
196 write(paste('<p><center><a href="#top">Back to Top</a></center></p></body></html>'),file = opt$html_outfile, append=TRUE) |
|
0
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
197 |
|
ed24bacaa4d0
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit ec2f585063522efa001e4d2a639e92a67758ad8c-dirty
blankenberglab
parents:
diff
changeset
|
198 sessionInfo() |
