Skip to content

Commit

Permalink
Download new taxdmp.zip as part of setup_gb
Browse files Browse the repository at this point in the history
  • Loading branch information
joelnitta committed Nov 1, 2024
1 parent 20f6874 commit 097d85c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions R/setup_gb.R
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,22 @@ archive::archive_write_files(
filter = "gzip"
)

# Also download new taxdump file,
# store previous one as 'bak'
# This needs to be done *after* GenBank data are downloaded so that all
# GenBank taxonomic data is up-to-date
taxdmp_path <- "_targets/user/data_raw/taxdmp.zip"

if (file_exists(taxdmp_path)) {
file_move(
taxdmp_path,
"_targets/user/data_raw/taxdmp.zip.bak"
)
}

download.file(
"https://ftp.ncbi.nlm.nih.gov/pub/taxonomy/taxdmp.zip", taxdmp_path)

# Cleanup ----

# Download done, so delete "running" file
Expand Down
1 change: 1 addition & 0 deletions _targets.R
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ tar_plan(
),
# Load taxdump file downloaded from
# https://ftp.ncbi.nlm.nih.gov/pub/taxonomy/taxdmp.zip
# This is automatically downloaded by setup_gb.R for each new GenBank release
tar_file(
taxdump_zip_file,
path(data_raw, "taxdmp.zip")
Expand Down

0 comments on commit 097d85c

Please sign in to comment.