adpated combining_dfs.py and plotting.R for gid and attempting to make it generic

This commit is contained in:
Tanushree Tunstall 2021-06-04 14:36:16 +01:00
parent d52534f676
commit 7242b3516b
3 changed files with 91 additions and 81 deletions

View file

@ -14,31 +14,37 @@ getwd()
library(ggplot2)
library(data.table)
library(dplyr)
source("dirs.R")
require("getopt", quietly = TRUE) #cmd parse arguments
source("dirs.R")
#========================================================
# command line args
#spec = matrix(c(
# "drug" , "d", 1, "character",
# "gene" , "g", 1, "character"
#), byrow = TRUE, ncol = 4)
spec = matrix(c(
"drug" , "d", 1, "character",
"gene" , "g", 1, "character"
), byrow = TRUE, ncol = 4)
#opt = getopt(spec)
opt = getopt(spec)
#drug = opt$druggene = opt$gene
#FIXME: detect if script running from cmd, then set these
#drug = opt$drug
#gene = opt$gene
# hardcoding when not using cmd
drug = "streptomycin"
gene = "gid"
if(is.null(drug)|is.null(gene)) {
stop("Missing arguments: --drug and --gene must both be specified (case-sensitive)")
}
#if(is.null(drug)|is.null(gene)) {
# stop("Missing arguments: --drug and --gene must both be specified (case-sensitive)")
#}
#========================================================
#======
# input
#======
#in_filename = "mcsm_complex1_normalised.csv"
in_filename_params = paste0(tolower(gene), "_all_params.csv")
#in_filename_params = paste0(tolower(gene), "_all_params.csv")
in_filename_params = paste0(tolower(gene), "_comb_stab_struc_params.csv") # part combined
infile_params = paste0(outdir, "/", in_filename_params)
cat(paste0("Input file 1:", infile_params) )