Skip to content

Commit

Permalink
fix download ftp links
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmeaton committed Sep 7, 2021
1 parent 6538c5c commit b4729f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion workflow/rules/download.smk
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 4 additions & 2 deletions workflow/rules/functions.smk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit b4729f1

Please sign in to comment.