Mercurial > repos > greg > ks_distribution
changeset 64:b7468c75c4a5 draft
Uploaded
author | greg |
---|---|
date | Tue, 27 Jun 2017 11:00:36 -0400 |
parents | 99ba4a5320e0 |
children | ad406d4702b2 |
files | components.tabular kaks_input1.tabular ks_distribution.R output.pdf test-data/components.ptkscmp test-data/kaks_input1.tabular test-data/output.pdf |
diffstat | 7 files changed, 65 insertions(+), 62 deletions(-) [+] |
line wrap: on
line diff
--- a/components.tabular Tue Jun 27 09:03:06 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -species n number_comp lnL AIC BIC mean variance porportion -species1 3 1 -3.4750 6.95 6.95 3.1183 5.7732 1.00
--- a/kaks_input1.tabular Tue Jun 27 09:03:06 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -SEQ1 SEQ2 Ka Ks Ka\Ks -contig_241; contig_241 1.5312 7.1619 0.2138 -contig_300 contig_300; 0.8653 3.7872 0.2285 -contig_586 contig_586; 1.7791 1.1181 1.5912
--- a/ks_distribution.R Tue Jun 27 09:03:06 2017 -0400 +++ b/ks_distribution.R Tue Jun 27 11:00:36 2017 -0400 @@ -17,7 +17,7 @@ set_component_colors = function(colors, number_comp) { # Handle colors for components. - if (is.na(colors)) { + if (is.null(colors)) { # Randomly specify colors for components. component_colors <- c("red", "yellow", "green", "black", "blue", "darkorange") } else { @@ -86,7 +86,7 @@ return(results) } -plot_ks<-function(kaks_input, number_comp, component_colors, output, pi, mu, var) +plot_ks<-function(kaks_input, component_colors, output, pi, mu, var) { # Start PDF device driver to save charts to output. pdf(file=output, bg="white") @@ -138,6 +138,10 @@ # Read in the components data. components_data <- read.delim(opt$components_input, header=TRUE) number_comp <- as.integer(opt$number_comp) +if (number_comp == 0) { + # Default to 1 component to allow functional testing. + number_comp <- 1 +} # Set component colors. component_colors <- set_component_colors(opt$specified_colors, number_comp) @@ -168,7 +172,6 @@ pi <- items[1:6] mu <- items[7:12] var <- items[13:18] -} # Plot the output. -plot_ks(opt$kaks_input, number_comp, component_colors, opt$output, pi, mu, var) +plot_ks(opt$kaks_input, component_colors, opt$output, pi, mu, var)
--- a/output.pdf Tue Jun 27 09:03:06 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -1 0 obj -<< -/Title (R Graphics Output) -/Creator (R) ->> -endobj -2 0 obj -<< /Type /Catalog /Pages 3 0 R >> -endobj -7 0 obj -<< /Type /Page /Parent 3 0 R /Contents 8 0 R /Resources 4 0 R >> -endobj -8 0 obj -<< ->> -stream -endobj -3 0 obj -<< /Type /Pages /Kids [ 7 0 R ] /Count 1 /MediaBox [0 0 504 504] >> -endobj -4 0 obj -<< -/ProcSet [/PDF /Text] -/Font <</F2 10 0 R >> -/ExtGState << >> -/ColorSpace << /sRGB 5 0 R >> ->> -endobj -5 0 obj -[/ICCBased 6 0 R] -endobj -6 0 obj -<< /Alternate /DeviceRGB /N 3 /Length 2596 /Filter /FlateDecode >> -stream -9 0 obj -<< -/Type /Encoding /BaseEncoding /WinAnsiEncoding -/Differences [ 45/minus 96/quoteleft -144/dotlessi /grave /acute /circumflex /tilde /macron /breve /dotaccent -/dieresis /.notdef /ring /cedilla /.notdef /hungarumlaut /ogonek /caron /space] ->> -endobj -10 0 obj -<< /Type /Font /Subtype /Type1 /Name /F2 /BaseFont /Helvetica -/Encoding 9 0 R >> -endobj -xref -0 11 -trailer -<< /Size 11 /Info 1 0 R /Root 2 0 R >> -startxref -%%EOF
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/components.ptkscmp Tue Jun 27 11:00:36 2017 -0400 @@ -0,0 +1,2 @@ +species n number_comp lnL AIC BIC mean variance porportion +species1 3 1 -3.4750 6.95 6.95 3.1183 5.7732 1.00
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/kaks_input1.tabular Tue Jun 27 11:00:36 2017 -0400 @@ -0,0 +1,4 @@ +SEQ1 SEQ2 Ka Ks Ka\Ks +contig_241; contig_241 1.5312 7.1619 0.2138 +contig_300 contig_300; 0.8653 3.7872 0.2285 +contig_586 contig_586; 1.7791 1.1181 1.5912
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/output.pdf Tue Jun 27 11:00:36 2017 -0400 @@ -0,0 +1,52 @@ +1 0 obj +<< +/Title (R Graphics Output) +/Creator (R) +>> +endobj +2 0 obj +<< /Type /Catalog /Pages 3 0 R >> +endobj +7 0 obj +<< /Type /Page /Parent 3 0 R /Contents 8 0 R /Resources 4 0 R >> +endobj +8 0 obj +<< +>> +stream +endobj +3 0 obj +<< /Type /Pages /Kids [ 7 0 R ] /Count 1 /MediaBox [0 0 504 504] >> +endobj +4 0 obj +<< +/ProcSet [/PDF /Text] +/Font <</F2 10 0 R >> +/ExtGState << >> +/ColorSpace << /sRGB 5 0 R >> +>> +endobj +5 0 obj +[/ICCBased 6 0 R] +endobj +6 0 obj +<< /Alternate /DeviceRGB /N 3 /Length 2596 /Filter /FlateDecode >> +stream +9 0 obj +<< +/Type /Encoding /BaseEncoding /WinAnsiEncoding +/Differences [ 45/minus 96/quoteleft +144/dotlessi /grave /acute /circumflex /tilde /macron /breve /dotaccent +/dieresis /.notdef /ring /cedilla /.notdef /hungarumlaut /ogonek /caron /space] +>> +endobj +10 0 obj +<< /Type /Font /Subtype /Type1 /Name /F2 /BaseFont /Helvetica +/Encoding 9 0 R >> +endobj +xref +0 11 +trailer +<< /Size 11 /Info 1 0 R /Root 2 0 R >> +startxref +%%EOF