@@ -29,6 +29,29 @@ class WhiteStripe(BaseInterface):
29
29
output_spec = WhiteStripeOutputSpec
30
30
31
31
def _run_interface (self , runtime ):
32
+ tmpfile , script = self ._cmdline (runtime )
33
+
34
+ # rfile = True will create a .R file with your script and executed.
35
+ # Alternatively
36
+ # rfile can be set to False which will cause the R code to be
37
+ # passed
38
+ # as a commandline argument to the R executable
39
+ # (without creating any files).
40
+ # This, however, is less reliable and harder to debug
41
+ # (code will be reduced to
42
+ # a single line and stripped of any comments).
43
+ rcmd = RCommand (script = script , rfile = False )
44
+ result = rcmd .run ()
45
+ if tmpfile :
46
+ os .remove (tmpfile )
47
+ return result .runtime
48
+
49
+ def _list_outputs (self ):
50
+ outputs = self ._outputs ().get ()
51
+ outputs ["out_file" ] = os .path .abspath (self .inputs .out_file )
52
+ return outputs
53
+
54
+ def _cmdline (self , runtime ):
32
55
d = dict (
33
56
in_file = self .inputs .in_file ,
34
57
out_file = self .inputs .out_file ,
@@ -65,25 +88,7 @@ def _run_interface(self, runtime):
65
88
"""
66
89
).substitute (d )
67
90
68
- # rfile = True will create a .R file with your script and executed.
69
- # Alternatively
70
- # rfile can be set to False which will cause the R code to be
71
- # passed
72
- # as a commandline argument to the R executable
73
- # (without creating any files).
74
- # This, however, is less reliable and harder to debug
75
- # (code will be reduced to
76
- # a single line and stripped of any comments).
77
- rcmd = RCommand (script = script , rfile = False )
78
- result = rcmd .run ()
79
- if tmpfile :
80
- os .remove (tmpfile )
81
- return result .runtime
82
-
83
- def _list_outputs (self ):
84
- outputs = self ._outputs ().get ()
85
- outputs ["out_file" ] = os .path .abspath (self .inputs .out_file )
86
- return outputs
91
+ return tmpfile , script
87
92
88
93
def gen_indices (self ):
89
94
path = tempfile .mkstemp ()[1 ]
0 commit comments