From f4ebb07045dad2c6bce5a6ec42a54d6859bc1ddd Mon Sep 17 00:00:00 2001 From: Tanushree Tunstall Date: Mon, 20 Sep 2021 16:12:45 +0100 Subject: [PATCH] split csv for isoniazid --- dynamut/split_csv.sh | 1 + mcsm/run_mcsm.py | 2 +- my_header.R | 107 ++++++++++++++++++++++++++++++++----------- 3 files changed, 82 insertions(+), 28 deletions(-) diff --git a/dynamut/split_csv.sh b/dynamut/split_csv.sh index 17c1a03..1f7a793 100755 --- a/dynamut/split_csv.sh +++ b/dynamut/split_csv.sh @@ -19,5 +19,6 @@ split ../../${INFILE} -l ${CHUNK} -d snp_batch_ #~/git/LSHTM_analysis/dynamut/split_csv.sh gid_mcsm_formatted_snps.csv snp_batches 50 #~/git/LSHTM_analysis/dynamut/split_csv.sh embb_mcsm_formatted_snps.csv snp_batches 50 #~/git/LSHTM_analysis/dynamut/split_csv.sh pnca_mcsm_formatted_snps.csv snp_batches 50 +#~/git/LSHTM_analysis/dynamut/split_csv.sh katg_mcsm_formatted_snps.csv snp_batches 50 #Date: 20/09/2021 # add .txt to the files diff --git a/mcsm/run_mcsm.py b/mcsm/run_mcsm.py index 7e38543..da621f5 100755 --- a/mcsm/run_mcsm.py +++ b/mcsm/run_mcsm.py @@ -104,7 +104,7 @@ if mutation_filename: in_filename_snps = mutation_filename else: in_filename_snps = gene.lower() + '_mcsm_formatted_snps.csv' - + infile_snps = outdir + '/' + in_filename_snps #======= diff --git a/my_header.R b/my_header.R index 5009f29..2fa892c 100644 --- a/my_header.R +++ b/my_header.R @@ -1,21 +1,31 @@ ######################################################### -### A) Installing and loading required packages +# A) Installing and loading required packages +# B) My functions +######################################################### + ######################################################### #lib_loc = "/usr/local/lib/R/site-library") -#if (!require("gplots")) { -# install.packages("gplots", dependencies = TRUE) -# library(gplots) -#} +require("getopt", quietly = TRUE) # cmd parse arguments -#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) - library(ggplot2) +if (!require("shiny")) { + install.packages("shiny", dependencies = TRUE) + library(shiny) +} + +if (!require("shinyBS")) { + install.packages("shinyBS", dependencies = TRUE) + library(shinyBS) +} + +if (!require("gridExtra")) { + install.packages("gridExtra", dependencies = TRUE) + library(gridExtra) } if (!require("ggridges")) { @@ -23,6 +33,35 @@ if (!require("ggridges")) { library(ggridges) } +# if (!require("ggplot2")) { +# install.packages("ggplot2", dependencies = TRUE) +# library(ggplot2) +# } + +# if (!require ("dplyr")){ +# install.packages("dplyr") +# library(dplyr) +# } + +if (!require ("DT")){ + install.packages("DT") + library(DT) +} + +if (!require ("plyr")){ + install.packages("plyr") + library(plyr) + } + +# Install +#if(!require(devtools)) install.packages("devtools") +#devtools::install_github("kassambara/ggcorrplot") + +if (!require ("ggbeeswarm")){ + install.packages("ggbeeswarm") + library(ggbeeswarm) +} + if (!require("plotly")) { install.packages("plotly", dependencies = TRUE) library(plotly) @@ -103,11 +142,6 @@ if (!require ("psych")){ library(psych) } -if (!require ("dplyr")){ - install.packages("dplyr") - library(dplyr) -} - if (!require ("compare")){ install.packages("compare") library(compare) @@ -118,18 +152,37 @@ if (!require ("arsenal")){ library(arsenal) } +if(!require(ggseqlogo)){ + install.packages("ggseqlogo") + library(ggseqlogo) +} -####TIDYVERSE -# Install -#if(!require(devtools)) install.packages("devtools") -#devtools::install_github("kassambara/ggcorrplot") - -#library(ggcorrplot) - - -###for PDB files -#install.packages("bio3d") +# for PDB files if(!require(bio3d)){ install.packages("bio3d") library(bio3d) } + +library(protr) +if(!require(protr)){ + install.packages("protr") + library(protr) +} + +#if (!requireNamespace("BiocManager", quietly = TRUE)) +# install.packages("BiocManager") + +#BiocManager::install("Logolas") +library("Logolas") + + +#################################### +# Load all my functions: +# only works if tidyverse is loaded +# hence included it here! +#################################### + +func_path = "~/git/LSHTM_analysis/scripts/functions/" +source_files <- list.files(func_path, "\\.R$") # locate all .R files +map(paste0(func_path, source_files), source) # source all your R scripts! +