diff --git a/CLIP/iCLIP.snakefile b/CLIP/iCLIP.snakefile index c7955cf2d2639714c125ad35d1ebc8cfdcc9b0c8..cb477b3bab0ffea57fae30e31dfa41e54c6b9041 100644 --- a/CLIP/iCLIP.snakefile +++ b/CLIP/iCLIP.snakefile @@ -720,7 +720,7 @@ rule make_normalized_bigwig: onsuccess: print("iCLIP data analysis finished.") - cleanup_and_backup(output_dir, config) + cleanup_and_backup(output_dir, config, delete=True) onerror: shell(f"rm -rf {output_dir}_err") diff --git a/Degradome-seq/Degradome-seq.snakefile b/Degradome-seq/Degradome-seq.snakefile index b4fbc43a4f2de035c4e19d689b58a88295cf8885..61dda0f3bc05d9b2360cebf9f89b06a629e6eb48 100644 --- a/Degradome-seq/Degradome-seq.snakefile +++ b/Degradome-seq/Degradome-seq.snakefile @@ -59,7 +59,7 @@ CONTRAST2PAIR = dict(zip(DD_CONTRASTS, DD_COND_PAIRS)) # TODO: have a distinct subset of biotypes for join_all_counts, that are guaranteed overlap-free. BIOTYPES = config["biotypes"] -ORIENTATIONS = ["all"] +ORIENTATIONS = ["all", "fwd", "rev"] aligner = config["aligner"] alignment_settings = { @@ -516,7 +516,7 @@ rule compute_efficiency_difference: onsuccess: print("Degradome-seq analysis finished.") - cleanup_and_backup(output_dir, config) + cleanup_and_backup(output_dir, config, delete=True) onerror: shell(f"rm -rf {output_dir}_err") diff --git a/PRO-seq/PRO-seq.snakefile b/PRO-seq/PRO-seq.snakefile index 116aa1b5a597517fbe13227a7c7c947089d86bef..62f8ea692467c2395e89b5c9ae24aa44f1c86d26 100644 --- a/PRO-seq/PRO-seq.snakefile +++ b/PRO-seq/PRO-seq.snakefile @@ -1687,7 +1687,7 @@ rm -rf ${{tmpdir}} onsuccess: print("PRO-seq analysis finished.") - cleanup_and_backup(output_dir, config) + cleanup_and_backup(output_dir, config, delete=True) onerror: shell(f"rm -rf {output_dir}_err") diff --git a/RNA_Seq_Cecere/RNA-seq.snakefile b/RNA_Seq_Cecere/RNA-seq.snakefile index 9001c89cbbc729be025fc926c505fdfa2e580140..66c4defa2eef660e93c8513bce2daacd8e176995 100644 --- a/RNA_Seq_Cecere/RNA-seq.snakefile +++ b/RNA_Seq_Cecere/RNA-seq.snakefile @@ -2020,7 +2020,7 @@ rule make_contrast_lfc_boxplots: onsuccess: print("RNA-seq analysis finished.") - cleanup_and_backup(output_dir, config) + cleanup_and_backup(output_dir, config, delete=True) onerror: shell(f"rm -rf {output_dir}_err") diff --git a/Ribo-seq/Ribo-seq.snakefile b/Ribo-seq/Ribo-seq.snakefile index cf060f68dc2ccefeacf8441ff3ad1d7d631a6b18..e42ee98bc947446de0316073f4edcd893472659b 100644 --- a/Ribo-seq/Ribo-seq.snakefile +++ b/Ribo-seq/Ribo-seq.snakefile @@ -3467,7 +3467,7 @@ def try_to_cluster_genes(counts_data): onsuccess: print("small RNA-seq analysis finished.") - cleanup_and_backup(output_dir, config) + cleanup_and_backup(output_dir, config, delete=True) onerror: diff --git a/libworkflows/libworkflows/libworkflows.py b/libworkflows/libworkflows/libworkflows.py index 5afa22fae39ad5275948a617e50e8b4213572d25..2fbb7d109402be9058aeb4d10bcf5138e12514cb 100644 --- a/libworkflows/libworkflows/libworkflows.py +++ b/libworkflows/libworkflows/libworkflows.py @@ -128,7 +128,7 @@ def wc_applied(source_function): return wc_applied_source_func -def cleanup_and_backup(output_dir, config): +def cleanup_and_backup(output_dir, config, delete=False): """Performs cleanup and backup according to the information present in the *config* dictionary.""" print("removing metadata") @@ -142,6 +142,10 @@ def cleanup_and_backup(output_dir, config): # 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()) + if delete: + rsync_options = "-vaP --delete" + else: + rsync_options = "-vaP" try: print(f"backuping results to {user}@{host}:{dest_dir}") shell(f"rsync -vaP {output_dir} {user}@{host}:{dest_dir}") diff --git a/small_RNA-seq/small_RNA-seq.snakefile b/small_RNA-seq/small_RNA-seq.snakefile index fda01ed063c03a4bf39ae1539055decf622a25ee..912a0d902d937d3063ae8f1383b067b037a8ecbe 100644 --- a/small_RNA-seq/small_RNA-seq.snakefile +++ b/small_RNA-seq/small_RNA-seq.snakefile @@ -4346,7 +4346,7 @@ def try_to_cluster_genes(counts_data): onsuccess: print("small RNA-seq analysis finished.") - cleanup_and_backup(output_dir, config) + cleanup_and_backup(output_dir, config, delete=True) onerror: