[Swift-commit] r3073 - in SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy: . scripts

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Thu Aug 6 22:34:06 CDT 2009


Author: andric
Date: 2009-08-06 22:34:06 -0500 (Thu, 06 Aug 2009)
New Revision: 3073

Added:
   SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/scripts/
   SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/scripts/FriedmanTest.R
   SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/scripts/cat_sort_allss2.py
   SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/scripts/find_missing_files.py
   SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/scripts/surfclust.py
Log:
scripts for Friedman Test analysis

Added: SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/scripts/FriedmanTest.R
===================================================================
--- SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/scripts/FriedmanTest.R	                        (rev 0)
+++ SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/scripts/FriedmanTest.R	2009-08-07 03:34:06 UTC (rev 3073)
@@ -0,0 +1,25 @@
+#---- this is to do friedman non-parametric test on lags
+allinputs <- Sys.getenv("R_SWIFT_ARGS")
+print(Sys.getenv("R_SWIFT_ARGS"));
+outname <- noquote(strsplit(allinputs," ")[[1]][1])
+outname2 <- noquote(strsplit(allinputs," ")[[1]][2])
+
+inputfile <- Sys.getenv("R_INPUT")
+print(inputfile)
+Query_out <- as.matrix(read.table(inputfile))
+
+#names(Query_out) <- c("subject", "vertex", "speech_lag", "emblem_lag", "embspeech_lag");
+
+m <- matrix(nrow=500,ncol=3)
+mat_row <- 0;
+#attach(Query_out)
+vertex_levels <- as.factor(Query_out[,2])
+for (vert in levels(vertex_levels)){
+    mat_row = mat_row + 1
+    vert_data <- matrix(c(Query_out[which(Query_out[,2]==vert),3:5]),nr=24)
+    friedman_test <- friedman.test(vert_data)
+    vert_id <- as.integer(vert)
+    m[mat_row, ] <- c(vert_id, friedman_test$statistic[[1]], friedman_test$p.value[[1]])
+    rm(vert_data)
+}
+write.table(round(m,5), file=paste(outname2,outname,".txt",sep=""), row.names=FALSE, col.names=FALSE, quote=F)

Added: SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/scripts/cat_sort_allss2.py
===================================================================
--- SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/scripts/cat_sort_allss2.py	                        (rev 0)
+++ SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/scripts/cat_sort_allss2.py	2009-08-07 03:34:06 UTC (rev 3073)
@@ -0,0 +1,25 @@
+#!/usr/bin/python
+
+import os
+import commands
+import time
+
+
+hemis = ['lh','rh']
+seeds = ['IDEAL']
+
+
+def concat_sort(ss,h):
+    print "starting concat_sort process\ntime is: "+time.ctime()
+    os.chdir(os.getenv("cnari")+"/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/results/")
+    print os.getcwd()
+    commands.getoutput("cat *"+h+"*0.txt > "+h+"_"+ss+"_gather.txt")
+    print "word count of gather file ("+h+"_"+ss+"_gather.txt): "+commands.getoutput("wc "+h+"_"+ss+"_gather.txt")
+    commands.getoutput("sort -g -k 1 "+h+"_"+ss+"_gather.txt > "+h+"_"+ss+"_sorted.txt")
+    print "word count of sorted file ("+h+"_"+ss+"_sorted.txt): "+commands.getoutput("wc "+h+"_"+ss+"_sorted.txt")
+    commands.getoutput("rm -rf "+h+"_"+ss+"_gather.txt")
+
+
+for ss in seeds:
+    for h in hemis:
+        concat_sort(ss,h)

Added: SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/scripts/find_missing_files.py
===================================================================
--- SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/scripts/find_missing_files.py	                        (rev 0)
+++ SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/scripts/find_missing_files.py	2009-08-07 03:34:06 UTC (rev 3073)
@@ -0,0 +1,27 @@
+#!/usr/bin/python
+
+import commands
+import time
+import os
+import sys
+
+#---- VERY IMPORTANT: CURRENTLY, THIS SCRIPT IS HARDCODED FOR ONE HEMI AT A TIME
+starts = range(1,196000,500)
+hemis = ['lh']
+#subjs = [5,6,7,8,10,11,12,13,14,15,17,18,19,20,21,22,23,24,25,26,27,28,30]
+
+
+for h in hemis:
+    os.chdir(os.getenv("cnari")+"/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/results/")
+    print os.getcwd()
+    outfile = os.getenv("cnari")+"/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/results/missing_"+h+"starts.txt"
+    missed = ""
+    for num in starts:
+        voxdata = "IDEAL"+h+"_NonParam"+`num`+"_"+`(num+499)`+".txt"
+        if os.path.exists(voxdata): pass
+        else:
+            missed += `num`+"\n"
+            
+    file = open(outfile,"w")
+    file.write(missed)
+    file.close()

Added: SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/scripts/surfclust.py
===================================================================
--- SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/scripts/surfclust.py	                        (rev 0)
+++ SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/scripts/surfclust.py	2009-08-07 03:34:06 UTC (rev 3073)
@@ -0,0 +1,27 @@
+#!/usr/bin/python
+
+import os
+import commands
+import sys
+import time
+
+
+seed = ['IDEAL']
+hemis = ['lh','rh']
+
+os.chdir(os.getenv("cnari")+"/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/results/")
+print os.getcwd()
+
+def surf_clust(ss,h):
+    print "surfclust for seed: "+ss+"\nhemisphere: "+h+"\ntime started: "+time.ctime()
+    print commands.getoutput("SurfClust \
+    -spec HORRY."+h+".mesh140_std.spec -surf_A HORRY."+h+".mesh140_std.pial.asc  \
+    -input "+h+"_"+ss+"_new_sorted.txt 1 -rmm 2.8 -thresh_col 1 -thresh 6.0 -amm2 2 -sort_n_nodes \
+    -out_clusterdset -out_roidset -prepend_node_index -out_fulllist \
+    -prefix "+h+"_"+ss+"_clustered_p05")
+
+
+
+for ss in seed:
+    for h in hemis:
+        surf_clust(ss,h)




More information about the Swift-commit mailing list