# HG changeset patch # User greg # Date 1510844385 18000 # Node ID ecc2397d5aeb4c0df83ccb62d08440ef4df3db35 # Parent 9f6e625c673e9f17144a235d29450d12d8f57d1e Uploaded diff -r 9f6e625c673e -r ecc2397d5aeb ideas_genome_tracks.R --- a/ideas_genome_tracks.R Thu Nov 16 09:59:38 2017 -0500 +++ b/ideas_genome_tracks.R Thu Nov 16 09:59:45 2017 -0500 @@ -15,7 +15,8 @@ make_option(c("-q", "--input_dir_state"), action="store", dest="input_dir_state", help="Directory containing .state outputs from IDEAS"), make_option(c("-u", "--output_track_db"), action="store", dest="output_track_db", help="Output track db file"), make_option(c("-v", "--output_build"), action="store", dest="output_build", help="Output genome build file"), - make_option(c("-w", "--output_hub"), action="store", dest="output_hub", help="Output hub file") + make_option(c("-w", "--output_hub"), action="store", dest="output_hub", help="Output hub file"), + make_option(c("-x", "--output_hub_files_path"), action="store", dest="output_hub_files_path", help="Output hub extra files path") ) parser <- OptionParser(usage="%prog [options] file", option_list=option_list) @@ -152,7 +153,9 @@ } if (length(opt$hub_name) == 0) { - hub_name = opt$hub_id; + hub_name <- opt$hub_id; +} else { + hub_name <- opt$hub_name; } # Create the tracks output directory. @@ -163,10 +166,9 @@ state_color <- create_color_scheme(opt$input_dir_para); # Create the tracks. -track_db <- create_track_db(opt$input_dir_state, opt$chrom_len_file, paste(tracks_output_dir, opt$hub_id, sep=""), state_color, opt$header, opt$state_name, opt$hub_name, opt$cell_info); +track_db <- create_track_db(opt$input_dir_state, opt$chrom_len_file, paste(tracks_output_dir, opt$hub_id, sep=""), state_color, opt$header, opt$state_name, hub_name, opt$cell_info); # Write the outputs. write.table(track_db, opt$output_track_db, quote=F, row.names=F, col.names=F); write.table(c(paste("genome", opt$build), opt$output_build), paste(tracks_output_dir, "genomes_", opt$hub_id, ".txt", sep=""), quote=F, row.names=F, col.names=F); -write.table(c(paste("hub", opt$hub_id), paste("shortLabel", opt$hub_id), paste("longLabel", opt$hub_name), paste("genomesFile genomes_", opt$hub_id, ".txt", sep=""), "email yzz2 at psu.edu"), opt$output_hub, quote=F, row.names=F, col.names=F); - +write.table(c(paste("hub", opt$hub_id), paste("shortLabel", opt$hub_id), paste("longLabel", hub_name), paste("genomesFile genomes_", opt$hub_id, ".txt", sep=""), "email yzz2 at psu.edu"), paste(opt$output_hub_files_path, "hub_", opt$hub_id, ".txt", sep=""), quote=F, row.names=F, col.names=F);