From 1a2b62e5987b02dc13df415b18801214bca2fd12 Mon Sep 17 00:00:00 2001 From: Kdreval Date: Fri, 21 Jan 2022 12:57:09 -0800 Subject: [PATCH] allow using local fasta files in reference_files --- .../2.4/reference_files_header.smk | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/workflows/reference_files/2.4/reference_files_header.smk b/workflows/reference_files/2.4/reference_files_header.smk index 20479bd6..d2326396 100644 --- a/workflows/reference_files/2.4/reference_files_header.smk +++ b/workflows/reference_files/2.4/reference_files_header.smk @@ -173,16 +173,22 @@ for chrom_map_file in CHROM_MAPPINGS_FILES: rule download_genome_fasta: - output: + output: fasta = "downloads/genome_fasta/{genome_build}.fa" - log: + log: "downloads/genome_fasta/{genome_build}.fa.log" wildcard_constraints: genome_build = ".+(? {output.fasta} 2> {log}" + op.as_one_line(""" + if [ -e {params.path} ]; then + cat {params.path} > {output.fasta} 2> {log}; + else + curl -L {params.path} > {output.fasta} 2> {log}; + fi + """) rule download_masked_genome_fasta: output: