fixed cmd running script problem for logo plots
This commit is contained in:
parent
552c5e77aa
commit
ca2315523d
14 changed files with 206 additions and 748 deletions
|
@ -5,28 +5,67 @@
|
|||
#=======================================================================
|
||||
# working dir and loading libraries
|
||||
getwd()
|
||||
setwd("~/git/LSHTM_analysis/scripts/plotting/")
|
||||
setwd("~/git/LSHTM_analysis/scripts/plotting")
|
||||
getwd()
|
||||
|
||||
#source("Header_TT.R")
|
||||
source("combining_dfs_plotting.R")
|
||||
source("my_pairs_panel.R") # with lower panel turned off
|
||||
# should return the following dfs, directories and variables
|
||||
source("../functions/my_pairs_panel.R") # with lower panel turned off
|
||||
source("../functions/plotting_globals.R")
|
||||
source("../functions/plotting_data.R")
|
||||
source("../functions/combining_dfs_plotting.R")
|
||||
###########################################################
|
||||
#===========
|
||||
# input
|
||||
#===========
|
||||
#---------------------
|
||||
# call: import_dirs()
|
||||
#---------------------
|
||||
import_dirs(drug, gene)
|
||||
|
||||
#---------------------------
|
||||
# call: plotting_data()
|
||||
#---------------------------
|
||||
#if (!exists("infile_params") && exists("gene")){
|
||||
if (!is.character(infile_params) && exists("gene")){ # when running as cmd
|
||||
#in_filename_params = paste0(tolower(gene), "_all_params.csv")
|
||||
in_filename_params = paste0(tolower(gene), "_comb_afor.csv") # part combined for gid
|
||||
infile_params = paste0(outdir, "/", in_filename_params)
|
||||
cat("\nInput file for mcsm comb data not specified, assuming filename: ", infile_params, "\n")
|
||||
}
|
||||
|
||||
# Input 1: read <gene>_comb_afor.csv
|
||||
cat("\nReading mcsm combined data file: ", infile_params)
|
||||
mcsm_df = read.csv(infile_params, header = T)
|
||||
pd_df = plotting_data(mcsm_df)
|
||||
my_df_u = pd_df[[1]] # this forms one of the input for combining_dfs_plotting()
|
||||
|
||||
#--------------------------------
|
||||
# call: combining_dfs_plotting()
|
||||
#--------------------------------
|
||||
#if (!exists("infile_metadata") && exists("gene")){
|
||||
if (!is.character(infile_metadata) && exists("gene")){ # when running as cmd
|
||||
in_filename_metadata = paste0(tolower(gene), "_metadata.csv") # part combined for gid
|
||||
infile_metadata = paste0(outdir, "/", in_filename_metadata)
|
||||
cat("\nInput file for gene metadata not specified, assuming filename: ", infile_metadata, "\n")
|
||||
}
|
||||
|
||||
# Input 2: read <gene>_meta data.csv
|
||||
cat("\nReading meta data file: ", infile_metadata)
|
||||
|
||||
gene_metadata <- read.csv(infile_metadata
|
||||
, stringsAsFactors = F
|
||||
, header = T)
|
||||
|
||||
all_plot_dfs = combining_dfs_plotting(my_df_u
|
||||
, gene_metadata
|
||||
, lig_dist_colname = 'ligand_distance'
|
||||
, lig_dist_cutoff = 10)
|
||||
|
||||
|
||||
|
||||
|
||||
# PS combined:
|
||||
# 1) merged_df2
|
||||
# 2) merged_df2_comp
|
||||
# 3) merged_df3
|
||||
# 4) merged_df3_comp
|
||||
|
||||
# LIG combined:
|
||||
# 5) merged_df2_lig
|
||||
# 6) merged_df2_comp_lig
|
||||
# 7) merged_df3_lig
|
||||
# 8) merged_df3_comp_lig
|
||||
|
||||
# 9) my_df_u
|
||||
# 10) my_df_u_lig
|
||||
|
||||
cat(paste0("Directories imported:"
|
||||
, "\ndatadir:", datadir
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue