*asSystemCall.R added
*previous code that calls .system had to account for the case of when
getOption("systemCallMode") is TRUE. Since exception is now being
thrown, this logic was removed from gsnap() function
*LungCancerLines no longer mentioned in NAMESPACE
git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/gmapR@69338 bc3139a8-67e5-0310-9ffc-ced21a209358
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,11 @@ |
1 |
+##written to get the string of the system call rather than having the |
|
2 |
+##system call actually executed. Initial motivation was for unit |
|
3 |
+##testing. |
|
4 |
+asSystemCall <- function(x) { |
|
5 |
+ expr <- substitute(x) |
|
6 |
+ options(systemCallMode = TRUE) |
|
7 |
+ on.exit(options(systemCallMode = FALSE)) |
|
8 |
+ error <- tryCatch(eval(expr, parent.frame()), |
|
9 |
+ error = function(e) return(e)) |
|
10 |
+ error$systemCall |
|
11 |
+} |