Mercurial > repos > hackdna > pathprint
diff histogram.r @ 0:0cebe436a553 draft default tip
Initial upload.
author | hackdna |
---|---|
date | Fri, 17 May 2013 14:29:33 -0400 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/histogram.r Fri May 17 14:29:33 2013 -0400 @@ -0,0 +1,27 @@ +#!/usr/bin/env Rscript + +#sink(file("/dev/null", "w"), type = "message"); + +library(pathprint); + +# Figure out the relative path to the galaxy-pathprint.r library. +script.args <- commandArgs(trailingOnly = FALSE); +script.name <- sub("--file=", "", script.args[grep("--file=", script.args)]) +script.base <- dirname(script.name) +library.path <- file.path(script.base, "galaxy-pathprint.r"); +source(library.path) + +usage <- function() { + stop("Usage: histogram.r <input> <output>", call. = FALSE) +} + +## Get the command line arguments. +args <- commandArgs(trailingOnly = TRUE) + +input <- ifelse(! is.na(args[1]), args[1], usage()) +output <- ifelse(! is.na(args[2]), args[2], usage()) + +distance <- loadDistance(input); +generateHistograms(distance, output); + +quit("no", 0)