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

@ -59,6 +59,9 @@ cat(paste0("Variables imported:"
corr_ps = "corr_PS.svg"
plot_corr_ps = paste0(plotdir,"/", corr_ps)
corr_ps_duet_col = "corr_PS_duet_coloured.svg"
plot_corr_ps_duet_col = paste0(plotdir,"/", corr_ps_duet_col)
corr_upper_ps = "corr_upper_PS.svg"
plot_corr_upper_ps = paste0(plotdir,"/", corr_upper_ps)
@ -193,10 +196,12 @@ head(my_corr_ps)
#---------------------------------------
# generate corr PS plot 1: both panels
#---------------------------------------
cat("Corr plot PS:", plot_corr_ps)
cat("Corr plot PS DUET with coloured dots:", plot_corr_ps)
svg(plot_corr_ps, width = 15, height = 15)
#cat("Corr plot PS DUET with coloured dots:",plot_corr_ps_duet_col)
#svg(plot_corr_ps_duet_col, width = 15, height = 15)
OutPlot1 = pairs.panels(my_corr_ps[1:(length(my_corr_ps)-1)]
, method = "spearman" # correlation method
, hist.col = "grey" ##00AFBB

View file

@ -173,7 +173,6 @@ p3 = p2 +
p3
# Now combine using cowplot, which ensures the plots are aligned
suppressMessages( require(cowplot) )

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))+
, 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
#=======================================================================