Skip to content

Commit

Permalink
allow using local fasta files in reference_files
Browse files Browse the repository at this point in the history
  • Loading branch information
Kdreval committed Jan 21, 2022
1 parent 689b5ee commit 1a2b62e
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions workflows/reference_files/2.4/reference_files_header.smk
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ".+(?<!masked)"
params:
url = lambda w: config["genome_builds"][w.genome_build]["genome_fasta_url"]
params:
path = lambda w: config["genome_builds"][w.genome_build]["genome_fasta_file"] if "genome_fasta_file" in config["genome_builds"][w.genome_build] else config["genome_builds"][w.genome_build]["genome_fasta_url"],
shell:
"curl -L {params.url} > {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:
Expand Down

0 comments on commit 1a2b62e

Please sign in to comment.