Run surface group analysis for different cluster/p thresholds

Broken right now, alternate just change params in the project file and then make sure to adjust the -output flag so that group name is different from original (p=0.5, cluster z = 2.3)

Load in packages


In [2]:
"""Make static images of lyman results using PySurfer."""
import os
import os.path as op
import sys
import tempfile
import argparse
from textwrap import dedent
from time import sleep

import time
import shutil
from glob import glob
import subprocess as sub

import numpy as np
from scipy import stats
import nibabel as nib
import matplotlib.image as mplimg
from mayavi import mlab
from surfer import Brain, io
import surfer as sf

from matplotlib import pyplot
import matplotlib as mpl
mpl.use("Agg")

import nipype
from nipype import Node, MapNode, SelectFiles, DataSink, IdentityInterface

import moss
import lyman
import lyman.workflows as wf
from lyman import tools

%gui qt

Set up arguments


In [44]:
class Args(object):
    def __init__(self, **kwargs):
        self.__dict__.update(kwargs)
        
args = Args(subjects='~/Experiments/ObjFam/data/subids_subset_no23or19.txt',
            experiment = 'objfam',
            level = 'group', 
            regspace = 'fsaverage',
            geometry = 'inflated',
            altmodel = 'submem',
            unsmoothed = 'unsmoothed',
            plugin = 'multiproc',
            nprocs = 8,
            queue = None,
            dontrun= None,
            output = 'group_p1_z2',
            grf_pthresh = 0.1, # 0.5
            cluster_zthresh = 2.0 # 2.3
            )

Get and process specific information from args


In [45]:
project = lyman.gather_project_info()
exp = lyman.gather_experiment_info(args.experiment, args.altmodel)

if args.altmodel:
    exp_name = "-".join([args.experiment, args.altmodel])
else:
    exp_name = args.experiment
    
os.environ["SUBJECTS_DIR"] = project["data_dir"]

# Set roots of output storage
anal_dir_base = op.join(project["analysis_dir"], exp_name)
work_dir_base = op.join(project["working_dir"], exp_name)
nipype.config.set("execution", "crashdump_dir",
                  "/tmp/%s-nipype_crashes-%d" % (os.getlogin(),
                                                 time.time()))

# Subject source (no iterables here)
subject_list = lyman.determine_subjects(args.subjects)
subj_source = Node(IdentityInterface(fields=["subject_id"]),
                   name="subj_source")
subj_source.inputs.subject_id = subject_list

Reset thresholding params based on args


In [46]:
exp['grf_pthresh'] = args.grf_pthresh
exp['cluster_zthresh'] = args.cluster_zthresh

In [65]:



Out[65]:
'2'

Set up the design


In [47]:
# Set up the regressors and contrasts
regressors = dict(group_mean=[1] * len(subject_list))
contrasts = [["group_mean", "T", ["group_mean"], [1]]]

# Subject level contrast source
contrast_source = Node(IdentityInterface(fields=["l1_contrast"]),
                       iterables=("l1_contrast", exp["contrast_names"]),
                       name="contrast_source")

Create the group workflow


In [48]:
# Group workflow
space = args.regspace
wf_name = "_".join([space, args.output])
if space == "mni":
    mfx, mfx_input, mfx_output = wf.create_volume_mixedfx_workflow(
        wf_name, subject_list, regressors, contrasts, exp)
else:
    mfx, mfx_input, mfx_output = wf.create_surface_ols_workflow(
        wf_name, subject_list, exp)
    
# Mixed effects inputs
ffxspace = "mni" if space == "mni" else "epi"
ffxsmooth = "unsmoothed" if args.unsmoothed else "smoothed"
mfx_base = op.join("{subject_id}/ffx/%s/%s/{l1_contrast}" % (ffxspace,
                                                             ffxsmooth))
templates = dict(copes=op.join(mfx_base, "cope1.nii.gz"))
if space == "mni":
    templates.update(dict(
        varcopes=op.join(mfx_base, "varcope1.nii.gz"),
        dofs=op.join(mfx_base, "tdof_t1.nii.gz")))
else:
    templates.update(dict(
        reg_file=op.join(anal_dir_base, "{subject_id}/preproc/run_1",
                         "func2anat_tkreg.dat")))

# Workflow source node
mfx_source = MapNode(SelectFiles(templates,
                                 base_directory=anal_dir_base,
                                 sort_filelist=True),
                     "subject_id",
                     "mfx_source")

