@@ -665,6 +665,7 @@ class ReconAll(CommandLine):
665
665
input_spec = ReconAllInputSpec
666
666
output_spec = ReconAllOutputSpec
667
667
_can_resume = True
668
+ force_run = False
668
669
669
670
# Steps are based off of the recon-all tables [0,1] describing, inputs,
670
671
# commands, and outputs of each step of the recon-all process,
@@ -905,20 +906,30 @@ def cmdline(self):
905
906
if not isdefined (subjects_dir ):
906
907
subjects_dir = self ._gen_subjects_dir ()
907
908
909
+ no_run = True
908
910
flags = []
909
911
for idx , step in enumerate (self ._steps ):
910
912
step , outfiles , infiles = step
911
913
flag = '-{}' .format (step )
912
914
noflag = '-no{}' .format (step )
913
- if flag in cmd or noflag in cmd :
915
+ if noflag in cmd :
916
+ continue
917
+ elif flag in cmd :
918
+ no_run = False
914
919
continue
915
920
916
921
subj_dir = os .path .join (subjects_dir , self .inputs .subject_id )
917
922
if check_depends ([os .path .join (subj_dir , f ) for f in outfiles ],
918
923
[os .path .join (subj_dir , f ) for f in infiles ]):
919
924
flags .append (noflag )
920
- cmd += ' ' + ' ' .join (flags )
925
+ else :
926
+ no_run = False
921
927
928
+ if no_run and not self .force_run :
929
+ iflogger .info ('recon-all complete : Not running' )
930
+ return "echo recon-all: nothing to do"
931
+
932
+ cmd += ' ' + ' ' .join (flags )
922
933
iflogger .info ('resume recon-all : %s' % cmd )
923
934
return cmd
924
935
0 commit comments