From 0bc8aba325d675c45e22ba64de80d5a470b5b0fa Mon Sep 17 00:00:00 2001
From: Christopher Schmied <schmied@mpi-cbg.de>
Date: Sun, 24 May 2015 17:44:43 +0200
Subject: [PATCH] resave hdf5

---
 spim_registration/timelapse/Snakefile         | 19 ++++++++++---------
 spim_registration/timelapse/tomancak_czi.json |  6 +++---
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/spim_registration/timelapse/Snakefile b/spim_registration/timelapse/Snakefile
index 2f71f0d..d61c139 100755
--- a/spim_registration/timelapse/Snakefile
+++ b/spim_registration/timelapse/Snakefile
@@ -71,7 +71,7 @@ rule define_xml_czi:
 rule define_xml_tif:
     input: glob.glob('*.tif')
     output: config["common"]["first_xml_filename"] + ".xml"
-    message: "Execute define_xml_czi on the following files {input}"
+    message: "Execute define_xml_tif on the following files {input}"
     log: "define_xml_tif.log"
     run:
         cmd_string = produce_string(
@@ -97,18 +97,17 @@ rule define_xml_tif:
 	config["define_xml_tif"],
 	jdir=JOBDIR,
 	path_bsh=config["common"]["bsh_directory"] + config["define_xml_tif"]["bsh_file"])
+	
 	cmd_string +="> {log} 2>&1 && touch {output}"
 	shell(cmd_string)
 	
 # resave .czi dataset as hdf5	
-rule resave_czi_hdf5:
-#    input: config["common"]["first_xml_filename"] + ".xml"
+rule resave_hdf5:
     input: rules.define_xml_tif.output, glob.glob('*.tif')
-#    output: "hdf5_Stock68.h5", "hdf5_Stock68.xml"
-    output: config["common"]["hdf5_xml_filename"] + ".xml", config["common"]["hdf5_xml_filename"] + ".h5"
+    output: "hdf5_test_unicore.xml", "hdf5_test_unicore.h5"
     message: "Execute resave_hdf5 on {input}"
-#    threads: int(config["resave_hdf5"]["parallel_timepoints"]) # parallel timepoints should tell me how many timepoints to expect 
-    log: "export_czi.log"
+    threads: int(config["resave_hdf5"]["parallel_timepoints"]) # parallel timepoints should tell me how many timepoints to expect 
+    log: "resave_hdf5.log"
     run:
         part_string = produce_string(
         	"""{fiji-prefix} {fiji-app} \
@@ -130,14 +129,16 @@ rule resave_czi_hdf5:
            config["resave_hdf5"],
            jdir=JOBDIR,
            path_bsh=config["common"]["bsh_directory"] + config["resave_hdf5"]["bsh_file"])
+
         cmd_string = ""
         for i in range(int(config["resave_hdf5"]["parallel_timepoints"])):
         	cmd_string += part_string.format(job_number=i) 
-        
+    		
+   	#cmd_string += "> {log} 2>&1 && touch {output}"
         shell(cmd_string) 
        	       	
 rule registration:
-    input: "{xml_base}-{file_id}-00.h5"
+    input: "{xml_base}-{file_id}-00.h5", rules.resave_hdf5.output
     #input: rules.resave_hdf5.output, "{xml_base}-{file_id}-00.h5"
     output: "{xml_base}-{file_id,\d+}-00.h5_registered", #"{xml_base}.job_{file_id,\d+}.xml"
     log: "{xml_base}-{file_id}-registration.log"
diff --git a/spim_registration/timelapse/tomancak_czi.json b/spim_registration/timelapse/tomancak_czi.json
index d173e9d..21c30f1 100755
--- a/spim_registration/timelapse/tomancak_czi.json
+++ b/spim_registration/timelapse/tomancak_czi.json
@@ -8,7 +8,7 @@
 	"bsh_directory" : "/projects/pilot_spim/Christopher/snakemake-workflows/spim_registration/timelapse/",
 	"first_xml_filename" : "test_unicore",
 	"hdf5_xml_filename" : "\"hdf5_test_unicore\"",
-	"fusion_switch" : "fusion"
+	"fusion_switch" : "deconvolution"
     },
     
     "define_xml_czi" :
@@ -49,9 +49,9 @@
 	"bsh_file" : "define_tif_zip.bsh" 
     },
     
-    "resave_czi_hdf5" :
+    "resave_hdf5" :
     {
-    	    "parallel_timepoints" : "2",
+    	    "parallel_timepoints" : "3",
     	    "resave_angle" : "\"All angles\"",
     	    "resave_channel" : "\"All channels\"",
     	    "resave_illumination" : "\"All illuminations\"",
-- 
GitLab