updated Header file and saving work

This commit is contained in:
Tanushree Tunstall 2020-09-17 20:12:08 +01:00
parent b8575c6e69
commit 5e1c920a0c
2 changed files with 10 additions and 22 deletions

View file

@ -8,10 +8,10 @@
# library(gplots)
#}
#if (!require("tidyverse")) {
# install.packages("tidyverse", dependencies = TRUE)
# library(tidyverse)
#}
if (!require("tidyverse")) {
install.packages("tidyverse", dependencies = TRUE)
library(tidyverse)
}
if (!require("ggplot2")) {
install.packages("ggplot2", dependencies = TRUE)

View file

@ -23,14 +23,6 @@ source("combining_dfs_plotting.R")
# output
#===========
logo_multiple_muts = "logo_multiple_muts.svg"
plot_logo_multiple_muts = paste0(plotdir,"/", logo_multiple_muts)
logo_or = "logo_or.svg"
plot_logo_or = paste0(plotdir,"/", logo_or)
logo_combined_labelled = "logo_combined_labelled.svg"
plot_logo_combined_labelled = paste0(plotdir,"/", logo_combined_labelled)
@ -212,7 +204,7 @@ require(data.table)
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# REASSIGNMENT to prevent changing code
my_df_snp #(positions with multiple snps) only
head(my_df_snp) #(positions with multiple snps) only
length(unique(my_df_snp$position))
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -243,10 +235,6 @@ position_or = as.numeric(colnames(wide_df_or))
#custom height (OR) logo plot: CORRECT x-axis labelling
#============================================
# custom height (OR) logo plot: yayy works
#cat("Logo plot with OR as y axis:", plot_logo_or)
#svg(plot_logo_or, 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
@ -268,12 +256,12 @@ logo_or = ggseqlogo(wide_df_or, method="custom", seq_type="aa") + ylab("my custo
xlab("Position") +
ylab("Odds Ratio")
print(logo_or)
#dev.off()
#%% end of logo plot with OR as height
#===================================================================
logo_or
########################################################################
#=============================
# combine plots for output
#=============================
cat("Output plot:", plot_logo_combined_labelled)
svg(plot_logo_combined_labelled, width = 25, height = 10)