@@ -201,6 +201,16 @@ def main(program):
201
201
def_parser .add_argument ('--start' , default = None , help = 'First index in range' , type = int , required = True )
202
202
def_parser .add_argument ('--stop' , default = None , help = 'Last index in range. Must be larger than start' , type = int , required = True )
203
203
204
+ # PARSER : ADD
205
+ a_parser = subparsers .add_parser ('add' , help = 'Define the range by first index' , parents = [parent_parser ])
206
+ a_parser .add_argument ('--add' , default = None , help = 'Length of extract' , type = int , required = True )
207
+ a_parser .add_argument ('--start' , default = None , help = 'First index in range' , type = int , required = True )
208
+
209
+ # PARSER : SUBTRACT
210
+ s_parser = subparsers .add_parser ('subtract' , help = 'Define the range by last index' , parents = [parent_parser ])
211
+ s_parser .add_argument ('--stop' , default = None , help = 'Last index in range' , type = int , required = True )
212
+ s_parser .add_argument ('--sub' , default = None , help = 'Length of extract' , type = int , required = True )
213
+
204
214
args = parent_parser .parse_args ()
205
215
206
216
# CHECK FOR VALID INPUT
@@ -215,6 +225,14 @@ def main(program):
215
225
start = args .start
216
226
stop = args .stop
217
227
228
+ if program == 'add' :
229
+ start = args .start
230
+ stop = start + args .add
231
+
232
+ if program == 'subtract' :
233
+ stop = args .stop
234
+ start = stop - args .sub
235
+
218
236
extract_range (args , start , stop , outdir )
219
237
220
238
0 commit comments