User Tools

Site Tools


neuroimagen:bioface_sbm

This is an old revision of the document!


Analisis SBM con Freesurfer (a.k.a. FSGA) para BIOFACE

Haciendo los archivos

Para construir los archivos .fsgd a partir de la base de datos han de hacerse una serie de pasos. Voy a poner el ejemplo con la variable RLPP. Para cualquier otra variable simplemente se cambia.

[osotolongo@brick03 fsga2]$ sed 's/;/,/g' ../bioface_mri.csv > bioface_join.csv
[osotolongo@brick03 fsga2]$ awk -F"," '{print $3","$5","$6","$7","$21}' ../bioface_np.csv > bioface_rlpp.csv
[osotolongo@brick03 fsga2]$ sed -i 's/Subjecte/PSubject/g' bioface_rlpp.csv
[osotolongo@brick03 fsga2]$ join -t"," -1 2 -2 1 bioface_join.csv bioface_rlpp.csv > bioface_data_rlpp.csv
[osotolongo@brick03 fsga2]$ awk -F"," '{print "bioface_"$2","$3","$4","$5","$6}' bioface_data_rlpp.csv | sed 's/bioface_Subject/Variables/;s/Edad/Age/;s/Sexo/Gender/;s/Años_Estudios/Education/' | sed 's/bioface_\([^,]*\),/Input bioface_\1 Main /; s/,/ /g' > rlpp_body.csv
[osotolongo@brick03 fsga2]$ head rlpp_body.csv
Variables Age Gender Education RLPP
Input bioface_0001 Main 64 1 11 2
Input bioface_0002 Main 53 2 9 10
Input bioface_0003 Main 60 2 8 3
Input bioface_0004 Main 64 2 7 3
Input bioface_0005 Main 62 2 16 7
Input bioface_0006 Main 64 2 5 7
Input bioface_0007 Main 62 2 11 5
Input bioface_0008 Main 58 2 11 8
Input bioface_0009 Main 51 2 11 7
[osotolongo@brick03 fsga2]$ cat headers_rlpp.txt
GroupDescriptorFile 1
Title BIOFACE_rlpp
Class Main
[osotolongo@brick03 fsga2]$ cat headers_rlpp.txt rlpp_body.csv > rlpp.fsgd

y por otra parte el modelo,

[osotolongo@brick03 fsga2]$ cat rlpp.mtx
0 0 0 0 1

Preparando la ejecucion

Ahora voy a hacer un script que corra todo el proceso, para no saltarme ningun paso

[osotolongo@brick03 fsga2]$ cat fsga_rlpp.sh 
#!/bin/bash
mris_preproc --fsgd rlpp.fsgd --cache-in thickness.fwhm15.fsaverage --target fsaverage --hemi lh --out lh.rlpp.thickness.15.mgh
mris_preproc --fsgd rlpp.fsgd --cache-in thickness.fwhm15.fsaverage --target fsaverage --hemi rh --out rh.rlpp.thickness.15.mgh
mri_glmfit --y lh.rlpp.thickness.15.mgh --fsgd rlpp.fsgd --C rlpp.mtx --surf fsaverage lh --glmdir lh.rlpp.glmdir
mri_glmfit --y rh.rlpp.thickness.15.mgh --fsgd rlpp.fsgd --C rlpp.mtx --surf fsaverage rh --glmdir rh.rlpp.glmdir
mri_glmfit-sim --glmdir lh.rlpp.glmdir --cache 2 neg --cwp 0.05 --2spaces
mri_glmfit-sim --glmdir lh.rlpp.glmdir --cache 2 pos --cwp 0.05 --2spaces
mri_glmfit-sim --glmdir rh.rlpp.glmdir --cache 2 neg --cwp 0.05 --2spaces
mri_glmfit-sim --glmdir rh.rlpp.glmdir --cache 2 pos --cwp 0.05 --2spaces

y se lanza todo con,

[osotolongo@brick03 fsga2]$ ./fsga_rlpp.sh

Buscando resultados

[osotolongo@brick03 fsga2]$ for x in `find ./ -name "*.summary"`; do echo ${x}; grep -v "^#" ${x}; done
./lh.rlpn.glmdir/rlpn/cache.th20.neg.sig.cluster.summary
./lh.rlpn.glmdir/rlpn/cache.th20.pos.sig.cluster.summary
./lh.rlpp.glmdir/rlpp/cache.th20.neg.sig.cluster.summary
./lh.rlpp.glmdir/rlpp/cache.th20.pos.sig.cluster.summary
   1        3.519  112413   3477.26    -18.5  -75.6   28.2  0.00020  0.00000  0.00040   6595    15036.07  precuneus
   2        3.947  157071   2138.53    -58.6  -51.1    1.7  0.00020  0.00000  0.00040   4377    10588.38  bankssts
   3        4.314   99360   1135.62    -44.3    7.6    5.7  0.00878  0.00719  0.01057   2749     7526.91  parsopercularis
./rh.rlpn.glmdir/rlpn/cache.th20.neg.sig.cluster.summary
./rh.rlpn.glmdir/rlpn/cache.th20.pos.sig.cluster.summary
./rh.rlpp.glmdir/rlpp/cache.th20.neg.sig.cluster.summary
./rh.rlpp.glmdir/rlpp/cache.th20.pos.sig.cluster.summary
   1        4.982  104537   7071.55     46.5  -57.5   23.1  0.00020  0.00000  0.00040  14015    35733.48  inferiorparietal
   2        3.430   29029   2647.45     27.8   19.3   42.7  0.00020  0.00000  0.00040   5370    11735.45  caudalmiddlefrontal
   3        4.229   45003   1848.86     12.5  -52.8   30.8  0.00020  0.00000  0.00040   4269    10182.11  precuneus
   4        2.481  143807   1116.95     30.5  -49.7  -13.8  0.01276  0.01077  0.01475   2172     4473.95  fusiform
neuroimagen/bioface_sbm.1624436511.txt.gz · Last modified: 2021/06/23 08:21 by osotolongo