Commit df0bbc29 authored by Blaise Li's avatar Blaise Li
Browse files

Upload data even when pipeline fails.

parent ec415549
......@@ -623,9 +623,12 @@ bam2bigwig.sh: bedGraphToBigWig failed
onsuccess:
print("iCLIP data pre-processing finished.")
print("iCLIP data analysis finished.")
cleanup_and_backup(output_dir, config)
onerror:
print("iCLIP data pre-processing failed.")
shell(f"rm -rf {output_dir}_err")
shell(f"cp -rp {output_dir} {output_dir}_err")
cleanup_and_backup(output_dir + "_err", config)
print("iCLIP data analysis failed.")
......@@ -1537,5 +1537,8 @@ onsuccess:
cleanup_and_backup(output_dir, config)
onerror:
shell(f"rm -rf {output_dir}_err")
shell(f"cp -rp {output_dir} {output_dir}_err")
cleanup_and_backup(output_dir + "_err", config)
print("PRO-seq analysis failed.")
......@@ -3865,20 +3865,11 @@ def try_to_cluster_genes(counts_data):
onsuccess:
print("small RNA-seq analysis finished.")
cleanup_and_backup(output_dir, config)
# print("removing metadata")
# # https://stackoverflow.com/a/45614282/1878788
# rmtree(".snakemake/metadata")
# if config.get("backup", {}):
# user = config["backup"]["user"]
# if user == "USER":
# user = os.environ[user]
# host = config["backup"]["host"]
# # If no dest_dir, we assume the directory structure
# # is the same on the destination host
# dest_dir = config["backup"].get("dest_dir", os.getcwd())
# print(f"backuping results to {user}@{host}:{dest_dir}")
# shell(f"rsync -vaP {output_dir} {user}@{host}:{dest_dir}")
onerror:
shell(f"rm -rf {output_dir}_err")
shell(f"cp -rp {output_dir} {output_dir}_err")
cleanup_and_backup(output_dir + "_err", config)
print("small RNA-seq analysis failed.")
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment