@@ -665,6 +665,7 @@ class ReconAll(CommandLine):
665665 input_spec = ReconAllInputSpec
666666 output_spec = ReconAllOutputSpec
667667 _can_resume = True
668+ force_run = False
668669
669670 # Steps are based off of the recon-all tables [0,1] describing, inputs,
670671 # commands, and outputs of each step of the recon-all process,
@@ -905,20 +906,30 @@ def cmdline(self):
905906 if not isdefined (subjects_dir ):
906907 subjects_dir = self ._gen_subjects_dir ()
907908
909+ no_run = True
908910 flags = []
909911 for idx , step in enumerate (self ._steps ):
910912 step , outfiles , infiles = step
911913 flag = '-{}' .format (step )
912914 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
914919 continue
915920
916921 subj_dir = os .path .join (subjects_dir , self .inputs .subject_id )
917922 if check_depends ([os .path .join (subj_dir , f ) for f in outfiles ],
918923 [os .path .join (subj_dir , f ) for f in infiles ]):
919924 flags .append (noflag )
920- cmd += ' ' + ' ' .join (flags )
925+ else :
926+ no_run = False
921927
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 )
922933 iflogger .info ('resume recon-all : %s' % cmd )
923934 return cmd
924935
0 commit comments