# Workflow input connections
mfx.connect([
    (contrast_source, mfx_source,
        [("l1_contrast", "l1_contrast")]),
    (contrast_source, mfx_input,
        [("l1_contrast", "l1_contrast")]),
    (subj_source, mfx_source,
        [("subject_id", "subject_id")]),
    (mfx_source, mfx_input,
        [("copes", "copes")])
             ]),
if space == "mni":
    mfx.connect([
        (mfx_source, mfx_input,
            [("varcopes", "varcopes"),
             ("dofs", "dofs")]),
                 ])
else:
    mfx.connect([
        (mfx_source, mfx_input,
            [("reg_file", "reg_file")]),
        (subj_source, mfx_input,
            [("subject_id", "subject_id")])
                 ])

# Mixed effects outputs
mfx_sink = Node(DataSink(base_directory="/".join([anal_dir_base,
                                                  args.output,
                                                  space]),
                         substitutions=[("/stats", "/"),
                                        ("/_hemi_", "/"),
                                        ("_glm_results", "")],
                         parameterization=True),
                name="mfx_sink")

mfx_outwrap = tools.OutputWrapper(mfx, subj_source,
                                  mfx_sink, mfx_output)
mfx_outwrap.sink_outputs()
mfx_outwrap.set_mapnode_substitutions(1)
mfx_outwrap.add_regexp_substitutions([
    (r"_l1_contrast_[-\w]*/", "/"),
    (r"_mni_hemi_[lr]h", "")
    ])
mfx.connect(contrast_source, "l1_contrast",
            mfx_sink, "container")

# Set a few last things
mfx.base_dir = work_dir_base


/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/interfaces/base.py:376: UserWarning: Input sampling_method requires inputs: sampling_range, sampling_units
  warn(msg)
/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/interfaces/base.py:376: UserWarning: Input surf requires inputs: subject_id, hemi
  warn(msg)

In [ ]:


In [49]:
# Execute
lyman.run_workflow(mfx, args=args)

# Clean up
if project["rm_working_dir"]:
    shutil.rmtree(project["working_dir"])


