Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpievolbio-scicomp
RepinPop
Commits
c8148b4e
Commit
c8148b4e
authored
Dec 17, 2021
by
c.fortmanngrote
Browse files
Attempt to add reference strain annotations to tips in RAYT phylogenie, not working.
parent
b4cbef72
Pipeline
#259133
failed with stages
in 4 minutes and 46 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
shinyapps/analysis/analysis.R
View file @
c8148b4e
...
...
@@ -17,7 +17,7 @@ suppressMessages(library(logging))
# Set log level
logging
::
basicConfig
()
logging
::
setLevel
(
1
0
)
# 10: debug, 20: info, 30: warning, 40: error
logging
::
setLevel
(
3
0
)
# 10: debug, 20: info, 30: warning, 40: error
# 6 Colors for plots (corresponding to 6 RAYT rep_rayt_groups)
colors
=
c
(
"#45BA55"
,
"#5545BA"
,
"#BA5545"
,
"#B6BD42"
,
"#42B6BD"
,
"#BD42B6"
)
...
...
@@ -437,7 +437,7 @@ get_rayt_phylogeny=function(data_dir){
######################################################################################
drawRAYTphylogeny
=
function
(
data_dir
,
fontsize
=
16
){
drawRAYTphylogeny
=
function
(
data_dir
,
fontsize
=
16
,
reference_strain
=
""
){
# Check and get phylogeny data.
rayt_files
=
get_rayt_phylogeny
(
data_dir
)
...
...
@@ -453,8 +453,17 @@ drawRAYTphylogeny=function(data_dir, fontsize=16){
raytTreeFile
=
rayt_files
$
raytPhyTreeFile
nwk
=
read.tree
(
raytTreeFile
)
# reference_strain_node_ids = sapply(reference_strain, function(y) grep(y, nwk$tip.label))
# reference_annotation = data.frame(node=nwk$
# labels=rep(c(reference_strain),
# each=length(reference_strain_node_ids)
# )
# )
# Plot the tree
p
<-
ggtree
(
nwk
)
# p <- p %<+% reference_annotation + geom_tiplab(aes(label=labels), color='orange', offset=1)
# Get colors
colorDF
=
determineColor
(
paste0
(
data_dir
,
"/repin_rayt_association.txt"
))
...
...
@@ -477,6 +486,7 @@ drawRAYTphylogeny=function(data_dir, fontsize=16){
# Add colors
p
<-
p
+
scale_color_manual
(
values
=
cols
,
guide
=
"none"
)
logging
::
logdebug
(
"Added color scale."
)
return
(
p
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment