[Swift-commit] r3067 - SwiftApps/SIDGrid/swift/projects/andric/peakfit_pilots/PK2/wholebrain

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Thu Aug 6 11:00:33 CDT 2009


Author: andric
Date: 2009-08-06 11:00:33 -0500 (Thu, 06 Aug 2009)
New Revision: 3067

Added:
   SwiftApps/SIDGrid/swift/projects/andric/peakfit_pilots/PK2/wholebrain/PK2med_runs.swift
Log:
testing run by run peak analysis. whole time series was infinite run time and not finishing.

Added: SwiftApps/SIDGrid/swift/projects/andric/peakfit_pilots/PK2/wholebrain/PK2med_runs.swift
===================================================================
--- SwiftApps/SIDGrid/swift/projects/andric/peakfit_pilots/PK2/wholebrain/PK2med_runs.swift	                        (rev 0)
+++ SwiftApps/SIDGrid/swift/projects/andric/peakfit_pilots/PK2/wholebrain/PK2med_runs.swift	2009-08-06 16:00:33 UTC (rev 3067)
@@ -0,0 +1,66 @@
+#--- peak analysis across the brain via Mediator
+## type declarations:
+type file{}
+type Rscript;
+## a type for simple mapping the 3 R scripts used:
+type PeakfitR{
+    Rscript ShellpeakMediatorPK2;
+    Rscript preprocessEnewsmooth;
+    Rscript peakfitv2v1;
+}
+## a type for simple mapping the two output files:
+type PeakResult{
+    file pdf;
+    file a;
+    file b;
+}
+
+## Mediator app declaration:
+app (file q_result, PeakResult outObj) run_query (string med_args, file config, PeakfitR code){
+    Mediator med_args stdout=@filename(q_result) "--r_script" @filename(code.ShellpeakMediatorPK2);
+}
+
+## this process sets parameters and calls Mediator:
+loop_query(int vert, string user, string db, string host, string query_outline, PeakfitR code, file config, string subject, string h, int rr, int beginTS, int endTS){
+    string theoutprefix = "FAH_Q";
+    PeakResult outObj<simple_mapper; location="results", prefix=@strcat(subject,"_",h,"vert",vert,"run",rr,".result.")>;
+    file q_result <single_file_mapper; file=@strcat("Qresults/",subject,"_",h,"vert",vert,".qresult")>;
+    string med_args = @strcat("--user ","andric"," --conf ", @filename(config)," --db ", db," --host ", host,
+        " --vox ", vert," --subject ", subject," --subquery tsTSVAR"," --begin_ts ",beginTS," --end_ts ",endTS,
+        " --query ", query_outline," --r_swift_args ", @filename(outObj)," --outprefix ", theoutprefix);
+    trace(med_args);
+    (q_result, outObj) = run_query(med_args, config, code);
+}
+
+## needed parameters to use Mediator:
+string user = @arg("user");
+string db = "HEL";
+string host = "tp-neurodb.ci.uchicago.edu";
+file config<single_file_mapper; file="user.config">;
+
+## mapping the R code:
+PeakfitR code<simple_mapper; location="Rscripts", suffix=".R">;
+
+## variables to move across in the foreach loops:
+string declarelist[] = ["PK2smth"];
+string hemilist[] = ["lh"];
+int vertices[] = [1:2:1];
+
+int runs[] = [1:2];
+int starts[] = [0, 226, 452, 678, 904, 1130, 1356, 1582];
+#int starts[] = [1, 227, 453, 679, 905, 1131, 1357, 1583];
+int TSend = 225;
+
+foreach subject in declarelist{
+    foreach h in hemilist{
+        foreach rr in runs{
+            int beginTS = starts[rr];
+            int endTS = starts[rr]+TSend;
+            string query_outline = @strcat("SELECT SUBQUERY FROM peakTS_data",h," WHERE subject = '",subject,"' AND vertex=VOX");
+            trace(query_outline);
+            foreach vert in vertices{
+                loop_query(vert, user, db, host, query_outline, code, config, subject, h, rr, beginTS, endTS);
+            }
+        }
+    }
+}




More information about the Swift-commit mailing list