INFO:workflow:['check', 'execution', 'logging']
INFO:workflow:Running in parallel.
INFO:workflow:Submitting 19 jobs
INFO:workflow:Executing: mfx_source.a18 ID: 0
INFO:workflow:Executing: mfx_source.a03 ID: 11
INFO:workflow:Executing: mfx_source.a02 ID: 22
INFO:workflow:Executing: mfx_source.a11 ID: 33
INFO:workflow:Executing: mfx_source.a12 ID: 44
INFO:workflow:Executing: mfx_source.a08 ID: 55
INFO:workflow:Executing: mfx_source.a05 ID: 66
INFO:workflow:Executing: mfx_source.a16 ID: 77
INFO:workflow:Executing: mfx_source.a13 ID: 88
INFO:workflow:Executing: mfx_source.a06 ID: 99
INFO:workflow:Executing: mfx_source.a17 ID: 110
INFO:workflow:Executing: mfx_source.a04 ID: 121
INFO:workflow:Executing: mfx_source.a00 ID: 132
INFO:workflow:Executing node mfx_source.a02 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_1_new/mfx_source
INFO:workflow:Executing node mfx_source.a11 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_hit-fa/mfx_source
INFO:workflow:Executing node mfx_source.a12 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_2_fa-cr/mfx_source
INFO:workflow:Executing node mfx_source.a05 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_3_old/mfx_source
INFO:workflow:Executing node mfx_source.a08 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_hit-miss/mfx_source
INFO:workflow:Executing node mfx_source.a16 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_cr-hit/mfx_source
INFO:workflow:Executing node mfx_source.a03 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_2_old/mfx_source
INFO:workflow:Executing node mfx_source.a18 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_fa-hitANDcr/mfx_source
INFO:workflow:Executing: mfx_source.a15 ID: 143
INFO:workflow:Executing: mfx_source.a14 ID: 154
INFO:workflow:Executing: mfx_source.a07 ID: 165
INFO:workflow:Executing node _mfx_source0 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_3_old/mfx_source/mapflow/_mfx_source0
INFO:workflow:Executing node _mfx_source0 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_hit-miss/mfx_source/mapflow/_mfx_source0
INFO:workflow:Executing node _mfx_source0 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_1_new/mfx_source/mapflow/_mfx_source0
INFO:workflow:Executing node _mfx_source0 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_cr-hit/mfx_source/mapflow/_mfx_source0
INFO:workflow:Executing node _mfx_source0 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_hit-fa/mfx_source/mapflow/_mfx_source0
INFO:workflow:Executing node _mfx_source0 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_2_old/mfx_source/mapflow/_mfx_source0
INFO:workflow:Executing node _mfx_source0 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_2_fa-cr/mfx_source/mapflow/_mfx_source0
INFO:workflow:Executing node _mfx_source0 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_fa-hitANDcr/mfx_source/mapflow/_mfx_source0
INFO:workflow:Executing: mfx_source.a09 ID: 176
INFO:workflow:Executing: mfx_source.a01 ID: 187
INFO:workflow:Executing: mfx_source.a10 ID: 198
ERROR:workflow:['Node mfx_source.a18 failed to run on host sgagnon-desktop.stanford.edu.']
INFO:workflow:Executing node mfx_source.a13 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_3_fa-cr/mfx_source
INFO:workflow:Executing node mfx_source.a06 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_3_new/mfx_source
INFO:workflow:Executing node mfx_source.a17 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_hitANDcr-fa/mfx_source
INFO:workflow:Executing node mfx_source.a04 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_2_new/mfx_source
INFO:workflow:Executing node mfx_source.a15 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_cr-3_fa/mfx_source
INFO:workflow:Executing node mfx_source.a00 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_Test/mfx_source
INFO:workflow:Executing node mfx_source.a14 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_cr-2_fa/mfx_source
INFO:workflow:Executing node mfx_source.a07 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_test-study/mfx_source
INFO:workflow:Executing node _mfx_source0 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_3_fa-cr/mfx_source/mapflow/_mfx_source0
INFO:workflow:Executing node _mfx_source0 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_3_new/mfx_source/mapflow/_mfx_source0
INFO:workflow:Executing node _mfx_source0 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_hitANDcr-fa/mfx_source/mapflow/_mfx_source0
INFO:workflow:Executing node _mfx_source0 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_2_new/mfx_source/mapflow/_mfx_source0
INFO:workflow:Executing node _mfx_source0 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_cr-3_fa/mfx_source/mapflow/_mfx_source0
INFO:workflow:Executing node _mfx_source0 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_Test/mfx_source/mapflow/_mfx_source0
INFO:workflow:Executing node _mfx_source0 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_cr-2_fa/mfx_source/mapflow/_mfx_source0
INFO:workflow:Executing node _mfx_source0 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_test-study/mfx_source/mapflow/_mfx_source0
INFO:workflow:Executing node mfx_source.a10 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_cr-fa/mfx_source
INFO:workflow:Executing node mfx_source.a09 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_fa-cr/mfx_source
INFO:workflow:Executing node mfx_source.a01 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_1_old/mfx_source
INFO:workflow:Executing node _mfx_source0 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_cr-fa/mfx_source/mapflow/_mfx_source0
INFO:workflow:Executing node _mfx_source0 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_fa-cr/mfx_source/mapflow/_mfx_source0
INFO:workflow:Executing node _mfx_source0 in dir: /Users/steph-backup/Experiments/ObjFam/working_dir/objfam-submem/fsaverage_group_p1_z2/_l1_contrast_1_old/mfx_source/mapflow/_mfx_source0
INFO:workflow:Saving crash info to /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a18.npz
INFO:workflow:Traceback (most recent call last):
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 18, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 1386, in run
    self._run_interface()
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2252, in _run_interface
    updatehash=updatehash))
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2167, in _collate_results
    (self.name, '\n'.join(msg)))
Exception: Subnodes of node: mfx_source failed:
Subnode 0 failed
Error:
No files were found matching reg_file template: /Users/steph-backup/Experiments/ObjFam/scripts/analysis/objfam-submem/{subject_id}/preproc/run_1/func2anat_tkreg.dat
Interface SelectFiles failed to run. 

ERROR:workflow:['Node mfx_source.a03 failed to run on host sgagnon-desktop.stanford.edu.']
INFO:workflow:Saving crash info to /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a03.npz
INFO:workflow:Traceback (most recent call last):
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 18, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 1386, in run
    self._run_interface()
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2252, in _run_interface
    updatehash=updatehash))
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2167, in _collate_results
    (self.name, '\n'.join(msg)))
