User Tools

Site Tools


neuroimagen:fs_group_analysis

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
neuroimagen:fs_group_analysis [2020/06/10 10:30]
osotolongo [FSDG]
neuroimagen:fs_group_analysis [2020/08/04 10:58] (current)
Line 8: Line 8:
  
 https://surfer.nmr.mgh.harvard.edu/fswiki/FsgdFormat https://surfer.nmr.mgh.harvard.edu/fswiki/FsgdFormat
 +
 +
 +Primero hay que construir el archivo de diseño del experimento, 
  
 <code bash> <code bash>
Line 62: Line 65:
  
 </code> </code>
 +
 +===== GLM Analysis (mri_glmfit) =====
 +Primero construimos los contrastes, diciendole a FS cual es la variable que nos interesa, en este caso la edad,
 +
 +https://surfer.nmr.mgh.harvard.edu/fswiki/Fsgdf1G2V
 +
 +<code bash>
 +[osotolongo@detritus fsdg]$ cat facehbi.mtx
 +0 1 0 0
 +</code>
 +Ahora vamos a correr el modelo con este contraste,
 +<code bash>
 +[osotolongo@detritus fsdg]$ mris_preproc --fsgd facehbi.fsdg --cache-in thickness.fwhm10.fsaverage --target fsaverage --hemi lh --out lh.facehbi.age.thickness.10.mgh
 +[osotolongo@detritus fsdg]$ mri_glmfit --y lh.facehbi.age.thickness.10.mgh --fsgd facehbi.fsdg --C facehbi.mtx --surf fsaverage lh --cortex --glmdir lh.facehbi.age.glmdir
 +</code>
 +
 +Para usar freeview me he tenido que ir a la [[neuroimagen:virtfsl|FSL VM]]
 +<code bash>
 +[fsluser@FSLVm7_64 fsdg]$ freeview -f $SUBJECTS_DIR/fsaverage/surf/lh.inflated:annot=aparc.annot:annot_outline=1:overlay=lh.facehbi.age.glmdir/facehbi/sig.mgh:overlay_threshold=4,5 -viewport 3d
 +</code>
 +
 +{{ :neuroimagen:2020-06-11-095209_grim.png |}}
 +
 +Cambiando el //overlay threshold// para que muestre toda la significancia,
 +
 +{{ :neuroimagen:2020-06-11-095409_grim.png |}}
 +
 +Ejemplo, fijando //uncorrected p<0.001//,
 +
 +| {{ :neuroimagen:left.png?300 |}} | {{ :neuroimagen:right.png?300 |}} |
 +
 +===== Clusterwise Correction for Multiple Comparisons =====
 +
 +Ahora voy a buscar los clusters con una //p>0.05//
 +<code bash>
 +[osotolongo@detritus fsdg]$ mri_glmfit-sim --glmdir lh.facehbi.age.glmdir --cache 4 neg --cwp 0.05 --2spaces
 +</code>
 +
 +A ver,
 +<code bash>
 +freeview -f $SUBJECTS_DIR/fsaverage/surf/lh.inflated:overlay=lh.facehbi.age.glmdir/facehbi/cache.th40.neg.sig.cluster.mgh:overlay_threshold=2,5:annot=lh.facehbi.age.glmdir/facehbi/cache.th40.neg.sig.ocn.annot -viewport 3d
 +</code>
 +
 +| {{ :neuroimagen:cleft.png?300 |}} | {{ :neuroimagen:cright.png?300 |}} |
 +
 +También hay un resumen de los clusters que se han encontrado a esta significancia,
 +
 +<code bash>
 +[osotolongo@detritus fsdg]$ cat lh.facehbi.age.glmdir/facehbi/cache.th40.neg.sig.cluster.summary
 +# Cluster Growing Summary (mri_surfcluster)
 +# $Id: mri_surfcluster.c,v 1.57.2.3 2016/11/17 18:19:42 zkaufman Exp $
 +# $Id: mrisurf.c,v 1.781.2.6 2016/12/27 16:47:14 zkaufman Exp $
 +# CreationTime 2020/06/11-08:12:12-GMT
 +# cmdline mri_surfcluster.bin --in lh.facehbi.age.glmdir/facehbi/sig.mgh --mask lh.facehbi.age.glmdir/mask.mgh --cwsig lh.facehbi.age.glmdir/facehbi/cache.th40.neg.sig.cluster.mgh --sum lh.facehbi.age.glmdir/facehbi/cache.th40.neg.sig.cluster.summary --ocn lh.facehbi.age.glmdir/facehbi/cache.th40.neg.sig.ocn.mgh --annot aparc --cwpvalthresh 0.05 --o lh.facehbi.age.glmdir/facehbi/cache.th40.neg.sig.masked.mgh --no-fixmni --csd /usr/local/freesurfer/average/mult-comp-cor/fsaverage/lh/cortex/fwhm14/neg/th40/mc-z.csd --csdpdf lh.facehbi.age.glmdir/facehbi/cache.th40.neg.pdf.dat --vwsig lh.facehbi.age.glmdir/facehbi/cache.th40.neg.sig.voxel.mgh --vwsigmax lh.facehbi.age.glmdir/facehbi/cache.th40.neg.sig.voxel.max.dat --oannot lh.facehbi.age.glmdir/facehbi/cache.th40.neg.sig.ocn.annot --bonferroni 2 --surf white
 +# cwd /nas/data/facehbi/fsdg
 +# sysname  Linux
 +# hostname detritus.fundacioace.com
 +# machine  x86_64
 +# FixVertexAreaFlag 1
 +# FixSurfClusterArea 1
 +#
 +# Input      lh.facehbi.age.glmdir/facehbi/sig.mgh
 +# Frame Number      0
 +# srcsubj fsaverage
 +# hemi lh
 +# surface white
 +# group_avg_surface_area 82220
 +# group_avg_vtxarea_loaded 1
 +# annot aparc
 +# SUBJECTS_DIR /nas/data/subjects
 +# SearchSpace_mm2 75610.7
 +# SearchSpace_vtx 147840
 +# Bonferroni 2
 +# Minimum Threshold 4
 +# Maximum Threshold infinity
 +# Threshold Sign    neg
 +# AdjustThreshWhenOneTail 1
 +# CW PValue Threshold: 0.05
 +# Area Threshold    0 mm^2
 +# CSD thresh  4.000000
 +# CSD nreps    10000
 +# CSD simtype  null-z
 +# CSD contrast NA
 +# CSD confint  90.000000
 +# Overall max 2.34317 at vertex 124430
 +# Overall min -11.9208 at vertex 75951
 +# NClusters          27
 +# FixMNI = 0
 +#
 +# ClusterNo  Max   VtxMax   Size(mm^2)  MNIX   MNIY   MNIZ    CWP    CWPLow    CWPHi   NVtxs    WghtVtx   Annot
 +         -6.017   60982    491.13    -47.9  -18.5   -2.1  0.00020  0.00000  0.00040   1098    -5034.35  superiortemporal
 +        -11.921   75951    428.53    -31.7  -41.3   -9.1  0.00020  0.00000  0.00040    941    -6762.90  parahippocampal
 +         -7.640  112606    361.05    -20.6  -99.6   -2.3  0.00020  0.00000  0.00040    432    -2179.37  lateraloccipital
 +         -5.486  105941    331.99    -17.1  -32.3   56.5  0.00020  0.00000  0.00040    865    -3748.97  precentral
 +         -5.449   35788    316.75    -44.9    6.5  -23.4  0.00020  0.00000  0.00040    611    -2771.80  superiortemporal
 +         -7.472   67375    290.75    -20.6   30.7   50.4  0.00020  0.00000  0.00040    424    -2270.56  superiorfrontal
 +         -4.824  159440    286.63     -8.8  -58.3   11.9  0.00020  0.00000  0.00040    622    -2552.03  precuneus
 +         -6.970  138044    273.27    -30.3  -20.0   68.2  0.00020  0.00000  0.00040    626    -3090.95  precentral
 +         -6.527   35125    264.21    -35.4  -12.7   18.8  0.00020  0.00000  0.00040    820    -4057.14  insula
 +  10       -5.259  113827    256.47    -58.3  -17.5  -17.2  0.00020  0.00000  0.00040    522    -2207.87  middletemporal
 +  11       -6.063  142574    227.96    -18.1  -91.7   16.1  0.00020  0.00000  0.00040    329    -1494.23  lateraloccipital
 +  12       -4.901  142130    215.89    -61.7  -35.5    5.4  0.00020  0.00000  0.00040    478    -2005.09  bankssts
 +  13       -7.124   88387    197.22    -10.7  -56.5   26.6  0.00020  0.00000  0.00040    436    -2167.82  precuneus
 +  14       -5.977  112248    187.37    -31.2  -83.9    6.5  0.00040  0.00000  0.00080    312    -1449.31  lateraloccipital
 +  15       -5.741  127670    174.29    -54.6   -0.9  -30.3  0.00080  0.00040  0.00140    210     -946.11  middletemporal
 +  16       -5.957  110612    155.97    -44.6   23.1   18.8  0.00180  0.00100  0.00260    258    -1195.22  parsopercularis
 +  17       -5.156  102514    136.16    -22.9   56.1   15.5  0.00459  0.00340  0.00579    163     -710.54  rostralmiddlefrontal
 +  18       -5.618   43104    128.92    -24.3    6.2   48.4  0.00619  0.00479  0.00759    289    -1317.77  caudalmiddlefrontal
 +  19       -5.445   91005    128.90    -21.8  -66.5    0.5  0.00619  0.00479  0.00759    285    -1241.01  lingual
 +  20       -4.760   47386    121.71     -8.2   33.1   33.9  0.00759  0.00599  0.00918    190     -780.64  superiorfrontal
 +  21       -4.778  107013    120.23    -19.8  -83.3   38.4  0.00798  0.00639  0.00958    223     -941.62  superiorparietal
 +  22       -4.954   58975    118.93    -10.8   25.6  -17.8  0.00818  0.00659  0.00978    269    -1155.28  medialorbitofrontal
 +  23       -4.799   38711    117.04    -60.9  -46.0   -1.9  0.00898  0.00739  0.01077    232     -956.50  bankssts
 +  24       -6.095    1815    116.62    -47.1  -19.1   56.1  0.00918  0.00739  0.01097    319    -1485.15  postcentral
 +  25       -4.976   77509    113.61    -35.6   37.8   13.2  0.01057  0.00878  0.01236    190     -814.05  rostralmiddlefrontal
 +  26       -4.228   51760     87.69    -45.5  -72.1   10.1  0.02524  0.02247  0.02800    140     -552.81  inferiorparietal
 +  27       -6.056  126177     68.80    -27.1  -68.1   22.7  0.04898  0.04508  0.05288    181     -854.08  superiorparietal
 +
 +</code>
 +
 +====== Full data ======
 +
 +<code>
 +osotolongo@detritus:facehbi$ head datacomb_freesurfer_neuro_v0_scdSUMCC.csv
 +Subject,SubjID,code_facehbi,N_Interno,Date,edat,Anyos_Escolaridad_FAC,Sex_1H_0M,SCDplus_Memorycomplaint,SCDplus_APOE4,SCDplus_concernsaboutcognition,SCDplus_feelingworsethancontemporarypeers,SCDplus_informantcorroboratessymptoms,SCDplus_onset60Y,SCDplus_onsetwithinlast5Y,SCDplus_SUVRgt1.35,SCDplus_SUVRgt1.45,SCDplus_Total7,Q_QSM_JPO,SUVR,Centilod,APOE,COMPOSITE_executive_fluency ,COMPOSITE_executive_processing speed ,COMPOSITE_executive_attention ,COMPOSITE_memory_FNAME professions,COMPOSITE_memory_FNAME names ,COMPOSITES_memory_WMS ,COMPOSITE_memory_RBANS ,COMPOSITE_gnosis,COMPOSITE_praxis,COMPOSITE_languge_naming 
 +1,/nas/data/subjects/facehbi_0001,F001,20090806,11.12.2014,71,8,0,0,1,1,0,1,1,1,0,0,5,39,0.973316491,-5.593250248,e3e4,-0.5748,-0.270392,-0.532514,-0.616904,0.876729,-0.453361,1.130826,0.168598,0.515105,-0.579091
 +2,/nas/data/subjects/facehbi_0002,F002,20131084,11.12.2014,70,12,1,0,0,0,0,1,1,1,0,0,3,18,1.088375542,12.05680811,e3e3,0.849066,-0.703145,0.071122,0.91243,0.399876,0.259093,1.048653,1.256325,0.515105,0.926364
 +3,/nas/data/subjects/facehbi_0003,F003,20130456,18.12.2014,70,8,0,0,0,0,0,0,1,1,0,0,2,19,0.961914381,-7.342333945,e3e3,-1.381163,1.677785,-1.150127,-1.024665,0.195343,-0.809587,1.426227,1.256325,-0.772658,-0.388182
 +4,/nas/data/subjects/facehbi_0004,F004,20080130,18.12.2014,76,16,0,0,0,1,0,0,1,1,0,0,3,21,1.075781955,10.12495194,e3e3,-0.630893,-0.4805,-1.13615,-0.512863,-0.622202,-0.152722,-0.907758,0.168598,-2.060421,0.164545
 +5,/nas/data/subjects/facehbi_0005,F005,20141272,22.01.2015,68,20,1,0,0,0,1,1,1,0,0,0,3,29,0.95654587,-8.16586361,e2e3,1.256741,-0.549082,1.320324,0.704347,1.321653,0.630976,0.512283,0.168598,-2.060421,0.396364
 +6,/nas/data/subjects/facehbi_0006,F006,20141107,15.01.2015,64,14,0,0,1,1,1,1,1,1,1,0,6,56,1.253344903,37.36310815,e3e4,1.002492,0.610598,0.688735,0.610631,-0.71047,0.116602,-0.507294,-0.91913,-2.060421,-0.039091
 +7,/nas/data/subjects/facehbi_0007,F007,20080716,15.01.2015,59,19,1,1,0,1,0,0,0,0,1,1,2,15,1.504516347,75.89280769,e3e3,1.040233,0.70185,-0.518537,-0.204993,0.311608,0.345995,-0.114041,-0.91913,-3.348184,0.090909
 +8,/nas/data/subjects/facehbi_0008,F008,20131483,15.01.2015,55,16,0,0,0,1,0,1,0,1,0,0,3,72,0.897682014,-17.19557899,e3e3,-1.363541,0.552768,-0.532514,-0.111277,0.980961,-0.781793,1.473992,-0.91913,0.515105,-0.439091
 +9,/nas/data/subjects/facehbi_0009,F009,20141277,29.01.2015,67,16,0,0,0,0,0,0,1,1,0,0,2,18,1.033333445,3.613350513,e3e3,0.674792,0.532426,0.688735,-0.920727,-0.826734,-1.110226,-1.451403,-0.91913,-0.772658,1.016462
 +
 +
 +osotolongo@detritus:facehbi$ head -n 1 datacomb_freesurfer_neuro_v0_scdSUMCC.csv | sed 's/,/\n/g' | cat -n
 +      Subject
 +      SubjID
 +      code_facehbi
 +      N_Interno
 +      Date
 +      edat
 +      Anyos_Escolaridad_FAC
 +      Sex_1H_0M
 +      SCDplus_Memorycomplaint
 +    10  SCDplus_APOE4
 +    11  SCDplus_concernsaboutcognition
 +    12  SCDplus_feelingworsethancontemporarypeers
 +    13  SCDplus_informantcorroboratessymptoms
 +    14  SCDplus_onset60Y
 +    15  SCDplus_onsetwithinlast5Y
 +    16  SCDplus_SUVRgt1.35
 +    17  SCDplus_SUVRgt1.45
 +    18  SCDplus_Total7
 +    19  Q_QSM_JPO
 +    20  SUVR
 +    21  Centilod
 +    22  APOE
 +    23  COMPOSITE_executive_fluency 
 +    24  COMPOSITE_executive_processing speed 
 +    25  COMPOSITE_executive_attention 
 +    26  COMPOSITE_memory_FNAME professions
 +    27  COMPOSITE_memory_FNAME names 
 +    28  COMPOSITES_memory_WMS 
 +    29  COMPOSITE_memory_RBANS 
 +    30  COMPOSITE_gnosis
 +    31  COMPOSITE_praxis
 +    32  COMPOSITE_languge_naming 
 +</code>
 +
 +Voy a tomar uno de los composites para probar,
 +
 +<code bash>
 +osotolongo@detritus:facehbi$ awk -F"," {'print $2","$6","$7","$8","$23'} datacomb_freesurfer_neuro_v0_scdSUMCC.csv | sed 's/.*\/facehbi_/facehbi_/;s/SubjID/Variables/;s/edat/age/;s/Anyos_Escolaridad_FAC/education/;s/Sex_1H_0M/gender/;s/COMPOSITE_//;s/facehbi_\([^,]*\),/Input facehbi_\1 Main /; s/,/ /g' > executive_fluency_body.tsv
 +osotolongo@detritus:facehbi$ cat executive_fluency_header.txt
 +GroupDescriptorFile 1                                                                                                  Title FACEHBI_executive_fluency
 +Class Main
 +osotolongo@detritus:facehbi$ cat executive_fluency_header.txt executive_fluency_body.tsv > executive_fluency.fsgd
 +osotolongo@detritus:facehbi$ head executive_fluency.fsgd
 +GroupDescriptorFile 1
 +Title FACEHBI_executive_fluency
 +Class Main
 +Variables age education gender executive_fluency 
 +Input facehbi_0001 Main 71 8 0 -0.5748
 +Input facehbi_0002 Main 70 12 1 0.849066
 +Input facehbi_0003 Main 70 8 0 -1.381163
 +Input facehbi_0004 Main 76 16 0 -0.630893
 +Input facehbi_0005 Main 68 20 1 1.256741
 +Input facehbi_0006 Main 64 14 0 1.002492
 +osotolongo@detritus:facehbi$ cat comps.mtx
 +0 0 0 0 1
 +
 +</code>
 +
 +ahora empezamos,
 +
 +<code bash>
 +osotolongo@detritus:facehbi$ mris_preproc --fsgd executive_fluency.fsgd --cache-in thickness.fwhm10.fsaverage --target fsaverage --hemi lh --out lh.executive_fluency.thickness.10.mgh
 +osotolongo@detritus:facehbi$ mri_glmfit --y lh.executive_fluency.thickness.10.mgh --fsgd executive_fluency.fsgd --C comps.mtx --surf fsaverage lh --cortex --glmdir lh.executive_fluency.glmdir
 +osotolongo@detritus:facehbi$ mri_glmfit-sim --glmdir lh.executive_fluency.glmdir --cache 4 neg --cwp 0.05 --2spaces
 +osotolongo@detritus:facehbi$ grep -v "#" lh.executive_fluency.glmdir/comps/cache.th40.neg.sig.cluster.summary
 +osotolongo@detritus:facehbi$ mri_glmfit-sim --glmdir lh.executive_fluency.glmdir --cache 4 pos --cwp 0.05 --2spaces
 +osotolongo@detritus:facehbi$ grep -v "#" lh.executive_fluency.glmdir/comps/cache.th40.pos.sig.cluster.summary
 +
 +</code>
 +
 +
 +Y esto lo hacemos para el otro hemisferio igualmente. Aqui no hay nada asi que podemos seguir hacia la siguiente variable, ;-)
 +
 +**ejemplo de resultados**
 +
 +<code bash>
 +osotolongo@detritus:facehbi$ grep -v "#" lh.executive_processing.glmdir/comps/cache.th40.neg.sig.cluster.summary
 +         -6.662  147537    122.63    -24.1  -78.1   17.4  0.00739  0.00579  0.00898    237    -1176.13  superiorparietal
 +</code>
 +
 +{{ :neuroimagen:sig.png|}}
 +
 +{{ :neuroimagen:clusters.png|}}
 +
 +===== bulk processing =====
 +
 +Esto es muy aburrido, asi que vamos a hacerlo todo junto,
 +
 +<code bash fsgd.sh>
 +avar=$1
 +shift
 +mris_preproc --fsgd ${avar}.fsgd --cache-in thickness.fwhm10.fsaverage --target fsaverage --hemi lh --out lh.${avar}.thickness.10.mgh
 +mris_preproc --fsgd ${avar}.fsgd --cache-in thickness.fwhm10.fsaverage --target fsaverage --hemi rh --out rh.${avar}.thickness.10.mgh
 +mri_glmfit --y lh.${avar}.thickness.10.mgh --fsgd ${avar}.fsgd --C comps.mtx --surf fsaverage lh --cortex --glmdir lh.${avar}.glmdir
 +mri_glmfit --y rh.${avar}.thickness.10.mgh --fsgd ${avar}.fsgd --C comps.mtx --surf fsaverage rh --cortex --glmdir rh.${avar}.glmdir
 +mri_glmfit-sim --glmdir lh.${avar}.glmdir --cache 4 neg --cwp 0.05 --2spaces
 +mri_glmfit-sim --glmdir rh.${avar}.glmdir --cache 4 neg --cwp 0.05 --2spaces
 +mri_glmfit-sim --glmdir lh.${avar}.glmdir --cache 4 pos --cwp 0.05 --2spaces
 +mri_glmfit-sim --glmdir rh.${avar}.glmdir --cache 4 pos --cwp 0.05 --2spaces
 +echo "lh, neg"
 +grep -v "#" lh.${avar}.glmdir/comps/cache.th40.neg.sig.cluster.summary
 +echo "rh, neg"
 +grep -v "#" rh.${avar}.glmdir/comps/cache.th40.neg.sig.cluster.summary
 +echo "lh, pos"
 +grep -v "#" lh.${avar}.glmdir/comps/cache.th40.pos.sig.cluster.summary
 +echo "rh, pos"
 +grep -v "#" rh.${avar}.glmdir/comps/cache.th40.pos.sig.cluster.summary
 +</code>
 +
 +
 +todavia hay que hacer el archivo fsgd a mano pero despues de eso,
 +
 +<code bash>
 +osotolongo@detritus:facehbi$ head wms.fsgd
 +GroupDescriptorFile 1
 +Title FACEHBI_memory_wms
 +Class Main
 +Variables age education gender memory_WMS 
 +Input facehbi_0001 Main 71 8 0 -0.453361
 +Input facehbi_0002 Main 70 12 1 0.259093
 +Input facehbi_0003 Main 70 8 0 -0.809587
 +Input facehbi_0004 Main 76 16 0 -0.152722
 +Input facehbi_0005 Main 68 20 1 0.630976
 +Input facehbi_0006 Main 64 14 0 0.116602
 +osotolongo@detritus:facehbi$ ./fsgd.sh wms
 +</code>
 +
 +===== Surface Area =====
 +
 +Tengo que añadir el ICV a los datos, (un poco de awk, sed, join, etc) y deberia quedar,
 +
 +<code bash>
 +osotolongo@detritus:facehbi$ head -n 1 datacomb_freesurfer_neuro_v0_scdSUMCC_icv.csv | sed 's/,/\n/g' | cat -n
 +      code_facehbi
 +      Subject
 +      SubjID
 +      N_Interno
 +      Date
 +      edat
 +      Anyos_Escolaridad_FAC
 +      Sex_1H_0M
 +      SCDplus_Memorycomplaint
 +    10  SCDplus_APOE4
 +    11  SCDplus_concernsaboutcognition
 +    12  SCDplus_feelingworsethancontemporarypeers
 +    13  SCDplus_informantcorroboratessymptoms
 +    14  SCDplus_onset60Y
 +    15  SCDplus_onsetwithinlast5Y
 +    16  SCDplus_SUVRgt1.35
 +    17  SCDplus_SUVRgt1.45
 +    18  SCDplus_Total7
 +    19  Q_QSM_JPO
 +    20  SUVR
 +    21  Centilod
 +    22  APOE
 +    23  COMPOSITE_executive_fluency 
 +    24  COMPOSITE_executive_processing speed 
 +    25  COMPOSITE_executive_attention 
 +    26  COMPOSITE_memory_FNAME professions
 +    27  COMPOSITE_memory_FNAME names 
 +    28  COMPOSITES_memory_WMS 
 +    29  COMPOSITE_memory_RBANS 
 +    30  COMPOSITE_gnosis
 +    31  COMPOSITE_praxis
 +    32  COMPOSITE_languge_naming 
 +    33  EstimatedTotalIntraCranialVol
 +</code>
 +
 +Ahora ir escogiendo y pegando,
 +
 +<code bash>
 +osotolongo@detritus:facehbi$ awk -F"," {'print $3","$6","$7","$8","$9","$33'} datacomb_freesurfer_neuro_v0_scdSUMCC_icv.csv | sed 's/.*\/facehbi_/facehbi_/;s/SubjID/Variables/;s/edat/age/;s/Anyos_Escolaridad_FAC/education/;s/Sex_1H_0M/gender/;s/facehbi_\([^,]*\),/Input facehbi_\1 Main /; s/,/ /g' > scd9a.tsv
 +osotolongo@detritus:facehbi$ head scd9a.tsv
 +Variables age education gender SCDplus_Memorycomplaint EstimatedTotalIntraCranialVol
 +Input facehbi_0001 Main 71 8 0 0 1756453.4998
 +Input facehbi_0002 Main 70 12 1 0 1529412.17649
 +Input facehbi_0003 Main 70 8 0 0 1326413.64353
 +Input facehbi_0004 Main 76 16 0 0 1368330.41095
 +Input facehbi_0005 Main 68 20 1 0 1467058.62476
 +Input facehbi_0006 Main 64 14 0 0 1300087.33412
 +Input facehbi_0007 Main 59 19 1 1 1672996.58646
 +Input facehbi_0008 Main 55 16 0 0 1230515.65242
 +Input facehbi_0009 Main 67 16 0 0 1526642.95225
 +osotolongo@detritus:facehbi$ cat scd9a.header 
 +GroupDescriptorFile 1
 +Title FACEHBI_SCDplus_Memorycomplaint
 +Class Main
 +osotolongo@detritus:facehbi$ cat scd9a.header scd9a.tsv > scd9a.fsgd
 +osotolongo@detritus:facehbi$ head scd9a.fsgd
 +GroupDescriptorFile 1
 +Title FACEHBI_SCDplus_Memorycomplaint
 +Class Main
 +Variables age education gender SCDplus_Memorycomplaint EstimatedTotalIntraCranialVol
 +Input facehbi_0001 Main 71 8 0 0 1756453.4998
 +Input facehbi_0002 Main 70 12 1 0 1529412.17649
 +Input facehbi_0003 Main 70 8 0 0 1326413.64353
 +Input facehbi_0004 Main 76 16 0 0 1368330.41095
 +Input facehbi_0005 Main 68 20 1 0 1467058.62476
 +Input facehbi_0006 Main 64 14 0 0 1300087.33412
 +
 +osotolongo@detritus:facehbi$ cat compsa.mtx 
 +0 0 0 0 1 0
 +
 +</code>
 +
 +El codigo debe cambiar algo, 
 +
 +<code bash fsgda.sh>
 +avar=$1
 +shift
 +mris_preproc --fsgd ${avar}.fsgd --cache-in area.fwhm10.fsaverage --target fsaverage --hemi lh --out lh.${avar}.area.10.mgh
 +mris_preproc --fsgd ${avar}.fsgd --cache-in area.fwhm10.fsaverage --target fsaverage --hemi rh --out rh.${avar}.area.10.mgh
 +mri_glmfit --y lh.${avar}.area.10.mgh --fsgd ${avar}.fsgd --C compsa.mtx --surf fsaverage lh --cortex --glmdir lh.${avar}.sa.glmdir
 +mri_glmfit --y rh.${avar}.area.10.mgh --fsgd ${avar}.fsgd --C compsa.mtx --surf fsaverage rh --cortex --glmdir rh.${avar}.sa.glmdir
 +mri_glmfit-sim --glmdir lh.${avar}.sa.glmdir --cache 4 neg --cwp 0.05 --2spaces
 +mri_glmfit-sim --glmdir rh.${avar}.sa.glmdir --cache 4 neg --cwp 0.05 --2spaces
 +mri_glmfit-sim --glmdir lh.${avar}.sa.glmdir --cache 4 pos --cwp 0.05 --2spaces
 +mri_glmfit-sim --glmdir rh.${avar}.sa.glmdir --cache 4 pos --cwp 0.05 --2spaces
 +echo "lh, neg"
 +grep -v "#" lh.${avar}.sa.glmdir/compsa/cache.th40.neg.sig.cluster.summary
 +echo "rh, neg"
 +grep -v "#" rh.${avar}.sa.glmdir/compsa/cache.th40.neg.sig.cluster.summary
 +echo "lh, pos"
 +grep -v "#" lh.${avar}.sa.glmdir/compsa/cache.th40.pos.sig.cluster.summary
 +echo "rh, pos"
 +grep -v "#" rh.${avar}.sa.glmdir/compsa/cache.th40.pos.sig.cluster.summary
 +</code>
 +
 +No hay demasiados resultados pero alguno si,
 +
 +<code bash>
 +osotolongo@detritus:facehbi$ ./fsgda.sh scd16a
 +...
 +...
 +...
 +lh, neg
 +rh, neg
 +lh, pos
 +          4.160   87102    125.74    -25.2  -79.5   13.8  0.03135  0.02820  0.03450    252      991.50  superiorparietal
 +rh, pos
 +</code>
 +
 +ahi ya sabemos donde buscar,
 +
 +<code bash>
 +osotolongo@detritus:facehbi$ cat scd16a.header 
 +GroupDescriptorFile 1
 +Title FACEHBI_SCDplus_SUVRgt1.35
 +Class Main
 +
 +osotolongo@detritus:facehbi$ cat lh.scd16a.sa.glmdir/compsa/cache.th40.pos.sig.cluster.summary
 +...
 +...
 +...
 +# ClusterNo  Max   VtxMax   Size(mm^2)  MNIX   MNIY   MNIZ    CWP    CWPLow    CWPHi   NVtxs    WghtVtx   Annot
 +          4.160   87102    125.74    -25.2  -79.5   13.8  0.03135  0.02820  0.03450    252      991.50  superiorparietal
 +</code>
 +
 +
 +Otros resultados, 
 +
 +<code>
 +scd17a
 +
 +lh, neg
 +rh, neg
 +lh, pos
 +          5.013  112180    428.88    -32.5  -81.3   14.8  0.00020  0.00000  0.00040    714     3121.90  inferiorparietal
 +rh, pos
 +
 +
 +</code>
 +
 +
neuroimagen/fs_group_analysis.1591785020.txt.gz · Last modified: 2020/08/04 10:45 (external edit)