Browse code

fix gsnap for when unique_only is TRUE

git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/gmapR@78522 bc3139a8-67e5-0310-9ffc-ced21a209358

Michael Lawrence authored on 15/07/2013 23:39:06
Showing 1 changed files

... ...
@@ -21,7 +21,7 @@ setMethod("gsnap", c("character", "characterORNULL", "GsnapParam"),
21 21
             params <- initialize(params, ...)
22 22
             params_list <- as.list(params)
23 23
             if (gsnap_split_output(params)) {
24
-              params_list$split_output <- output
24
+              params_list$split_output <- basename(output)
25 25
               output_path <- output_dir
26 26
             } else {
27 27
               output_path <- paste0(output, ".sam")
... ...
@@ -124,8 +124,10 @@ setMethod("gsnap", c("character", "characterORNULL", "GsnapParam"),
124 124
 }
125 125
 
126 126
 .system_gsnap <- function(command) {
127
-  command <- paste(command, "2>&1")
128
-  output <- .system(command, intern = TRUE)
127
+  stderr <- tempfile("gsnap-stderr", fileext = "log")
128
+  command <- paste(command, "2>", stderr)
129
+  .system(command)
130
+  output <- readLines(stderr)
129 131
   if (!gsnapSucceeded(command, output))
130 132
     stop("Execution of gsnap failed, command-line: '", command,
131 133
          "'; last output line: '", tail(output, 1), "'")