Exception: Subnodes of node: mfx_source failed:
Subnode 0 failed
Error:
No files were found matching reg_file template: /Users/steph-backup/Experiments/ObjFam/scripts/analysis/objfam-submem/{subject_id}/preproc/run_1/func2anat_tkreg.dat
Interface SelectFiles failed to run. 

ERROR:workflow:['Node mfx_source.a02 failed to run on host sgagnon-desktop.stanford.edu.']
INFO:workflow:Saving crash info to /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a02.npz
INFO:workflow:Traceback (most recent call last):
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 18, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 1386, in run
    self._run_interface()
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2252, in _run_interface
    updatehash=updatehash))
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2167, in _collate_results
    (self.name, '\n'.join(msg)))
Exception: Subnodes of node: mfx_source failed:
Subnode 0 failed
Error:
No files were found matching reg_file template: /Users/steph-backup/Experiments/ObjFam/scripts/analysis/objfam-submem/{subject_id}/preproc/run_1/func2anat_tkreg.dat
Interface SelectFiles failed to run. 

ERROR:workflow:['Node mfx_source.a11 failed to run on host sgagnon-desktop.stanford.edu.']
INFO:workflow:Saving crash info to /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a11.npz
INFO:workflow:Traceback (most recent call last):
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 18, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 1386, in run
    self._run_interface()
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2252, in _run_interface
    updatehash=updatehash))
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2167, in _collate_results
    (self.name, '\n'.join(msg)))
Exception: Subnodes of node: mfx_source failed:
Subnode 0 failed
Error:
No files were found matching reg_file template: /Users/steph-backup/Experiments/ObjFam/scripts/analysis/objfam-submem/{subject_id}/preproc/run_1/func2anat_tkreg.dat
Interface SelectFiles failed to run. 

ERROR:workflow:['Node mfx_source.a12 failed to run on host sgagnon-desktop.stanford.edu.']
INFO:workflow:Saving crash info to /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a12.npz
INFO:workflow:Traceback (most recent call last):
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 18, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 1386, in run
    self._run_interface()
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2252, in _run_interface
    updatehash=updatehash))
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2167, in _collate_results
    (self.name, '\n'.join(msg)))
Exception: Subnodes of node: mfx_source failed:
Subnode 0 failed
Error:
No files were found matching reg_file template: /Users/steph-backup/Experiments/ObjFam/scripts/analysis/objfam-submem/{subject_id}/preproc/run_1/func2anat_tkreg.dat
Interface SelectFiles failed to run. 

ERROR:workflow:['Node mfx_source.a08 failed to run on host sgagnon-desktop.stanford.edu.']
INFO:workflow:Saving crash info to /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a08.npz
INFO:workflow:Traceback (most recent call last):
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 18, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 1386, in run
    self._run_interface()
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2252, in _run_interface
    updatehash=updatehash))
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2167, in _collate_results
    (self.name, '\n'.join(msg)))
Exception: Subnodes of node: mfx_source failed:
Subnode 0 failed
Error:
No files were found matching reg_file template: /Users/steph-backup/Experiments/ObjFam/scripts/analysis/objfam-submem/{subject_id}/preproc/run_1/func2anat_tkreg.dat
Interface SelectFiles failed to run. 

ERROR:workflow:['Node mfx_source.a05 failed to run on host sgagnon-desktop.stanford.edu.']
INFO:workflow:Saving crash info to /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a05.npz
INFO:workflow:Traceback (most recent call last):
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 18, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 1386, in run
    self._run_interface()
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2252, in _run_interface
    updatehash=updatehash))
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2167, in _collate_results
    (self.name, '\n'.join(msg)))
Exception: Subnodes of node: mfx_source failed:
Subnode 0 failed
Error:
No files were found matching reg_file template: /Users/steph-backup/Experiments/ObjFam/scripts/analysis/objfam-submem/{subject_id}/preproc/run_1/func2anat_tkreg.dat
Interface SelectFiles failed to run. 

ERROR:workflow:['Node mfx_source.a16 failed to run on host sgagnon-desktop.stanford.edu.']
INFO:workflow:Saving crash info to /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a16.npz
INFO:workflow:Traceback (most recent call last):
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 18, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 1386, in run
    self._run_interface()
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2252, in _run_interface
    updatehash=updatehash))
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2167, in _collate_results
    (self.name, '\n'.join(msg)))
Exception: Subnodes of node: mfx_source failed:
Subnode 0 failed
Error:
No files were found matching reg_file template: /Users/steph-backup/Experiments/ObjFam/scripts/analysis/objfam-submem/{subject_id}/preproc/run_1/func2anat_tkreg.dat
Interface SelectFiles failed to run. 

ERROR:workflow:['Node mfx_source.a13 failed to run on host sgagnon-desktop.stanford.edu.']
INFO:workflow:Saving crash info to /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a13.npz
INFO:workflow:Traceback (most recent call last):
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 18, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 1386, in run
    self._run_interface()
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2252, in _run_interface
    updatehash=updatehash))
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2167, in _collate_results
    (self.name, '\n'.join(msg)))
Exception: Subnodes of node: mfx_source failed:
Subnode 0 failed
Error:
No files were found matching reg_file template: /Users/steph-backup/Experiments/ObjFam/scripts/analysis/objfam-submem/{subject_id}/preproc/run_1/func2anat_tkreg.dat
Interface SelectFiles failed to run. 

ERROR:workflow:['Node mfx_source.a06 failed to run on host sgagnon-desktop.stanford.edu.']
INFO:workflow:Saving crash info to /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a06.npz
INFO:workflow:Traceback (most recent call last):
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 18, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 1386, in run
    self._run_interface()
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2252, in _run_interface
    updatehash=updatehash))
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2167, in _collate_results
    (self.name, '\n'.join(msg)))
Exception: Subnodes of node: mfx_source failed:
Subnode 0 failed
Error:
No files were found matching reg_file template: /Users/steph-backup/Experiments/ObjFam/scripts/analysis/objfam-submem/{subject_id}/preproc/run_1/func2anat_tkreg.dat
Interface SelectFiles failed to run. 

ERROR:workflow:['Node mfx_source.a17 failed to run on host sgagnon-desktop.stanford.edu.']
INFO:workflow:Saving crash info to /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a17.npz
INFO:workflow:Traceback (most recent call last):
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 18, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 1386, in run
    self._run_interface()
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2252, in _run_interface
    updatehash=updatehash))
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2167, in _collate_results
    (self.name, '\n'.join(msg)))
Exception: Subnodes of node: mfx_source failed:
Subnode 0 failed
Error:
No files were found matching reg_file template: /Users/steph-backup/Experiments/ObjFam/scripts/analysis/objfam-submem/{subject_id}/preproc/run_1/func2anat_tkreg.dat
Interface SelectFiles failed to run. 

ERROR:workflow:['Node mfx_source.a04 failed to run on host sgagnon-desktop.stanford.edu.']
INFO:workflow:Saving crash info to /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a04.npz
INFO:workflow:Traceback (most recent call last):
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 18, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 1386, in run
    self._run_interface()
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2252, in _run_interface
    updatehash=updatehash))
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2167, in _collate_results
    (self.name, '\n'.join(msg)))
Exception: Subnodes of node: mfx_source failed:
Subnode 0 failed
Error:
No files were found matching reg_file template: /Users/steph-backup/Experiments/ObjFam/scripts/analysis/objfam-submem/{subject_id}/preproc/run_1/func2anat_tkreg.dat
Interface SelectFiles failed to run. 

ERROR:workflow:['Node mfx_source.a00 failed to run on host sgagnon-desktop.stanford.edu.']
INFO:workflow:Saving crash info to /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a00.npz
INFO:workflow:Traceback (most recent call last):
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 18, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 1386, in run
    self._run_interface()
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2252, in _run_interface
    updatehash=updatehash))
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2167, in _collate_results
    (self.name, '\n'.join(msg)))
Exception: Subnodes of node: mfx_source failed:
Subnode 0 failed
Error:
No files were found matching reg_file template: /Users/steph-backup/Experiments/ObjFam/scripts/analysis/objfam-submem/{subject_id}/preproc/run_1/func2anat_tkreg.dat
Interface SelectFiles failed to run. 

ERROR:workflow:['Node mfx_source.a15 failed to run on host sgagnon-desktop.stanford.edu.']
INFO:workflow:Saving crash info to /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a15.npz
INFO:workflow:Traceback (most recent call last):
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 18, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 1386, in run
    self._run_interface()
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2252, in _run_interface
    updatehash=updatehash))
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2167, in _collate_results
    (self.name, '\n'.join(msg)))
Exception: Subnodes of node: mfx_source failed:
Subnode 0 failed
Error:
No files were found matching reg_file template: /Users/steph-backup/Experiments/ObjFam/scripts/analysis/objfam-submem/{subject_id}/preproc/run_1/func2anat_tkreg.dat
Interface SelectFiles failed to run. 

ERROR:workflow:['Node mfx_source.a14 failed to run on host sgagnon-desktop.stanford.edu.']
INFO:workflow:Saving crash info to /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a14.npz
INFO:workflow:Traceback (most recent call last):
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 18, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 1386, in run
    self._run_interface()
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2252, in _run_interface
    updatehash=updatehash))
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2167, in _collate_results
    (self.name, '\n'.join(msg)))
Exception: Subnodes of node: mfx_source failed:
Subnode 0 failed
Error:
No files were found matching reg_file template: /Users/steph-backup/Experiments/ObjFam/scripts/analysis/objfam-submem/{subject_id}/preproc/run_1/func2anat_tkreg.dat
Interface SelectFiles failed to run. 

ERROR:workflow:['Node mfx_source.a07 failed to run on host sgagnon-desktop.stanford.edu.']
INFO:workflow:Saving crash info to /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a07.npz
INFO:workflow:Traceback (most recent call last):
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 18, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 1386, in run
    self._run_interface()
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2252, in _run_interface
    updatehash=updatehash))
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2167, in _collate_results
    (self.name, '\n'.join(msg)))
Exception: Subnodes of node: mfx_source failed:
Subnode 0 failed
Error:
No files were found matching reg_file template: /Users/steph-backup/Experiments/ObjFam/scripts/analysis/objfam-submem/{subject_id}/preproc/run_1/func2anat_tkreg.dat
Interface SelectFiles failed to run. 

ERROR:workflow:['Node mfx_source.a09 failed to run on host sgagnon-desktop.stanford.edu.']
INFO:workflow:Saving crash info to /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a09.npz
INFO:workflow:Traceback (most recent call last):
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 18, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 1386, in run
    self._run_interface()
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2252, in _run_interface
    updatehash=updatehash))
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2167, in _collate_results
    (self.name, '\n'.join(msg)))
Exception: Subnodes of node: mfx_source failed:
Subnode 0 failed
Error:
No files were found matching reg_file template: /Users/steph-backup/Experiments/ObjFam/scripts/analysis/objfam-submem/{subject_id}/preproc/run_1/func2anat_tkreg.dat
Interface SelectFiles failed to run. 

ERROR:workflow:['Node mfx_source.a01 failed to run on host sgagnon-desktop.stanford.edu.']
INFO:workflow:Saving crash info to /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a01.npz
INFO:workflow:Traceback (most recent call last):
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 18, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 1386, in run
    self._run_interface()
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2252, in _run_interface
    updatehash=updatehash))
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2167, in _collate_results
    (self.name, '\n'.join(msg)))
Exception: Subnodes of node: mfx_source failed:
Subnode 0 failed
Error:
No files were found matching reg_file template: /Users/steph-backup/Experiments/ObjFam/scripts/analysis/objfam-submem/{subject_id}/preproc/run_1/func2anat_tkreg.dat
Interface SelectFiles failed to run. 

ERROR:workflow:['Node mfx_source.a10 failed to run on host sgagnon-desktop.stanford.edu.']
INFO:workflow:Saving crash info to /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a10.npz
INFO:workflow:Traceback (most recent call last):
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 18, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 1386, in run
    self._run_interface()
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2252, in _run_interface
    updatehash=updatehash))
  File "/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.py", line 2167, in _collate_results
    (self.name, '\n'.join(msg)))
Exception: Subnodes of node: mfx_source failed:
Subnode 0 failed
Error:
No files were found matching reg_file template: /Users/steph-backup/Experiments/ObjFam/scripts/analysis/objfam-submem/{subject_id}/preproc/run_1/func2anat_tkreg.dat
Interface SelectFiles failed to run. 

