From b4729f1d19bee280e067c4884bd98121269702cc Mon Sep 17 00:00:00 2001 From: Katherine Eaton Date: Tue, 7 Sep 2021 14:25:07 -0400 Subject: [PATCH] fix download ftp links --- workflow/rules/download.smk | 2 +- workflow/rules/functions.smk | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/workflow/rules/download.smk b/workflow/rules/download.smk index 131939f0..77a313af 100644 --- a/workflow/rules/download.smk +++ b/workflow/rules/download.smk @@ -38,7 +38,7 @@ rule download_assembly: reads_origin = "(reference|assembly)", params: ftp = lambda wildcards: [ - ftp for ftp in + "{}.{}.gz".format(ftp, wildcards.ext) for ftp in globals()["identify_" + wildcards.reads_origin + "_ftp"]() if wildcards.sample in ftp][0] resources: diff --git a/workflow/rules/functions.smk b/workflow/rules/functions.smk index 9d691fc9..c5d119c5 100644 --- a/workflow/rules/functions.smk +++ b/workflow/rules/functions.smk @@ -27,7 +27,8 @@ def identify_reference_ftp(): conn = sqlite3.connect(sqlite_db_path) cur = conn.cursor() ref_url = cur.execute(config["sqlite_select_command_ref"]).fetchone()[0] - ref_fna_gz = ref_url.split("/")[9] + "_genomic.fna.gz" + #ref_fna_gz = ref_url.split("/")[9] + "_genomic.fna.gz" + ref_fna_gz = ref_url.split("/")[9] + "_genomic" ref_url = [ref_url + "/" + ref_fna_gz] cur.close() return ref_url @@ -66,7 +67,8 @@ def identify_assembly_ftp(): if len(asm_ftp_list) >= max_datasets: break if url: - asm_ftp_list.append(url + "/"+ url.split("/")[9] + "_genomic.fna.gz") + #asm_ftp_list.append(url + "/"+ url.split("/")[9] + "_genomic.fna.gz") + asm_ftp_list.append(url + "/"+ url.split("/")[9] + "_genomic") cur.close() return asm_ftp_list