Mercurial > repos > greg > ideas
comparison create_heatmaps.R @ 143:269e7e466b00 draft
Uploaded
author | greg |
---|---|
date | Wed, 20 Dec 2017 13:01:10 -0500 |
parents | a976dd6fcd1b |
children | 08e77c105188 |
comparison
equal
deleted
inserted
replaced
142:8cfcf32c4282 | 143:269e7e466b00 |
---|---|
1 #!/usr/bin/env Rscript | 1 #!/usr/bin/env Rscript |
2 | 2 |
3 suppressPackageStartupMessages(library("optparse")) | 3 suppressPackageStartupMessages(library("optparse")) |
4 | 4 |
5 option_list <- list( | 5 option_list <- list( |
6 make_option(c("-i", "--input_dir"), action="store", dest="input_dir", help="IDEAS para files directory"), | 6 make_option(c("--input_dir"), action="store", dest="input_dir", help="IDEAS para files directory"), |
7 make_option(c("-o", "--output_dir"), action="store", dest="output_dir", help="PDF output directory") | 7 make_option(c("--output_dir"), action="store", dest="output_dir", help="PDF output directory"), |
8 make_option(c("--script_dir"), action="store", dest="script_dir", help="R script source directory") | |
8 ) | 9 ) |
9 | 10 |
10 parser <- OptionParser(usage="%prog [options] file", option_list=option_list); | 11 parser <- OptionParser(usage="%prog [options] file", option_list=option_list); |
11 args <- parse_args(parser, positional_arguments=TRUE); | 12 args <- parse_args(parser, positional_arguments=TRUE); |
12 opt <- args$options; | 13 opt <- args$options; |
13 | 14 |
14 source("create_heatmap.R"); | 15 heatmap_path <- paste(opt$script_dir, "create_heatmap.R", sep="/"); |
16 source(heatmap_path); | |
15 | 17 |
16 para_files <- list.files(path=opt$input_dir, pattern="\\.para$", full.names=TRUE); | 18 para_files <- list.files(path=opt$input_dir, pattern="\\.para$", full.names=TRUE); |
17 for (i in 1:length(para_files)) { | 19 for (i in 1:length(para_files)) { |
18 para_file <- para_files[i]; | 20 para_file <- para_files[i]; |
19 para_file_base_name <- strsplit(para_file, split="/")[[1]][2]; | 21 para_file_base_name <- strsplit(para_file, split="/")[[1]][2]; |