changeset 60:ae25785e78e1 draft

Uploaded
author greg
date Tue, 27 Jun 2017 08:06:19 -0400
parents c5fb4e2ed4e2
children c19c48db9f79
files ks_distribution.R
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ks_distribution.R	Tue Jun 27 08:06:10 2017 -0400
+++ b/ks_distribution.R	Tue Jun 27 08:06:19 2017 -0400
@@ -7,7 +7,7 @@
     make_option(c("-k", "--kaks_input"), action="store", dest="kaks_input", help="KaKs analysis input dataset"),
     make_option(c("-n", "--number_comp"), action="store", dest="number_comp", type="integer", help="Number of significant components in the Ks distribution"),
     make_option(c("-o", "--output"), action="store", dest="output", help="Output dataset"),
-    make_option(c("-r", "--colors"), action="store", dest="colors", default=NA, help="List of component colors")
+    make_option(c("-s", "--specified_colors"), action="store", dest="specified_colors", default=NA, help="List of component colors")
 )
 
 parser <- OptionParser(usage="%prog [options] file", option_list=option_list)
@@ -17,7 +17,7 @@
 set_component_colors = function(colors, number_comp)
 {
     # Handle colors for components.
-    if (is.na(colors) == 0) {
+    if (is.na(colors)) {
         # Randomly specify colors for components.
         component_colors <- c('red', 'yellow', 'green', 'black', 'blue', 'darkorange')
     } else {
@@ -52,7 +52,6 @@
 
 get_pi_mu_var = function(components_data, number_comp)
 {
-    # FixMe: enhance this to generically handle any integer value for number_comp.
     if (number_comp == 1) {
         pi <- c(components_data[1, 9])
         mu <- c(components_data[1, 7])
@@ -136,7 +135,7 @@
 number_comp <- as.integer(opt$number_comp)
 
 # Set component colors.
-component_colors <- set_component_colors(opt$colors, number_comp)
+component_colors <- set_component_colors(opt$specified_colors, number_comp)
 
 # Set pi, mu, var.
 items <- get_pi_mu_var(components_data, number_comp)