Hello,

This is probably a quick question.  It seems to take a long time to generate monte carlo simulation data in mri_glmfit. Is it a bad idea to break the iterations into however many available seychelles nodes I can use?  Is that equivalent to running the total number of iterations serially? 

Thanks,
Rob

fpolli@nmr.mgh.harvard.edu wrote:
hi rob, see below for the answers to some of your questions.

  
Hi Dara and Frida,

The analysis is running.  There is one part of Frida's example that I
will need to emulate once this is done,  but if what I have is correct,
then the part that takes the most time will be done when I come in to
work on Thursday 7/5.

Frida,
sometime when you have a moment free, could you look over the commands
I'm running and tell me if there is anything glaringly (or subtly)
wrong?   I have tried my best to run it in a way that is consistent with
how you did it, but I think there could be things wrong, because I dont
100% understand everything about what these commands are doing, but
getting there. There's nothing in these commands that looks like
nonsense to me, but for example, I don't know if the smoothing value of
13.488420 is the same in our case.
    

to find this parameter, you want to open a file that's called
mri_glmfit_log or something like that. it is created in the third step.
however, it usually gives you a value b/w 12.5 and 14.5 and using one
vs.the other does not create a huge diffrence. however, try to find the
file i'm talking about, open it up, and you'll see.

 I'm using a threshold of .01, and I
  
don't know if that would cause any parameters other than the threshold
to need to change.
    
you should use whatever parameter you want your data displayed at. no that
doesn't change anything else.

I also don't know why simulation data is generated
  
twice and then both input into the contrast,
    
only b/c it takes a long time to generate 10K simulations, so we broke it
up into 2 x 5K. you can also use 1 x 10 k.
but I'm following that
  
aspect of your example verbatim at least for now, in the commands that
are now running.  Also a default glmfit setting is to use dods (diff
order diff slope).
    
dods is DEF. the one you want to use. it stands for different offset
different slope - you don't want to assume that both groups have the same
slope to their data.

  Is that what we should be using?  There is also a
  
doss (same slope) option.  Ally, she is one of the RAs who I talked with
yesterday about this, mentioned that dods is more unpredictable than doss.

Thanks for your help,
Rob

    
good luck, f
  
#!/usr/local/bin/bash

##################
# levy 7/3/07   #
##################

# Katy ran intergroupavg-sess on 9/20/05
# Last week we used FDR to correct for multiple comparisons on the
results of the above contrast between groups,
# but the resulting threshold was too conservative.
# So now I am running the analysis with a cluster-based threshold using
a Monte Carlo simulation
# (simulate a null hypothesis with randomnes, and use it to generate a
meaningful threshold to judge the results with)
# In terms of the freesurfer implementation, this is a different process
and does not build on the results of previous commands.

# so we start from the beginning
# note: rerunning these 2 lines probably unnecessary, but mris_preproc
was having problems I thought were due to faulty stxgrinder output
# This problem led Doug to discover bugs in mris_preproc and also
mkcontrast-sess, which he then fixed
# As a result, I re-ran the following 2 commands, which didn't take very
long anyhow.

mkcontrast-sess -analysis EMerror -contrast ASvfix_6 -a 2 -c 0
-setwdelay -sumdelays
stxgrinder-sess -a EMerror -c ASvfix_6 -sf Subject_Lists/bw-group-error-5

# resample onto average7
# ( use version from doug's home directory with bugs corrected... )

/space/greve/1/users/greve/freesurfer/bin/mris_preproc --fsgd
fsgd_and_contrast_files/BwGroupError5.fsgd --target average7 --hemi lh
--sf Subject_Lists/bw-group-error-5 --a EMerror --c ASvfix_6 --out
lh.ASvfix_8s_BwGroupError5.fsfast.mgh | tee -a
logs/mris_preproc_BwGroupError5_ASvfix_8s_lh.log
/space/greve/1/users/greve/freesurfer/bin/mris_preproc --fsgd
fsgd_and_contrast_files/BwGroupError5.fsgd --target average7 --hemi rh
--sf Subject_Lists/bw-group-error-5 --a EMerror --c ASvfix_6 --out
rh.ASvfix_8s_BwGroupError5.fsfast.mgh | tee -a
logs/mris_preproc_BwGroupError5_ASvfix_8s_rh.log


mkdir lh.ASvfix_8s_BwGroupError5.fsfast.glmdir/
mkdir rh.ASvfix_8s_BwGroupError5.fsfast.glmdir/

