comparison heatmap.r @ 0:0cebe436a553 draft default tip

Initial upload.
author hackdna
date Fri, 17 May 2013 14:29:33 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:0cebe436a553
1 #!/usr/bin/env Rscript
2
3 #sink(file("/dev/null", "w"), type = "message");
4
5 library(pathprint);
6
7 # Figure out the relative path to the galaxy-pathprint.r library.
8 script.args <- commandArgs(trailingOnly = FALSE);
9 script.name <- sub("--file=", "", script.args[grep("--file=", script.args)])
10 script.base <- dirname(script.name)
11 library.path <- file.path(script.base, "galaxy-pathprint.r");
12 source(library.path)
13
14 usage <- function() {
15 stop("Usage: heatmap.r <fingerprint> <sdev> <output>", call. = FALSE)
16 }
17
18 ## Get the command line arguments.
19 args <- commandArgs(trailingOnly = TRUE)
20
21 input <- ifelse(! is.na(args[1]), args[1], usage())
22 sdev <- ifelse(! is.na(args[2]), as.numeric(args[2]), usage())
23 output <- ifelse(! is.na(args[3]), args[3], usage())
24
25
26 fingerprint <- loadFingerprint(input);
27 fingerprint <- data.frame(fingerprint[complete.cases(fingerprint),]);
28
29 generateHeatmap(fingerprint, sdev, output);
30
31 quit("no", 0)