diff goprofiles.R @ 10:2138e0035e57 draft

planemo upload commit 4efc56eb769fbceb66c64181441ff8781d523454-dirty
author proteore
date Mon, 04 Mar 2019 08:20:52 -0500
parents 948fecb6a40b
children 3ddc1f78773d
line wrap: on
line diff
--- a/goprofiles.R	Mon Mar 04 05:48:48 2019 -0500
+++ b/goprofiles.R	Mon Mar 04 08:20:52 2019 -0500
@@ -92,11 +92,16 @@
 
 #return height and width of plot in inches from profile
 plot_size_from_nb_onto <- function(profile){
-    width=10
-    range = seq(50, 2000, by=25)
-    names(range) = seq(8,242, by=3)
-    nb_onto = round(nrow(profile[[1]])/25)*25
-    height= as.integer(names(which(range==nb_onto)))
+  width=10
+  range = seq(25, 2000, by=25)
+  names(range) = seq(5,242, by=3)
+  nb_onto = round(nrow(profile[[1]])/25)*25
+  if (nb_onto < 25) {nb_onto = 25}
+    if (nb_onto <= 2000) {
+      height= as.integer(names(which(range==nb_onto)))
+    } else {
+      height=250
+    }
   return (c(width,height))
 }