annotate high_dim_visu.R @ 8:fe6f76030168 draft

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
author artbio
date Wed, 29 Nov 2023 17:28:18 +0000
parents 18a1dc4aec4a
children 58aa18e1fe14
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
1 options(show.error.messages = FALSE,
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
2 error = function() {
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
3 cat(geterrmessage(), file = stderr())
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
4 q("no", 1, FALSE)
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
5 }
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
6 )
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
7 loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
8 warnings()
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
9
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
10 library(optparse)
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
11 library(FactoMineR)
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
12 library(factoextra)
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
13 library(Rtsne)
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
14 library(ggplot2)
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
15 library(ggfortify)
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
16 library(RColorBrewer)
4
8e17c31c536a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1282ac9de7c926ab251f88afb2453f52c8b14200
artbio
parents: 3
diff changeset
17 library(ClusterR)
5
569334568afa "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1b98c85982a2a9f9df4b318f672b9b68cff66a93"
artbio
parents: 4
diff changeset
18 library(data.table)
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
19 library(Polychrome)
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
20
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
21 option_list <- list(
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
22 make_option(
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
23 "--data",
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
24 default = NA,
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
25 type = "character",
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
26 help = "Input file that contains expression value to visualise"
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
27 ),
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
28 make_option(
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
29 "--labels",
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
30 default = FALSE,
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
31 type = "logical",
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
32 help = "add labels in scatter plots [default : '%default' ]"
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
33 ),
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
34 make_option(
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
35 "--factor",
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
36 default = "",
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
37 type = "character",
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
38 help = "A two column table that specifies factor levels for contrasting data [default : '%default' ]"
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
39 ),
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
40 make_option(
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
41 "--visu_choice",
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
42 default = "PCA",
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
43 type = "character",
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
44 help = "visualisation method ('PCA', 'tSNE', 'HCPC') [default : '%default' ]"
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
45 ),
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
46 make_option(
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
47 "--Rtsne_seed",
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
48 default = 42,
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
49 type = "integer",
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
50 help = "Seed value for reproducibility [default : '%default' ]"
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
51 ),
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
52 make_option(
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
53 "--Rtsne_dims",
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
54 default = 2,
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
55 type = "integer",
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
56 help = "Output dimensionality [default : '%default' ]"
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
57 ),
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
58 make_option(
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
59 "--Rtsne_initial_dims",
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
60 default = 50,
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
61 type = "integer",
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
62 help = "The number of dimensions that should be retained in the initial PCA step [default : '%default' ]"
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
63 ),
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
64 make_option(
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
65 "--Rtsne_perplexity",
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
66 default = 5.0,
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
67 type = "numeric",
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
68 help = "perplexity [default : '%default' ]"
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
69 ),
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
70 make_option(
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
71 "--Rtsne_theta",
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
72 default = 1.0,
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
73 type = "numeric",
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
74 help = "theta [default : '%default' ]"
4
8e17c31c536a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1282ac9de7c926ab251f88afb2453f52c8b14200
artbio
parents: 3
diff changeset
75 ),
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
76 make_option(
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
77 "--Rtsne_max_iter",
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
78 default = 1000,
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
79 type = "integer",
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
80 help = "max_iter [default : '%default' ]"
4
8e17c31c536a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1282ac9de7c926ab251f88afb2453f52c8b14200
artbio
parents: 3
diff changeset
81 ),
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
82 make_option(
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
83 "--Rtsne_pca",
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
84 default = TRUE,
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
85 type = "logical",
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
86 help = "Whether an initial PCA step should be performed [default : '%default' ]"
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
87 ),
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
88 make_option(
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
89 "--Rtsne_pca_center",
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
90 default = TRUE,
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
91 type = "logical",
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
92 help = "Should data be centered before pca is applied? [default : '%default' ]"
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
93 ),
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
94 make_option(
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
95 "--Rtsne_pca_scale",
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
96 default = FALSE,
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
97 type = "logical",
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
98 help = "Should data be scaled before pca is applied? [default : '%default' ]"
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
99 ),
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
100 make_option(
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
101 "--Rtsne_normalize",
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
102 default = TRUE,
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
103 type = "logical",
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
104 help = "Should data be normalized internally prior to distance calculations? [default : '%default' ]"
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
105 ),
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
106 make_option(
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
107 "--Rtsne_exaggeration_factor",
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
108 default = 12.0,
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
109 type = "numeric",
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
110 help = " Exaggeration factor used to multiply the P matrix in the first part of the optimization [default : '%default' ]"
4
8e17c31c536a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1282ac9de7c926ab251f88afb2453f52c8b14200
artbio
parents: 3
diff changeset
111 ),
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
112 make_option(
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
113 "--PCA_npc",
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
114 default = 5,
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
115 type = "integer",
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
116 help = "number of dimensions kept in the results [default : '%default' ]"
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
117 ),
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
118 make_option(
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
119 "--item_size",
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
120 default = 1,
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
121 type = "numeric",
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
122 help = "Size of points/labels in PCA [default : '%default' ]"
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
123 ),
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
124 make_option(
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
125 "--x_axis",
4
8e17c31c536a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1282ac9de7c926ab251f88afb2453f52c8b14200
artbio
parents: 3
diff changeset
126 default = 1,
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
127 type = "integer",
4
8e17c31c536a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1282ac9de7c926ab251f88afb2453f52c8b14200
artbio
parents: 3
diff changeset
128 help = "PC to plot in the x axis [default : '%default' ]"
8e17c31c536a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1282ac9de7c926ab251f88afb2453f52c8b14200
artbio
parents: 3
diff changeset
129 ),
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
130 make_option(
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
131 "--y_axis",
4
8e17c31c536a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1282ac9de7c926ab251f88afb2453f52c8b14200
artbio
parents: 3
diff changeset
132 default = 2,
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
133 type = "integer",
4
8e17c31c536a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1282ac9de7c926ab251f88afb2453f52c8b14200
artbio
parents: 3
diff changeset
134 help = "PC to plot in the y axis [default : '%default' ]"
8e17c31c536a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1282ac9de7c926ab251f88afb2453f52c8b14200
artbio
parents: 3
diff changeset
135 ),
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
136 make_option(
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
137 "--HCPC_ncluster",
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
138 default = -1,
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
139 type = "numeric",
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
140 help = "nb.clust, number of clusters to consider in the hierarchical clustering. [default : -1 let HCPC to optimize the number]"
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
141 ),
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
142 make_option(
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
143 "--HCPC_npc",
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
144 default = 5,
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
145 type = "integer",
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
146 help = "npc, number of dimensions which are kept for HCPC analysis [default : '%default' ]"
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
147 ),
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
148 make_option(
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
149 "--HCPC_metric",
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
150 default = "euclidean",
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
151 type = "character",
5
569334568afa "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1b98c85982a2a9f9df4b318f672b9b68cff66a93"
artbio
parents: 4
diff changeset
152 help = "Metric to be used for calculating dissimilarities between observations, available 'euclidean' or 'manhattan' [default : '%default' ]"
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
153 ),
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
154 make_option(
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
155 "--HCPC_method",
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
156 default = "ward",
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
157 type = "character",
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
158 help = "Clustering method between 'ward','average','single', 'complete', 'weighted' [default :'%default']"
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
159 ),
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
160 make_option(
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
161 "--pdf_out",
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
162 default = "out.pdf",
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
163 type = "character",
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
164 help = "pdf of plots [default : '%default' ]"
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
165 ),
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
166 make_option(
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
167 "--HCPC_consol",
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
168 default = "TRUE",
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
169 type = "logical",
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
170 help = "If TRUE, a k-means consolidation is performed [default :'%default']"
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
171 ),
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
172 make_option(
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
173 "--HCPC_itermax",
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
174 default = "10",
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
175 type = "integer",
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
176 help = "The maximum number of iterations for the consolidation [default :'%default']"
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
177 ),
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
178 make_option(
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
179 "--HCPC_min",
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
180 default = "3",
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
181 type = "integer",
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
182 help = "The least possible number of clusters suggested [default :'%default']"
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
183 ),
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
184 make_option(
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
185 "--HCPC_max",
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
186 default = -1,
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
187 type = "integer",
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
188 help = "The higher possible number of clusters suggested [default :'%default']"
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
189 ),
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
190 make_option(
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
191 "--HCPC_clusterCA",
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
192 default = "rows",
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
193 type = "character",
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
194 help = "A string equals to 'rows' or 'columns' for the clustering of Correspondence Analysis results [default :'%default']"
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
195 ),
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
196 make_option(
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
197 "--HCPC_kk",
5
569334568afa "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1b98c85982a2a9f9df4b318f672b9b68cff66a93"
artbio
parents: 4
diff changeset
198 default = Inf,
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
199 type = "numeric",
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
200 help = "The maximum number of iterations for the consolidation [default :'%default']"
4
8e17c31c536a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1282ac9de7c926ab251f88afb2453f52c8b14200
artbio
parents: 3
diff changeset
201 ),
8e17c31c536a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1282ac9de7c926ab251f88afb2453f52c8b14200
artbio
parents: 3
diff changeset
202 make_option(
5
569334568afa "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1b98c85982a2a9f9df4b318f672b9b68cff66a93"
artbio
parents: 4
diff changeset
203 "--HCPC_mutual_info",
4
8e17c31c536a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1282ac9de7c926ab251f88afb2453f52c8b14200
artbio
parents: 3
diff changeset
204 default = "",
8e17c31c536a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1282ac9de7c926ab251f88afb2453f52c8b14200
artbio
parents: 3
diff changeset
205 type = "character",
8e17c31c536a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1282ac9de7c926ab251f88afb2453f52c8b14200
artbio
parents: 3
diff changeset
206 help = "Output file of external validation of HCPC clustering with factor levels [default :'%default']"
5
569334568afa "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1b98c85982a2a9f9df4b318f672b9b68cff66a93"
artbio
parents: 4
diff changeset
207 ),
569334568afa "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1b98c85982a2a9f9df4b318f672b9b68cff66a93"
artbio
parents: 4
diff changeset
208 make_option(
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
209 "--HCPC_cell_clust",
5
569334568afa "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1b98c85982a2a9f9df4b318f672b9b68cff66a93"
artbio
parents: 4
diff changeset
210 default = "",
569334568afa "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1b98c85982a2a9f9df4b318f672b9b68cff66a93"
artbio
parents: 4
diff changeset
211 type = "character",
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
212 help = "Lists cells in the clusters generated by HCPC clustering. 2-column table (cell identifiers/clusters) [default :'%default']"
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
213 ),
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
214 make_option(
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
215 "--HCPC_contributions",
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
216 default = "",
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
217 type = "character",
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
218 help = "Table of variables (genes) most contributing to HCPC clustering [default :'%default']"
4
8e17c31c536a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1282ac9de7c926ab251f88afb2453f52c8b14200
artbio
parents: 3
diff changeset
219 )
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
220 )
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
221
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
222 opt <- parse_args(OptionParser(option_list = option_list),
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
223 args = commandArgs(trailingOnly = TRUE))
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
224
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
225 if (opt$HCPC_max == -1) {
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
226 opt$HCPC_max <- NULL
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
227 }
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
228 if (opt$HCPC_kk == -1) {
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
229 opt$HCPC_kk <- Inf
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
230 }
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
231
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
232 #### We treat data once, at the beginning of the script ####
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
233 data <- read.delim(
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
234 opt$data,
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
235 check.names = FALSE,
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
236 header = TRUE,
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
237 row.names = 1,
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
238 sep = "\t"
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
239 )
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
240 # we transpose immediately, because this is the common data structure
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
241 data <- as.data.frame(t(data))
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
242
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
243 # we treat the factor for usage in 3 methods
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
244 if (opt$factor != "") {
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
245 contrasting_factor <- read.delim(opt$factor, header = TRUE)
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
246 rownames(contrasting_factor) <- contrasting_factor[, 1]
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
247 # we pick only the relevant values of the contrasting factor
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
248 contrasting_factor <- contrasting_factor[rownames(data), ]
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
249 sup <- colnames(contrasting_factor)[2]
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
250 if (!is.numeric(contrasting_factor[, 2])) {
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
251 contrasting_factor[, 2] <- as.factor(contrasting_factor[, 2])
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
252 }
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
253 }
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
254
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
255 ######### make PCA with FactoMineR #################
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
256 if (opt$visu_choice == "PCA") {
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
257 if (opt$labels) {
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
258 labels <- "ind"
2
7e7a2a4cfce2 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit e15ae06208ef1d3d42c0576ed28eb6ba10a36671
artbio
parents: 0
diff changeset
259 } else {
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
260 labels <- "none"
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
261 }
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
262 pdf(opt$pdf_out)
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
263 if (opt$factor != "") {
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
264 data <- cbind(data, contrasting_factor[, 2])
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
265 colnames(data)[length(data)] <- sup
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
266 if (is.numeric(contrasting_factor[, 2])) {
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
267 res_pca <- PCA(X = data, quanti.sup = sup, graph = FALSE)
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
268 pca_plot <- plot(res_pca, habillage = sup, label = labels,
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
269 title = "PCA graph of cells", cex = opt$item_size,
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
270 axes = c(opt$x_axis, opt$y_axis))
4
8e17c31c536a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1282ac9de7c926ab251f88afb2453f52c8b14200
artbio
parents: 3
diff changeset
271 } else {
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
272 res_pca <- PCA(X = data, quali.sup = sup, graph = FALSE)
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
273 pca_plot <- plot(res_pca, habillage = sup, label = labels,
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
274 title = "PCA graph of cells", cex = opt$item_size,
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
275 axes = c(opt$x_axis, opt$y_axis))
4
8e17c31c536a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1282ac9de7c926ab251f88afb2453f52c8b14200
artbio
parents: 3
diff changeset
276 }
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
277 } else {
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
278 res_pca <- PCA(X = data, graph = FALSE)
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
279 pca_plot <- plot(res_pca, label = labels,
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
280 title = "PCA graph of cells", cex = opt$item_size,
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
281 axes = c(opt$x_axis, opt$y_axis), col.ind = "deepskyblue4")
2
7e7a2a4cfce2 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit e15ae06208ef1d3d42c0576ed28eb6ba10a36671
artbio
parents: 0
diff changeset
282 }
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
283 print(pca_plot)
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
284 dev.off()
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
285 }
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
286
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
287 ########### make HCPC with FactoMineR ##########
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
288 if (opt$visu_choice == "HCPC") {
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
289 pdf(opt$pdf_out)
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
290 # HCPC starts with a PCA
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
291 pca <- PCA(X = data, ncp = opt$HCPC_npc, graph = FALSE)
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
292 pca_ind_coord <- as.data.frame(pca$ind$coord) # coordinates of observations in PCA
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
293 # Hierarchical Clustering On Principal Components Followed By Kmean Clustering
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
294 res_hcpc <- HCPC(pca,
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
295 nb.clust = opt$HCPC_ncluster,
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
296 metric = opt$HCPC_metric,
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
297 method = opt$HCPC_method,
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
298 graph = FALSE,
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
299 consol = opt$HCPC_consol,
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
300 iter.max = opt$HCPC_itermax,
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
301 min = opt$HCPC_min,
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
302 max = opt$HCPC_max,
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
303 cluster.CA = opt$HCPC_clusterCA,
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
304 kk = opt$HCPC_kk)
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
305 # HCPC plots
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
306 dims <- head(as.data.frame(res_hcpc$call$t$res$eig), 2) # dims variances in column 2
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
307 plot(res_hcpc, choice = "tree")
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
308 plot(res_hcpc, choice = "bar")
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
309 if (opt$labels == FALSE) {
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
310 plot(res_hcpc, choice = "3D.map", ind.names = FALSE)
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
311 plot(res_hcpc, choice = "map", label = "none")
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
312 } else {
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
313 plot(res_hcpc, choice = "3D.map")
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
314 plot(res_hcpc, choice = "map")
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
315 }
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
316 ## Normalized Mutual Information
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
317 if (opt$factor != "") {
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
318 sink(opt$HCPC_mutual_info)
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
319 cat("Relationship between input factor and its levels and the HCPC clusters")
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
320 res <- external_validation(true_labels = as.numeric(contrasting_factor[, 2]),
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
321 clusters = as.numeric(res_hcpc$data.clust$clust),
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
322 summary_stats = TRUE)
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
323 sink()
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
324 }
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
325 dev.off()
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
326
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
327 res_clustering <- data.frame(Cell = rownames(res_hcpc$data.clust),
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
328 Cluster = res_hcpc$data.clust$clust)
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
329 # Description of cluster by most contributing variables / gene expressions
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
330 # first transform list of vectors in a list of dataframes
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
331 extract_description <- lapply(res_hcpc$desc.var$quanti, as.data.frame)
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
332 # second, transfer rownames (genes) to column in the dataframe, before rbinding
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
333 extract_description_w_genes <- Map(cbind,
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
334 extract_description,
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
335 genes = lapply(extract_description, rownames))
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
336 # Then collapse all dataframes with cluster_id in 1st column using {data.table} rbindlist()
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
337 cluster_description <- rbindlist(extract_description_w_genes, idcol = "cluster_id")
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
338 cluster_description <- cluster_description[, c(8, 1, 2, 3, 4, 5, 6, 7)] # swap columns
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
339 cluster_description <- cluster_description[order(cluster_description[[2]],
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
340 cluster_description[[8]]), ] # sort by cluster then by pval
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
341 # Finally, output cluster description data frame
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
342 write.table(cluster_description,
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
343 file = opt$HCPC_contributions,
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
344 sep = "\t",
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
345 quote = FALSE,
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
346 col.names = TRUE,
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
347 row.names = FALSE)
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
348
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
349 ## Return cluster table to user
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
350 write.table(res_clustering,
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
351 file = opt$HCPC_cell_clust,
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
352 sep = "\t",
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
353 quote = FALSE,
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
354 col.names = TRUE,
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
355 row.names = FALSE)
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
356 }
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
357 ################ t-SNE ####################
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
358 if (opt$visu_choice == "tSNE") {
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
359 set.seed(opt$Rtsne_seed) ## Sets seed for reproducibility
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
360 tsne_out <- Rtsne(data,
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
361 dims = opt$Rtsne_dims,
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
362 initial_dims = opt$Rtsne_initial_dims,
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
363 perplexity = opt$Rtsne_perplexity,
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
364 theta = opt$Rtsne_theta,
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
365 max_iter = opt$Rtsne_max_iter,
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
366 pca = opt$Rtsne_pca,
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
367 pca_center = opt$Rtsne_pca_center,
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
368 pca_scale = opt$Rtsne_pca_scale,
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
369 normalize = opt$Rtsne_normalize,
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
370 exaggeration_factor = opt$Rtsne_exaggeration_factor)
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
371 embedding <- as.data.frame(tsne_out$Y[, 1:2])
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
372 embedding$Class <- as.factor(rownames(data))
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
373 gg_legend <- theme(legend.position = "right")
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
374 pointcolor <- "#E70000"
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
375 pointsize <- opt$item_size * 1.5
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
376 the_theme <- theme(
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
377 panel.background = element_rect(fill = "gray100", colour = "#6D9EC1",
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
378 size = 2, linetype = "solid"),
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
379 panel.grid.major = element_line(size = 0.5, linetype = "solid",
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
380 colour = "#6D9EC1"),
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
381 panel.grid.minor = element_line(size = 0.25, linetype = "solid",
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
382 colour = "darkslategray3")
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
383 )
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
384 if (opt$factor == "") {
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
385 p <- ggplot(embedding, aes(x = V1, y = V2)) +
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
386 geom_point(size = pointsize * 0.25, color = pointcolor) +
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
387 gg_legend +
4
8e17c31c536a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1282ac9de7c926ab251f88afb2453f52c8b14200
artbio
parents: 3
diff changeset
388 xlab("t-SNE 1") +
8e17c31c536a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1282ac9de7c926ab251f88afb2453f52c8b14200
artbio
parents: 3
diff changeset
389 ylab("t-SNE 2") +
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
390 ggtitle("t-SNE") +
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
391 the_theme +
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
392 if (opt$labels) {
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
393 geom_text(aes(label = Class), hjust = -0.2, vjust = -0.5, size = pointsize, color = pointcolor)
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
394 }
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
395 } else {
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
396 if (is.numeric(contrasting_factor[, 2])) {
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
397 embedding$factor <- contrasting_factor[, 2]
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
398 } else {
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
399 embedding$factor <- as.factor(contrasting_factor[, 2])
7
18a1dc4aec4a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit ef87a68f9a33f8418699d97627eb5f49a5e2c4a6
artbio
parents: 6
diff changeset
400 }
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
401 p <- ggplot(embedding, aes(x = V1, y = V2, color = factor)) +
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
402 geom_point(size = pointsize * 0.25) +
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
403 gg_legend +
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
404 xlab("t-SNE 1") +
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
405 ylab("t-SNE 2") +
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
406 ggtitle("t-SNE") +
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
407 the_theme +
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
408 if (opt$labels) {
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
409 geom_text(aes(label = Class, colour = factor), hjust = -0.2, vjust = -0.5, size = pointsize)
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
410 }
4
8e17c31c536a planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 1282ac9de7c926ab251f88afb2453f52c8b14200
artbio
parents: 3
diff changeset
411 }
8
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
412 pdf(opt$pdf_out)
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
413 print(p)
fe6f76030168 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/gsc_high_dimension_visualization commit a3dc683410fc240f428c8fbee3c63aa9965fbf38
artbio
parents: 7
diff changeset
414 dev.off()
0
cad0001b9cfb planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/gsc_high_dimension_visualization commit 09dcd74dbc01f448518cf3db3e646afb0675a6fe
artbio
parents:
diff changeset
415 }