Skip to content
Snippets Groups Projects
Commit 0d0dcea5 authored by Christopher Schmied's avatar Christopher Schmied
Browse files

Added define_xml_czi to snakemake workflow

parent e30aca47
No related branches found
No related tags found
No related merge requests found
...@@ -2,13 +2,13 @@ import os, glob, sys, re ...@@ -2,13 +2,13 @@ import os, glob, sys, re
#where are we (can be configured through -d/--directory flag) #where are we (can be configured through -d/--directory flag)
JOBDIR=os.path.abspath(os.path.curdir) JOBDIR=os.path.abspath(os.path.curdir)
if JOBDIR[-1] != "/": if JOBDIR[-1] != "/": # this checks if jobdir ends with slash if not it adds a slash
JOBDIR+="/" JOBDIR+="/"
#data specific config file, expected to be inside JOBDIR #data specific config file, expected to be inside JOBDIR
configfile: "tomancak_czi.json" configfile: "tomancak_czi.json"
datasets = glob.glob('*00.h5') datasets = glob.glob('*00.h5') # searches JOBDIR for files that match this wildcard expression
#TODO: this should go into a python module in this path #TODO: this should go into a python module in this path
fre = re.compile(r'(?P<xml_base>\w+)-(?P<file_id>\d+)-00.h5') fre = re.compile(r'(?P<xml_base>\w+)-(?P<file_id>\d+)-00.h5')
...@@ -33,14 +33,15 @@ rule done: ...@@ -33,14 +33,15 @@ rule done:
input: [ ds+"_deconvolved" for ds in datasets ] input: [ ds+"_deconvolved" for ds in datasets ]
# add part for defining xml file on czi dataset # add part for defining xml file on czi dataset
rule define_xml: rule define_xml_czi:
input: "{czi_base}.czi" input: glob.glob('*.czi')
output: "{xml_name}.xml" output: config["define_xml_czi"]["first_xml_filename"] + ".xml"
threads: 1 threads: 1
message: "Execute define xml with {threads} threads on the following files {input}" message: "Execute define xml with {threads} threads on the following files {input}"
log: "define_xml.log" log: "define_xml.log"
run: cmd_string = produce_string("""{fiji-prefix} {fiji-app} \ run:
-Dimage_file_directory={jdir}\ cmd_string = produce_string("""{fiji-prefix} {fiji-app} \
-Dimage_file_directory={jdir} \
-Dfirst_czi={first_czi} \ -Dfirst_czi={first_czi} \
-Dangle_1={angle_1} \ -Dangle_1={angle_1} \
-Dangle_2={angle_2} \ -Dangle_2={angle_2} \
...@@ -59,10 +60,9 @@ rule define_xml: ...@@ -59,10 +60,9 @@ rule define_xml:
-- --no-splash {bsh_file}""", -- --no-splash {bsh_file}""",
config["common"], config["common"],
config["define_xml_czi"], config["define_xml_czi"],
jdir=JOBDIR, jdir=JOBDIR)
output="{output}")
shell(cmd_string) shell(cmd_string)
rule registration: rule registration:
input: "{xml_base}-{file_id}-00.h5" input: "{xml_base}-{file_id}-00.h5"
......
...@@ -9,18 +9,19 @@ ...@@ -9,18 +9,19 @@
"define_xml_czi" : "define_xml_czi" :
{ {
"pixel_distance_x" : "0.2875535786151886" # Manual calibration x "first_xml_filename" : "\"Stock68\"",
"pixel_distance_y" : "0.2875535786151886" # Manual calibration y "pixel_distance_x" : "0.2875535786151886",
"pixel_distance_z" : "1.50000" # Manual calibration z "pixel_distance_y" : "0.2875535786151886",
"pixel_unit" : "um" # unit of manual calibration "pixel_distance_z" : "1.50000",
"first_czi" : "2015-02-21_LZ1_Stock68_3.czi" "pixel_unit" : "um",
"angle_1" : "0" "first_czi" : "2015-02-21_LZ1_Stock68_3.czi",
"angle_2" : "72" "angle_1" : "0",
"angle_3" :"144" "angle_2" : "72",
"angle_4" :"216" "angle_3" :"144",
"angle_5" : "288" "angle_4" :"216",
"illumination_1" : "0" "angle_5" : "288",
"bsh_file" : "define_czi.bsh" "illumination_1" : "0",
"bsh_file" : "define_czi.bsh"
}, },
"registration" : "registration" :
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment