Mercurial > repos > greg > ks_distribution
changeset 21:e6bbc7426cd1 draft
Uploaded
author | greg |
---|---|
date | Mon, 26 Jun 2017 07:51:11 -0400 |
parents | 79e00e063a40 |
children | f3b7455d6c04 |
files | ks_distribution.R |
diffstat | 1 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/ks_distribution.R Fri Jun 23 15:00:42 2017 -0400 +++ b/ks_distribution.R Mon Jun 26 07:51:11 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", "--num_comp"), action="store", dest="num_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", default=NA, help="List of component colors") + make_option(c("-r", "--colors"), action="store", default=[], help="List of component colors") ) parser <- OptionParser(usage="%prog [options] file", option_list=option_list) @@ -82,7 +82,7 @@ barplot(nc, space=0.25, offset=0, width=0.04, xlim=c(0, max_ks), ylim=c(0, ymax), col="lightpink1", border="lightpink3") # Add x-axis. axis(1) - if is.na(colors) + if (length(colors) == 0) { color <- c('red', 'yellow', 'green', 'black', 'blue', 'darkorange') } @@ -96,27 +96,27 @@ color <- c(color, item) } num_colors_specified = length(color) - if num_colors_specified < num_components: + if (num_colors_specified < num_components): { for (i in num_colors_specified:num_components) { - if !(any(color=='red') + if !(any(color=='red')) { color <- c(color, 'red') } - else if !(any(color=='yellow') + else if !(any(color=='yellow')) { color <- c(color, 'yellow') } - else if !(any(color=='green') + else if !(any(color=='green')) { color <- c(color, 'green') } - else if !(any(color=='black') + else if !(any(color=='black')) { color <- c(color, 'black') } - else if !(any(color=='blue') + else if !(any(color=='blue')) { color <- c(color, 'blue') }