diff scripts/cluster.R @ 3:d55e29ac02e3 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit d94b3b8a4c7cf8c604279eb1eea24d32b3868922
author iuc
date Mon, 15 Apr 2019 17:55:17 -0400
parents 56a093c2a3f9
children 5d5b14dbd092
line wrap: on
line diff
--- a/scripts/cluster.R	Thu Feb 28 17:40:54 2019 -0500
+++ b/scripts/cluster.R	Mon Apr 15 17:55:17 2019 -0400
@@ -1,5 +1,5 @@
 #!/usr/bin/env R
-VERSION = "0.3"
+VERSION = "0.4"
 
 args = commandArgs(trailingOnly = T)
 
@@ -28,6 +28,10 @@
     filt.lib <- log10(colSums(getfdata(sc)))
     filt.feat <- log10(colSums(getfdata(sc)>0))
 
+    if (filt.geqone){
+        filt.feat <- log10(colSums(getfdata(sc)>=1))
+    }
+
     br <- 50
     ## Determine limits on plots based on the unfiltered data
     ## (doesn't work, R rejects limits and norm data is too different to compare to exp data
@@ -124,11 +128,12 @@
 
         goi <- head(rownames(dg.goi.table), genelist.plotlim)
         print(plotmarkergenes(sc, goi))
-        print(do.call(mtext, c(paste("                               Cluster ",n), test)))  ## spacing is a hack
+        buffer <- paste(rep("", 36), collapse=" ")
+        print(do.call(mtext, c(paste(buffer, "Cluster ",n), test)))  ## spacing is a hack
         test$line=-1
-        print(do.call(mtext, c(paste("                               Sig. Genes"), test)))  ## spacing is a hack
+        print(do.call(mtext, c(paste(buffer, "Sig. Genes"), test)))  ## spacing is a hack
         test$line=-2
-        print(do.call(mtext, c(paste("                               (fc > ", genelist.foldchange,")"), test)))  ## spacing is a hack
+        print(do.call(mtext, c(paste(buffer, "(fc > ", genelist.foldchange,")"), test)))  ## spacing is a hack
 
     })
     write.table(df, file=out.genelist, sep="\t", quote=F)
@@ -139,10 +144,10 @@
 if (use.filtnormconf){
     sc <- do.filter(sc)
     message(paste(" - Source:: genes:",nrow(sc@expdata),", cells:",ncol(sc@expdata)))
-    message(paste(" - Filter:: genes:",nrow(sc@ndata),", cells:",ncol(sc@ndata)))
+    message(paste(" - Filter:: genes:",nrow(getfdata(sc)),", cells:",ncol(getfdata(sc))))
     message(paste("         :: ",
-                  sprintf("%.1f", 100 * nrow(sc@ndata)/nrow(sc@expdata)), "% of genes remain,",
-                  sprintf("%.1f", 100 * ncol(sc@ndata)/ncol(sc@expdata)), "% of cells remain"))
+                  sprintf("%.1f", 100 * nrow(getfdata(sc))/nrow(sc@expdata)), "% of genes remain,",
+                  sprintf("%.1f", 100 * ncol(getfdata(sc))/ncol(sc@expdata)), "% of cells remain"))
 }
 
 if (use.cluster){