Skip to content
Snippets Groups Projects
Commit e464b786 authored by Peter Steinbach's avatar Peter Steinbach
Browse files

fixed wrong distclean target; fixed file_id increase through wildcards object; cleaned messages;

parent 617f5625
No related branches found
No related tags found
No related merge requests found
......@@ -43,7 +43,6 @@ rule resave_prepared:
rule define_xml_czi:
input: config["define_xml_czi"]["first_czi"]
output: config["common"]["first_xml_filename"] + ".xml"
message: "Execute define_xml_czi on the following files {input}"
log: "define_xml_czi.log"
run:
cmd_string = produce_string(
......@@ -70,14 +69,13 @@ rule define_xml_czi:
jdir=JOBDIR,
path_bsh=config["common"]["bsh_directory"] + config["define_xml_czi"]["bsh_file"])
cmd_string += "> {log} 2>&1 && touch {output}"
cmd_string += " > {log} 2>&1"
shell(cmd_string)
# defining xml for tif dataset
rule define_xml_tif:
input: glob.glob('*.tif')
output: config["common"]["first_xml_filename"] + ".xml"
message: "Execute define_xml_tif on the following files {input}"
log: "define_xml_tif.log"
run:
cmd_string = produce_string(
......@@ -104,7 +102,7 @@ rule define_xml_tif:
jdir=JOBDIR,
path_bsh=config["common"]["bsh_directory"] + config["define_xml_tif"]["bsh_file"])
cmd_string +="> {log} 2>&1 && touch {output}"
cmd_string +=" > {log} 2>&1"
shell(cmd_string)
ruleorder: define_xml_tif > define_xml_czi
......@@ -137,19 +135,18 @@ rule hdf5_xml:
jdir=JOBDIR,
path_bsh=config["common"]["bsh_directory"] + config["resave_hdf5"]["bsh_file"])
part_string += "> {log} 2>&1"
part_string += " > {log} 2>&1 && touch {output}"
shell(part_string)
#create dummy files according to the number of timepoints found
for index in range(int(config["common"]["ntimepoints"])):
shell("touch {basename}-0{file_id}-00.h5_empty".format(basename=config["common"]["hdf5_xml_filename"], file_id=index)) # problematic needs padding of file_id
# for index in range(int(config["common"]["ntimepoints"])):
# shell("touch {basename}-0{file_id}-00.h5_empty".format(basename=config["common"]["hdf5_xml_filename"], file_id=index)) # problematic needs padding of file_id
# resave .czi dataset as hdf5
rule resave_hdf5:
input: "{xml_base}-{file_id,\d+}-00.h5_empty" # rules.hdf5_xml.output
output: "{xml_base}-{file_id,\d+}-00.h5"
message: "Execute resave_hdf5 on {input}"
log: "resave_hdf5-{file_id}.log"
run:
part_string = produce_string(
......@@ -173,8 +170,8 @@ rule resave_hdf5:
jdir=JOBDIR,
path_bsh=config["common"]["bsh_directory"] + config["resave_hdf5"]["bsh_file"],
input_xml_base="{wildcards.xml_base}",
job_number=int("{wildcards.file_id}")+1) # problematic calculation not possible in cannot deal wiht wildcards file_id
part_string += "> {log} 2>&1"
job_number=int(wildcards.file_id)+1) # problematic calculation not possible in cannot deal wiht wildcards file_id
part_string += " > {log} 2>&1"
shell(part_string)
rule registration:
......@@ -395,4 +392,7 @@ rule deconvolution:
shell(cmd_string)
rule distclean:
shell : "rm -rf *registered *tif *log *_deconvolved *.xml~* interestpoints "+str(" ".join(xml_merge_in))
params : glob.glob(config["common"]["hdf5_xml_filename"].strip('\"')+"*"), glob.glob(config["common"]["first_xml_filename"].strip('\"')+"*"), glob.glob("*registered"), glob.glob("*log"), glob.glob("*_deconvolved"), glob.glob("*.xml~*"),"interestpoints", glob.glob("*empty"), expand("{dataset}.{suffix}",dataset=[ config["common"]["hdf5_xml_filename"].strip('\"')], suffix=["xml","h5"])# xml_merge_in,
message : "removing {params}"
shell : "rm -rf {params}"
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