# lh
mri_glmfit --really-use-average7 --y
lh.ASvfix_8s_BwGroupError5.fsfast.mgh --fsgd
fsgd_and_contrast_files/BwGroupError5.fsgd --glmdir
lh.ASvfix_8s_BwGroupError5.fsfast.glmdir --surf average7 lh --C
fsgd_and_contrast_files/BwGroupError5.mat --sim mc-full 5000 2
BwGroupError5_ASvfix_8s_lhMCSIM1 --fwhm 13.488420 | tee -a
logs/glmfit_lh_MCSIM1.log
mri_glmfit --really-use-average7 --y
lh.ASvfix_8s_BwGroupError5.fsfast.mgh --fsgd
fsgd_and_contrast_files/BwGroupError5.fsgd --glmdir
lh.ASvfix_8s_BwGroupError5.fsfast.glmdir --surf average7 lh --C
fsgd_and_contrast_files/BwGroupError5.mat --sim mc-full 5000 2
BwGroupError5_ASvfix_8s_lhMCSIM2 --fwhm 13.488420 | tee -a
logs/glmfit_lh_MCSIM2.log
mri_surfcluster --src
lh.ASvfix_8s_BwGroupError5.fsfast.glmdir/BwGroupError5/sig.mgh --csd
BwGroupError5_ASvfix_8s_lhMCSIM1-BwGroupError5.csd --csd
BwGroupError5_ASvfix_8s_lhMCSIM2-BwGroupError5.csd --sum
lh.ASvfix_8s_BwGroupError5.fsfast.glmdir/BwGroupError5/sig.clusterMCSIM.sum
--ocp
lh.ASvfix_8s_BwGroupError5.fsfast.glmdir/BwGroupError5/sig.clusterMCSIM.mgh
--thmax infinity | tee -a
logs/surfcluster_lh_BwGroupError5_AsvFix_mcsim.log
# rh
mri_glmfit --really-use-average7 --y
rh.ASvfix_8s_BwGroupError5.fsfast.mgh --fsgd
fsgd_and_contrast_files/BwGroupError5.fsgd --glmdir
rh.ASvfix_8s_BwGroupError5.fsfast.glmdir --surf average7 rh --C
fsgd_and_contrast_files/BwGroupError5.mat --sim mc-full 5000 2
BwGroupError5_ASvfix_8s_rhMCSIM1 --fwhm 13.488420 | tee -a
logs/glmfit_rh_MCSIM1.log
mri_glmfit --really-use-average7 --y
rh.ASvfix_8s_BwGroupError5.fsfast.mgh --fsgd
fsgd_and_contrast_files/BwGroupError5.fsgd --glmdir
rh.ASvfix_8s_BwGroupError5.fsfast.glmdir --surf average7 rh --C
fsgd_and_contrast_files/BwGroupError5.mat --sim mc-full 5000 2
BwGroupError5_ASvfix_8s_rhMCSIM2 --fwhm 13.488420 | tee -a
logs/glmfit_rh_MCSIM2.log
mri_surfcluster --src
rh.ASvfix_8s_BwGroupError5.fsfast.glmdir/BwGroupError5/sig.mgh --csd
BwGroupError5_ASvfix_8s_rhMCSIM1-BwGroupError5.csd --csd
BwGroupError5_ASvfix_8s_rhMCSIM2-BwGroupError5.csd --sum
rh.ASvfix_8s_BwGroupError5.fsfast.glmdir/BwGroupError5/sig.clusterMCSIM.sum
--ocp
rh.ASvfix_8s_BwGroupError5.fsfast.glmdir/BwGroupError5/sig.clusterMCSIM.mgh
--thmax infinity | tee -a
logs/surfcluster_rh_BwGroupError5_AsvFix_mcsim.log

# getting the correct map to display

# ( not yet done )
#
# here is Frida's example
#
# mri_surfcluster --src
lh.ASevASc_6s_BwGroup3b.fsfast.glmdir/BwGroupError3b_NvSZ_contrast/sig.mgh
--o
lh.ASevASc_6s_BwGroup3b.fsfast.glmdir/BwGroupError3b_NvSZ_contrast/sig.clusterMCSIM_o.mgh
--hemi lh --srcsubj average7 --thmin 1.3
# mri_surfcluster --src
lh.ASevASc_6s_BwGroup3b.fsfast.glmdir/BwGroupError3b_NvSZ_contrast/sig.mgh
--csd BwGroup3b_ASevASc_6s_lh_MCSIM1-BwGroupError3b_NvSZ_contrast.csd
--csd BwGroup3b_ASevASc_6s_lh_MCSIM2-BwGroupError3b_NvSZ_contrast.csd
--thmax infinity --cwsig
lh.ASevASc_6s_BwGroup3b.fsfast.glmdir/BwGroupError3b_NvSZ_contrast/sig.clusterMCSIM_cwsig.mgh

# mri_mask -T 1.3
lh.ASevASc_6s_BwGroup3b.fsfast.glmdir/BwGroupError3b_NvSZ_contrast/sig.clusterMCSIM_o.mgh
lh.ASevASc_6s_BwGroup3b.fsfast.glmdir/BwGroupError3b_NvSZ_contrast/sig.clusterMCSIM_cwsig.mgh
lh.ASevASc_6s_BwGroup3b.fsfast.glmdir/BwGroupError3b_NvSZ_contrast/sig.clusterMCSIM_ocwsig.mgh

--

Robert P. Levy, B.A.
Research Assistant, Manoach Lab
Massachusetts General Hospital
Charlestown Navy Yard
149 13th St., Room 2656
Charlestown, MA 02129
email: levy@nmr.mgh.harvard.edu
phone: 617-726-1908
fax: 617-726-4078

http://nmr.mgh.harvard.edu/manoachlab



    


  


-- 

Robert P. Levy, B.A.
Research Assistant, Manoach Lab
Massachusetts General Hospital
Charlestown Navy Yard
149 13th St., Room 2656
Charlestown, MA 02129
email: levy@nmr.mgh.harvard.edu
phone: 617-726-1908
fax: 617-726-4078

http://nmr.mgh.harvard.edu/manoachlab