Mercurial > repos > hackdna > pathprint
comparison distance.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 data(GEO.metadata.matrix); | |
15 | |
16 usage <- function() { | |
17 stop("Usage: distance.r <input> <output> <output2>", call. = FALSE) | |
18 } | |
19 | |
20 ## Get the command line arguments. | |
21 args <- commandArgs(trailingOnly = TRUE) | |
22 | |
23 input <- ifelse(! is.na(args[1]), args[1], usage()) | |
24 output <- ifelse(! is.na(args[2]), args[2], usage()) | |
25 output2 <- ifelse(! is.na(args[3]), args[3], usage()) | |
26 | |
27 fingerprint <- loadFingerprint(input); | |
28 distance <- calculateDistanceToPluripotent(fingerprint, verbose = 0); | |
29 saveDistance(distance, output); | |
30 | |
31 generateHistograms(distance, output2); | |
32 | |
33 quit("no", 0) |