INFO:workflow:***********************************
ERROR:workflow:could not run node: fsaverage_group_p1_z2.mfx_source.a18
INFO:workflow:crashfile: /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a18.npz
ERROR:workflow:could not run node: fsaverage_group_p1_z2.mfx_source.a03
INFO:workflow:crashfile: /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a03.npz
ERROR:workflow:could not run node: fsaverage_group_p1_z2.mfx_source.a02
INFO:workflow:crashfile: /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a02.npz
ERROR:workflow:could not run node: fsaverage_group_p1_z2.mfx_source.a11
INFO:workflow:crashfile: /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a11.npz
ERROR:workflow:could not run node: fsaverage_group_p1_z2.mfx_source.a12
INFO:workflow:crashfile: /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a12.npz
ERROR:workflow:could not run node: fsaverage_group_p1_z2.mfx_source.a08
INFO:workflow:crashfile: /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a08.npz
ERROR:workflow:could not run node: fsaverage_group_p1_z2.mfx_source.a05
INFO:workflow:crashfile: /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a05.npz
ERROR:workflow:could not run node: fsaverage_group_p1_z2.mfx_source.a16
INFO:workflow:crashfile: /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a16.npz
ERROR:workflow:could not run node: fsaverage_group_p1_z2.mfx_source.a13
INFO:workflow:crashfile: /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a13.npz
ERROR:workflow:could not run node: fsaverage_group_p1_z2.mfx_source.a06
INFO:workflow:crashfile: /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a06.npz
ERROR:workflow:could not run node: fsaverage_group_p1_z2.mfx_source.a17
INFO:workflow:crashfile: /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a17.npz
ERROR:workflow:could not run node: fsaverage_group_p1_z2.mfx_source.a04
INFO:workflow:crashfile: /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a04.npz
ERROR:workflow:could not run node: fsaverage_group_p1_z2.mfx_source.a00
INFO:workflow:crashfile: /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a00.npz
ERROR:workflow:could not run node: fsaverage_group_p1_z2.mfx_source.a15
INFO:workflow:crashfile: /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a15.npz
ERROR:workflow:could not run node: fsaverage_group_p1_z2.mfx_source.a14
INFO:workflow:crashfile: /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a14.npz
ERROR:workflow:could not run node: fsaverage_group_p1_z2.mfx_source.a07
INFO:workflow:crashfile: /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a07.npz
ERROR:workflow:could not run node: fsaverage_group_p1_z2.mfx_source.a09
INFO:workflow:crashfile: /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a09.npz
ERROR:workflow:could not run node: fsaverage_group_p1_z2.mfx_source.a01
INFO:workflow:crashfile: /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a01.npz
ERROR:workflow:could not run node: fsaverage_group_p1_z2.mfx_source.a10
INFO:workflow:crashfile: /tmp/steph-backup-nipype_crashes-1418412130/crash-20141212-112215-steph-backup-mfx_source.a10.npz
INFO:workflow:***********************************
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-49-ac5db629c675> in <module>()
      1 # Execute
----> 2 lyman.run_workflow(mfx, args=args)
      3 
      4 # Clean up
      5 if project["rm_working_dir"]:

/Users/steph-backup/anaconda/lib/python2.7/site-packages/lyman-0.0.4.dev-py2.7.egg/lyman/frontend.pyc in run_workflow(wf, name, args)
    180     plugin, plugin_args = determine_engine(args)
    181     if (name is None or name in args.workflows) and not args.dontrun:
--> 182         wf.run(plugin, plugin_args)

/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine.pyc in run(self, plugin, plugin_args, updatehash)
    687         if str2bool(self.config['execution']['create_report']):
    688             self._write_report_info(self.base_dir, self.name, execgraph)
--> 689         runner.run(execgraph, updatehash=updatehash, config=self.config)
    690         datestr = datetime.utcnow().strftime('%Y%m%dT%H%M%S')
    691         if str2bool(self.config['execution']['write_provenance']):

/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/plugins/base.pyc in run(self, graph, config, updatehash)
    260             sleep(2)
    261         self._remove_node_dirs()
--> 262         report_nodes_not_run(notrun)
    263 
    264     def _get_result(self, taskid):

/Users/steph-backup/anaconda/lib/python2.7/site-packages/nipype/pipeline/plugins/base.pyc in report_nodes_not_run(notrun)
     88                 logger.debug(subnode._id)
     89         logger.info("***********************************")
---> 90         raise RuntimeError(('Workflow did not execute cleanly. '
     91                             'Check log for details'))
     92 

RuntimeError: Workflow did not execute cleanly. Check log for details

In [ ]: