Mercurial > repos > greg > ks_distribution
comparison ks_distribution.R @ 42:60e2cf57f2c1 draft
Uploaded
| author | greg |
|---|---|
| date | Mon, 26 Jun 2017 12:10:21 -0400 |
| parents | 17ca41359a2d |
| children | 5074cb26597a |
comparison
equal
deleted
inserted
replaced
| 41:17ca41359a2d | 42:60e2cf57f2c1 |
|---|---|
| 5 option_list <- list( | 5 option_list <- list( |
| 6 make_option(c("-c", "--components_input"), action="store", dest="components_input", help="Ks significant components input dataset"), | 6 make_option(c("-c", "--components_input"), action="store", dest="components_input", help="Ks significant components input dataset"), |
| 7 make_option(c("-k", "--kaks_input"), action="store", dest="kaks_input", help="KaKs analysis input dataset"), | 7 make_option(c("-k", "--kaks_input"), action="store", dest="kaks_input", help="KaKs analysis input dataset"), |
| 8 make_option(c("-n", "--number_comp"), action="store", dest="number_comp", type="integer", help="Number of significant components in the Ks distribution"), | 8 make_option(c("-n", "--number_comp"), action="store", dest="number_comp", type="integer", help="Number of significant components in the Ks distribution"), |
| 9 make_option(c("-o", "--output"), action="store", dest="output", help="Output dataset"), | 9 make_option(c("-o", "--output"), action="store", dest="output", help="Output dataset"), |
| 10 make_option(c("-r", "--colors"), action="store", default=NA, help="List of component colors") | 10 make_option(c("-r", "--colors"), action="store", default="", help="List of component colors") |
| 11 ) | 11 ) |
| 12 | 12 |
| 13 parser <- OptionParser(usage="%prog [options] file", option_list=option_list) | 13 parser <- OptionParser(usage="%prog [options] file", option_list=option_list) |
| 14 args <- parse_args(parser, positional_arguments=TRUE) | 14 args <- parse_args(parser, positional_arguments=TRUE) |
| 15 opt <- args$options | 15 opt <- args$options |
| 16 | 16 |
| 17 set_component_colors = function(colors, number_comp) | 17 set_component_colors = function(colors, number_comp) |
| 18 { | 18 { |
| 19 # Handle colors for components. | 19 # Handle colors for components. |
| 20 if (is.na(colors)) | 20 if (nchar(colors) == 0) |
| 21 { | 21 { |
| 22 # Randomly specify colors for components. | 22 # Randomly specify colors for components. |
| 23 specified_colors <- c('red', 'yellow', 'green', 'black', 'blue', 'darkorange') | 23 specified_colors <- c('red', 'yellow', 'green', 'black', 'blue', 'darkorange') |
| 24 } | 24 } |
| 25 else | 25 else |
