Commit 69d4be80 authored by Jefferson F. Paril's avatar Jefferson F. Paril 😁

making the R analysis scripts more generic

parent a194f253
......@@ -283,13 +283,13 @@ elif [ $ACTION -eq 1 ]; then
cd ${SRC_DIR}
if [ $m2 -eq 1 ]; then
# Rscript ~/instaGraminoid/cross_validation.r "$m1" "$DIR"
Rscript ${SRC_DIR}/cross_validation.r "$m1" "$DIR"
Rscript cross_validation.r "$m1" "$DIR"
elif [ $m2 -eq 2 ]; then
# Rscript ~/instaGraminoid/logit_plots.r "$m1" "$DIR"
Rscript ${SRC_DIR}/logit_plots.r "$m1" "$DIR"
Rscript logit_plots.r "$m1" "$DIR"
elif [ $m2 -eq 3 ]; then
# Rscript ~/instaGraminoid/resistance_variation.r "$m1" "$DIR"
Rscript ${SRC_DIR}/resistance_variation.r "$m1" "$DIR"
Rscript resistance_variation.r "$m1" "$DIR"
else
echo "INVALID ANALYSIS TYPE. CHOOSE:"
echo " 1 for cross-validation,"
......
......@@ -6,9 +6,8 @@
#input
args = commandArgs(trailing = TRUE)
SRC_DIR = dirname(sub("--file=", "", args[grep("--file=", args)]))
input_file = args[6] #input csv file with the instaGraminoid-derived metrics and the binary survival data merged into 1 datframe
output_dir = args[7] #output directory where to write-out all outputs
input_file = args[1] #input csv file with the instaGraminoid-derived metrics and the binary survival data merged into 1 datframe
output_dir = args[2] #output directory where to write-out all outputs
# # test
# setwd("/home/student.unimelb.edu.au/jparil/Documents/QUANTITATIVE_GENETICS-combine_SNP_and_transcript_data/EXP02_reGWAlpha_new_popns/INSTAGROMINOID_LOGISTIC_REGRESSION")
......@@ -20,11 +19,7 @@ output_dir = args[7] #output directory where to write-out all outputs
library(glmnet)
library(lme4)
library(ROCR)
tryCatch({
source("quantitative_resistance.r")
}, error=function(e) {
paste0(SRC_DIR, "/quantitative_resistance.r")
})
source("quantitative_resistance.r")
#import data
dat = read.csv(input_file)
......
......@@ -9,9 +9,9 @@
#usage example: $ Rscript resistance_variation.r EXP16_ANALYSIS_INPUT.csv "$(pwd)"/OUTPUT
#input
args = commandArgs(trailingOnly = FALSE)
input_file = args[6] #input csv file with the instaGraminoid-derived metrics and the binary survival data merged into 1 datframe
output_dir = args[7] #output directory where to write-out all outputs
args = commandArgs(trailingOnly = TRUE)
input_file = args[1] #input csv file with the instaGraminoid-derived metrics and the binary survival data merged into 1 datframe
output_dir = args[2] #output directory where to write-out all outputs
# #i.e.
# input_file = "EXP16_ANALYSIS_INPUT.csv"
# output_dir = paste0(getwd(), "/OUTPUT/")
......@@ -24,12 +24,8 @@ output_dir = args[7] #output directory where to write-out all outputs
library(glmnet)
library(lme4)
library(ROCR)
SRC_DIR = dirname(sub("--file=", "", args[grep("--file=", args)]))
tryCatch({
source("quantitative_resistance.r")
}, error=function(e) {
paste0(SRC_DIR, "/quantitative_resistance.r")
})
source("quantitative_resistance.r")
########################################################################
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment