various stuff

This commit is contained in:
Tanushree Tunstall 2022-08-09 19:42:20 +01:00
parent 5cbaef3d36
commit 415d05ab6e
3 changed files with 99 additions and 76 deletions

View file

@ -219,7 +219,7 @@ LogoPlotSnps <- function(plot_df
, method = 'custom'
, col_scheme = my_logo_col
, seq_type = 'aa') +
scale_x_continuous(breaks = 1:ncol(tab_mt)
, expand = c(0.01,0)
, labels = colnames(tab_mt))+
@ -250,64 +250,73 @@ LogoPlotSnps <- function(plot_df
, axis.title.y = element_text(size = y_tts
, colour = ytt_col)
, plot.background = element_rect(fill = theme_bgc)
)
,ggseqlogo(tab_wt
, method = 'custom'
, col_scheme = my_logo_col
, seq_type = 'aa') +
, plot.background = element_rect(fill = theme_bgc, colour=NA)
),
ggseqlogo(tab_wt
, method = 'custom'
, col_scheme = my_logo_col
, seq_type = 'aa') +
scale_x_continuous(breaks = 1:ncol(tab_wt)
, expand = c(0.01,0)
, labels = colnames(tab_wt))+
, labels = as.factor(colnames(tab_wt))) +
theme(text = element_text(family="FreeSans")
, legend.position = "none"
, axis.text.x = element_blank()
, axis.text.y = element_blank()
, axis.title.x = element_blank()
, axis.title.y = element_blank()
, plot.background = element_rect(fill = theme_bgc)
, plot.background = element_rect(fill = theme_bgc, colour=NA)
) +
labs(x=NULL, y=NULL)
,
ggplot(data=unique_colour_map2, aes(
x=factor(position), 0 # heat-mapped distance tiles along the bot
, fill = position
, colour = position
, linetype = "blank"
)
labs(x=NULL, y=NULL),
ggplot(
data=unique_colour_map2,
aes(
x=factor(position), 0 # heat-mapped distance tiles along the bot
, fill = position
, colour = position
, linetype = "blank"
)
) +
geom_tile() +
theme(axis.text.x = element_text(size = x_ats
, angle = x_tangle
, hjust = 1
, vjust = 0.4
, colour = xfont_bgc)
, axis.text.y = element_blank()
, axis.ticks.y = element_blank()
, axis.title.x = element_text(size = x_tts
, colour = xtt_col)
, axis.title.y = element_text(size = y_tts
, colour = ytt_col)
, legend.title = element_text(size = leg_tts
, colour = ytt_col)
, legend.text = element_text(size = leg_ts)
, legend.position = leg_pos
, legend.direction = leg_dir
, plot.background = element_rect(fill = theme_bgc)
, plot.margin = margin(t=0)
, panel.grid=element_blank()
, panel.background = element_rect(fill = theme_bgc)
theme(
axis.text.x = element_blank()
, axis.ticks.x = element_blank()
# axis.text.x = element_text(size = x_ats
# , angle = x_tangle
# , hjust = 1
# , vjust = 0.4
# , colour = xfont_bgc)
, axis.text.y = element_blank()
, axis.ticks.y = element_blank()
, axis.title.x = element_blank()
# , axis.title.x = element_text(size = x_tts
# , colour = xtt_col)
# , axis.title.y = element_text(size = y_tts
# , colour = ytt_col)
# , legend.title = element_text(size = leg_tts
# , colour = ytt_col)
, legend.text = element_text(size = leg_ts)
, legend.position = leg_pos
, legend.direction = leg_dir
, plot.background = element_rect(fill = theme_bgc, colour=NA)
, plot.margin = margin(t=0)
, panel.grid=element_blank()
, panel.background = element_rect(fill = theme_bgc, colour=NA)
) +
scale_x_discrete(x_lab, labels=factor(unique_colour_map$position)) +
scale_color_manual(values=unique_colour_map$ligD_colours) +
scale_fill_manual(values=unique_colour_map$ligD_colours) +
labs(y = NULL)
, nrow = 3
, NULL
, position_annotation(plot_df, bg=theme_bgc)
, ncol=1
, align = "v"
, rel_heights = c(7/10, 2/7, 1/7))
, rel_heights = c(7/10, 2/7,1/7, -0.1, 0.5/7))
#------------------
# Wild logo plot
#------------------
}
#LogoPlotSnps(mutable_df3)
#LogoPlotSnps(small_df3)