# HG changeset patch # User greg # Date 1516722518 18000 # Node ID e97851e8951b4e4ac9a43dfea53c31c6f17de9b7 # Parent 248b5f72fc02aa458d1a7e19cb90586eb70b6f21 Uploaded diff -r 248b5f72fc02 -r e97851e8951b ideas_preprocessor.R --- a/ideas_preprocessor.R Tue Jan 23 10:48:31 2018 -0500 +++ b/ideas_preprocessor.R Tue Jan 23 10:48:38 2018 -0500 @@ -4,17 +4,19 @@ suppressPackageStartupMessages(library("optparse")) option_list <- list( - make_option(c("--bed_input"), action="store", dest="bed_input", defaul=NULL, help="Chromosome windows positions file"), - make_option(c("--exclude_input"), action="store", dest="exclude_input", defaul=NULL, help="File(s) containing regions to exclude"), - make_option(c("--bychr"), action="store_true", dest="bychr", defaul=FALSE, help="Separate files by chromosome"), - make_option(c("--chrom_len_file"), action="store", dest="chrom_len_file", default=NULL, help="Chromosome lengths file"), - make_option(c("--output"), action="store", dest="output", help="Primary output dataset"), - make_option(c("--output_files_path"), action="store", dest="output_files_path", help="Primary output dataset extra files path"), - make_option(c("--prep_input_config"), action="store", dest="prep_input_config", help="Preprocessing input config file"), - make_option(c("--reads_per_bp"), action="store", dest="reads_per_bp", type="integer", help="Calculate the signal in each genomic window"), - make_option(c("--restrict_to_chroms"), action="store", dest="restrict_to_chroms", default=NULL, help="Restrict processing to specified chromosomes"), - make_option(c("--standardize_datasets"), action="store_true", dest="standardize_datasets", default=FALSE, help="Standardize all datasets"), - make_option(c("--window_size"), action="store", dest="window_size", type="integer", default=NULL, help="Window size in base pairs") + make_option(c("--bed_input"), action="store", dest="bed_input", defaul=NULL, help="Chromosome windows positions file"), + make_option(c("--exclude_input"), action="store", dest="exclude_input", defaul=NULL, help="File(s) containing regions to exclude"), + make_option(c("--bychr"), action="store_true", dest="bychr", defaul=FALSE, help="Separate files by chromosome"), + make_option(c("--chrom_len_file"), action="store", dest="chrom_len_file", default=NULL, help="Chromosome lengths file"), + make_option(c("--output"), action="store", dest="output", help="Primary output dataset"), + make_option(c("--output_files_path"), action="store", dest="output_files_path", help="Primary output dataset extra files path"), + make_option(c("--prep_input_config"), action="store", dest="prep_input_config", help="Preprocessing input config file"), + make_option(c("--prep_output_config"), action="store", dest="prep_output_config", help="Preprocessing output config file"), + make_option(c("--reads_per_bp"), action="store", dest="reads_per_bp", type="integer", help="Calculate the signal in each genomic window"), + make_option(c("--restrict_to_chroms"), action="store", dest="restrict_to_chroms", default=NULL, help="Restrict processing to specified chromosomes"), + make_option(c("--standardize_datasets"), action="store_true", dest="standardize_datasets", default=FALSE, help="Standardize all datasets"), + make_option(c("--windows_positions_by_chroms_config"), action="store", dest="windows_positions_by_chroms_config", default=NULL, help="Windows positions by chroms config file"), + make_option(c("--window_size"), action="store", dest="window_size", type="integer", default=NULL, help="Window size in base pairs") ) parser <- OptionParser(usage="%prog [options] file", option_list=option_list) @@ -22,21 +24,21 @@ opt <- args$options create_primary_html = function(output, output_files_path) { - tmp_files = list.files(path=output_files_path); + files = list.files(path=output_files_path, pattern="\\.txt"); s <- paste('
', sep="\n"); s <- paste(s, '