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

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Thu Aug 6 10:52:31 CDT 2009


Author: andric
Date: 2009-08-06 10:52:31 -0500 (Thu, 06 Aug 2009)
New Revision: 3062

Added:
   SwiftApps/SIDGrid/swift/projects/andric/peakfit_pilots/PK2/wholebrain/PK2mediator.swift
Log:
peak analysis using mediator

Added: SwiftApps/SIDGrid/swift/projects/andric/peakfit_pilots/PK2/wholebrain/PK2mediator.swift
===================================================================
--- SwiftApps/SIDGrid/swift/projects/andric/peakfit_pilots/PK2/wholebrain/PK2mediator.swift	                        (rev 0)
+++ SwiftApps/SIDGrid/swift/projects/andric/peakfit_pilots/PK2/wholebrain/PK2mediator.swift	2009-08-06 15:52:31 UTC (rev 3062)
@@ -0,0 +1,59 @@
+#--- 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) @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 evox = vert;
+    string theoutprefix = "FAH_Q";
+    PeakResult outObj<simple_mapper; location="results", prefix=@strcat(subject,"_",h,"vert",vert,".out.")>;
+    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,
+        " --begin_vox ", vert," --end_vox ", evox," --batchstep ", "1"," --subject ", subject,
+        " --query ", query_outline," --r_swift_args ", @filename(outObj)," --r_script ", @filename(code.ShellpeakMediatorPK2)," --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];
+
+## nest the loop_query process in foreach loops to move across variable sets
+foreach subject in declarelist{
+    foreach h in hemilist{
+        string query_outline = @strcat("SELECT * FROM peakTS_data",h," WHERE subject = '",subject,"' AND vertex between BEGIN_BATCH and END_BATCH");
+        trace(query_outline);
+        foreach vert in vertices{
+            loop_query(vert, user, db, host, query_outline, code, config, subject, h);
+        }
+    }
+}


Property changes on: SwiftApps/SIDGrid/swift/projects/andric/peakfit_pilots/PK2/wholebrain/PK2mediator.swift
___________________________________________________________________
Name: svn:executable
   + *




More information about the Swift-commit mailing list