annotate high_dim_visu.R @ 9:58aa18e1fe14 draft default tip

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