# HG changeset patch # User nikos # Date 1423659910 18000 # Node ID ceb96c265bd196e2f5847d112520b1bd46df9956 # Parent c139b9abe0646896a9d46f6dcfe0e93f7e2f2a24 Trying to set environment r lib path dependencies. diff -r c139b9abe064 -r ceb96c265bd1 k2n.R --- a/k2n.R Wed Feb 11 07:32:32 2015 -0500 +++ b/k2n.R Wed Feb 11 08:05:10 2015 -0500 @@ -1,11 +1,18 @@ +## Setup R error handling to go to stderr +options( show.error.messages = FALSE, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } ) + +# we need that to not crash galaxy with an UTF8 error on German LC settings. +Sys.setlocale("LC_MESSAGES", "en_US.UTF-8") + options(stringAsfactors = FALSE, useFancyQuotes = FALSE) args <- commandArgs(trailingOnly = TRUE) -library(RNAprobR) +.libPaths(args[1]) +suppressMessages(require(RNAprobR)) # Read inputs -merged <- args[1] -unique_barcodes <- args[2] -output <- args[3] +merged <- args[2] +unique_barcodes <- args[3] +output <- args[4] k2n_calc( merged, unique_barcodes, output ) diff -r c139b9abe064 -r ceb96c265bd1 summarize_unique_barcodes.sh --- a/summarize_unique_barcodes.sh Wed Feb 11 07:32:32 2015 -0500 +++ b/summarize_unique_barcodes.sh Wed Feb 11 08:05:10 2015 -0500 @@ -25,9 +25,10 @@ -t: Trim untemplated nucleotides. -k: Produce k2n file. Warning: Can be sloooow! -r: Rscript path +-l: R lib path -o: Output folder (default: "output_dir") ------------------------------------- -Usage : summarize_unique_barcodes.sh -f -b -p -t -k -r +Usage : summarize_unique_barcodes.sh -f -b -p -t -k -r -l End-of-message exit } @@ -37,7 +38,7 @@ trim_flag="False" #parse input -while getopts hf:b::p:o:ktr: myarg +while getopts hf:b::p:o:ktr:l: myarg do case "$myarg" in h) print_help exit ;; @@ -48,6 +49,7 @@ p) priming_pos="$OPTARG" ;; o) output_dir="$OPTARG" ;; r) R_SCRIPT_PATH="$OPTARG" ;; #required + l) R_LIB_PATH="$OPTARG" ;; #required [?]) echo "ERROR: Unknown parameter" print_help exit 1 ;; @@ -220,7 +222,7 @@ #Produce k2n file if [ "$k2n" == "True" ]; then - Rscript $R_SCRIPT_PATH/k2n.R merged_temp.gz $output_dir/unique_barcodes.txt $output_dir/k2n.txt + Rscript $R_SCRIPT_PATH/k2n.R $R_LIB_PATH merged_temp.gz $output_dir/unique_barcodes.txt $output_dir/k2n.txt fi #Remove temp files diff -r c139b9abe064 -r ceb96c265bd1 summarize_unique_barcodes.xml --- a/summarize_unique_barcodes.xml Wed Feb 11 07:32:32 2015 -0500 +++ b/summarize_unique_barcodes.xml Wed Feb 11 08:05:10 2015 -0500 @@ -8,7 +8,7 @@ RNAprobR RNAprobR RNA_PROBING_SCRIPT_PATH - RNAprobR_PATH + RNA_PROBING_LIB_PATH @@ -32,7 +32,9 @@ -t #end if - -r \$RNAprobR_PATH + -r \$RNA_PROBING_SCRIPT_PATH + -l \$RNA_PROBING_LIB_PATH + diff -r c139b9abe064 -r ceb96c265bd1 tool_dependencies.xml --- a/tool_dependencies.xml Wed Feb 11 07:32:32 2015 -0500 +++ b/tool_dependencies.xml Wed Feb 11 08:05:10 2015 -0500 @@ -11,6 +11,9 @@ + + $REPOSITORY_INSTALL_DIR + $REPOSITORY_INSTALL_DIR