#!/usr/bin/env Rscript

################################################
#### Read arguments from CLI
################################################

args <- commandArgs(trailingOnly = T)

out_folder <- args[1]
in_kallisto_df <- args[2]

################################################
#### If it does not exist, create out dir
################################################

dir.create(out_folder, recursive = T, showWarnings = F)

################################################
#### Prep data for shiny app
################################################

expression_data <- read.csv(file = in_kallisto_df)

available_genes <- unique(expression_data$target_id)

save(expression_data, available_genes, file = paste(out_folder, 'shiny_prep.RData', sep = "/"))