changeset 9:ecc2397d5aeb draft

Uploaded
author greg
date Thu, 16 Nov 2017 09:59:45 -0500
parents 9f6e625c673e
children 2b484c93d20a
files ideas_genome_tracks.R
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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);