generated subcolour bps for PS

This commit is contained in:
Tanushree Tunstall 2020-08-26 12:45:09 +01:00
parent 7e0bddd7d2
commit 2e53c8007a
3 changed files with 121 additions and 96 deletions

View file

@ -75,6 +75,15 @@ my_axis_colours = mut_pos_cols$lab_fg
# now clear mut_pos_cols
rm(mut_pos_cols)
#=======
# output
#=======
# plot name and location
print(paste0("plot will be in:", plotdir))
bp_aa_subcols_duet = "barplot_acoloured_PS.svg"
plot_bp_aa_subcols_duet = paste0(plotdir, "/", bp_aa_subcols_duet)
#=======================================================================
#================
# Data for plots
@ -125,7 +134,13 @@ snp_count = sort(unique(snpsBYpos_df$snpsBYpos))
# sanity checks
# should be a factor
df$duet_outcome = as.factor(df$duet_outcome)
if (is.factor(df$duet_outcome)){
print("duet_outcome is factor")
}else{
print("convert duet_outcome to factor")
df$duet_outcome = as.factor(df$duet_outcome)
}
is.factor(df$duet_outcome)
table(df$duet_outcome)
@ -189,14 +204,6 @@ my_yats = 18
#******************
# generate plot: with axis colours
#******************
# plot name and location
# outdir/ (should be imported from reading file)
plotdir = paste0(outdir, "/", "plots") #should be imported from reading file
print(paste0("plot will be in:", plotdir))
bp_aa_subcols_duet = "barplot_acoloured_PS.svg"
plot_bp_aa_subcols_duet = paste0(outdir, "/plots/", bp_aa_subcols_duet)
print(paste0("plot name:", plot_bp_aa_subcols_duet))
svg(plot_bp_aa_subcols_duet, width = 26, height = 4)
@ -230,6 +237,7 @@ outPlot = g +
, axis.title.y = element_text(size = my_yals )
, axis.ticks.x = element_blank()) +
labs(title = ""
#title = my_title
, x = "position"
, y = "Frequency")