-
Notifications
You must be signed in to change notification settings - Fork 0
/
script_clustering_5_PCA_Punkte_verschieben.R
51 lines (35 loc) · 1.61 KB
/
script_clustering_5_PCA_Punkte_verschieben.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#############################################
# #
# Clustering.5: Punkte in PCA verschieben #
# #
#############################################
library(tidyverse)
library(ggbiplot)
scored = read_rds("result_2019_09_02_scored")
annotation = read_rds("result_2019_09_02_row_annotation")
my_pca = prcomp(scored,
scale. = F,
center = T,
retx = T)
group_colors = annotation$app_class
my_pca_plot = ggbiplot(my_pca,
ellipse = T,
choices = c(1,2),
groups = group_colors,
var.axes = T
) + scale_color_manual(name = "groups", values = c("key"="#009900", # green
"potency"="#0066ff", # blue
"scaffold"="#8c8c8c", # grey
"selectivity"="#ff6600", # orange
"focus" = "red")) +
theme(legend.title = element_blank())
my_pca_plot
# pick a point and change its functional class to "red"
# and subsequently expand the annotation colors to color the functional class "red" red.
# which(rownames(annotation) == "28_ABL1") # 28
levels(annotation[, "app_class"]) = c(levels(annotation[, "app_class"]), "focus")
annotation[28, "app_class"] = "focus"
# scored[28, "aliphatic"] = 0.5
# scored[28, "aromatic"] = 0.5
scored[28, "target_wide_conservation"] = 0.2
View(scored[28,])