minor updates to dir.R

This commit is contained in:
Tanushree Tunstall 2021-06-04 15:05:52 +01:00
parent 7242b3516b
commit 4f60e93abb
4 changed files with 11 additions and 418 deletions

View file

@ -156,34 +156,7 @@ foo = select(df, mutationinformation
svg(plot_pos_count_duet)
print(paste0("plot filename:", plot_pos_count_duet))
my_ats = 25 # axis text size
my_als = 22 # axis label size
# to make x axis display all positions
# not sure if to use with sort or directly
my_x = sort(unique(snpsBYpos_df$snpsBYpos))
g = ggplot(snpsBYpos_df, aes(x = snpsBYpos))
OutPlot_pos_count = g + geom_bar(aes (alpha = 0.5)
, show.legend = FALSE) +
scale_x_continuous(breaks = unique(snpsBYpos_df$snpsBYpos)) +
#scale_x_continuous(breaks = my_x) +
geom_label(stat = "count", aes(label = ..count..)
, color = "black"
, size = 10) +
theme(axis.text.x = element_text(size = my_ats
, angle = 0)
, axis.text.y = element_text(size = my_ats
, angle = 0
, hjust = 1)
, axis.title.x = element_text(size = my_als)
, axis.title.y = element_text(size = my_als)
, plot.title = element_blank()) +
labs(x = "Number of nsSNPs"
, y = "Number of Sites")
print(OutPlot_pos_count)
source("dirs.R")
dev.off()
########################################################################
# end of PS barplots

View file

@ -12,10 +12,10 @@ import_dirs <- function(drug, gene) {
#=============
# directories and variables
#=============
datadir <<- paste0("~/git/Data")
indir <<- paste0(datadir, "/", drug, "/input")
outdir <<- paste0("~/git/Data", "/", drug, "/output")
plotdir <<- paste0("~/git/Data", "/", drug, "/output/plots")
datadir <<- paste0("~/git/Data/")
indir <<- paste0(datadir, drug, "/input")
outdir <<- paste0("~/git/Data/", drug, "/output")
plotdir <<- paste0("~/git/Data/", drug, "/output/plots")
dr_muts_col <<- paste0('dr_mutations_', drug)
other_muts_col <<- paste0('other_mutations_', drug)

View file

@ -15,8 +15,6 @@ library(ggplot2)
library(data.table)
library(dplyr)
require("getopt", quietly = TRUE) #cmd parse arguments
source("dirs.R")
#========================================================
# command line args
spec = matrix(c(
@ -37,8 +35,13 @@ gene = "gid"
if(is.null(drug)|is.null(gene)) {
stop("Missing arguments: --drug and --gene must both be specified (case-sensitive)")
}
#========================================================
# Load functions
# import dir structure
source("dirs.R")
import_dirs(drug, gene)
#=======================================================
#======
# input
#======