def run_group_analysis(rest_session_list, anat_session_list, seed_list, c): wfname = 'resting_preproc' + '_group_analysis' workflow = pe.Workflow(name=wfname) workflow.base_dir = c.workingDirectory workflow.crash_dir = c.crashLogDirectory workflow.config['execution'] = {'hash_method': 'timestamp'} """ FSL Group Analysis """ if c.derivatives[6]: """ grab the Group Analysis Data """ modelist, dervlist, labelist, template_dict, template_args = getGroupAnalysisInputs(c) gp_flow = create_gp_dataflow(c.sinkDirectory, modelist, dervlist, labelist, template_dict, template_args, 'gpflow') gppreproc = get_workflow('group_analysis', c) workflow.connect(gp_flow, 'gpflow.mat', gppreproc, 'inputspec.mat_file') workflow.connect(gp_flow, 'gpflow.con', gppreproc, 'inputspec.con_file') workflow.connect(gp_flow, 'gpflow.fts', gppreproc, 'inputspec.fts_file') workflow.connect(gp_flow, 'gpflow.grp', gppreproc, 'inputspec.grp_file') workflow.connect(gp_flow, 'gpflow.derv', gppreproc, 'inputspec.zmap_files') gp_datasink = create_gp_datasink(c.sinkDirectory) workflow.connect(gp_flow, 'inputnode.label', gp_datasink, 'container') group_analysis_sink(workflow, gp_datasink, gppreproc)
gppreproc = get_workflow('group_analysis', c) workflow.connect(gp_flow, 'gpflow.mat', gppreproc, 'inputspec.mat_file') workflow.connect(gp_flow, 'gpflow.con', gppreproc, 'inputspec.con_file') workflow.connect(gp_flow, 'gpflow.fts', gppreproc, 'inputspec.fts_file') workflow.connect(gp_flow, 'gpflow.grp', gppreproc, 'inputspec.grp_file') workflow.connect(gp_flow, 'gpflow.derv', gppreproc, 'inputspec.zmap_files') gp_datasink = create_gp_datasink(c.sinkDirectory) workflow.connect(gp_flow, 'inputnode.label', gp_datasink, 'container') group_analysis_sink(workflow, gp_datasink, gppreproc) if(not c.runOnGrid): workflow.run(plugin='MultiProc', plugin_args={'n_procs': c.numCoresPerSubject}) else: template_str = """ #!/bin/bash #$ -S /bin/bash #$ -V """ workflow.run(plugin='SGE', plugin_args=dict(qsub_args=c.qsubArgs, template=template_str))