minor tweaks in logo and corr plots

This commit is contained in:
Tanushree Tunstall 2020-09-17 20:00:34 +01:00
parent 8ddca4a8b1
commit 40e4ddd70a
3 changed files with 24 additions and 9 deletions

View file

@ -116,6 +116,7 @@ wide_df_or <- logo_data_or %>% spread(position, or_mychisq, fill = 0.0)
wide_df_or = as.matrix(wide_df_or)
rownames(wide_df_or) = wide_df_or[,1]
wide_df_or = wide_df_or[,-1]
str(wide_df_or)
position_or = as.numeric(colnames(wide_df_or))
@ -124,22 +125,32 @@ position_or = as.numeric(colnames(wide_df_or))
#============================================
# custom height (OR) logo plot: yayy works
ggseqlogo(wide_df_or, method="custom", seq_type="aa") + ylab("my custom height") +
theme(legend.position = "bottom"
, axis.text.x = element_text(size = 11
cat("Logo plot with OR as y axis:", plot_logo_plot)
svg(plot_logo_plot, width = 30 , height = 6)
logo_or = ggseqlogo(wide_df_or, method="custom", seq_type="aa") + ylab("my custom height") +
theme( axis.text.x = element_text(size = 16
, angle = 90
, hjust = 1
, vjust = 0.4)
, axis.text.y = element_text(size = 15
, axis.text.y = element_text(size = 22
, angle = 0
, hjust = 1
, vjust = 0))+
scale_x_discrete("Position"
, vjust = 0)
, axis.title.y = element_text(size = 25)
, axis.title.x = element_text(size = 20)
#, legend.position = "bottom") +
, legend.position = "none")+
#, legend.text = element_text(size = 15)
#, legend.title = element_text(size = 15))+
scale_x_discrete("Position"
#, breaks
, labels = position_or
, limits = factor(1:length(position_or))) +
ylab("Odds Ratio")
print(logo_or)
dev.off()
#%% end of logo plot with OR as height
#=======================================================================