Skip to content

Commit cc5b311

Browse files
committed
igblastr 1.1.4: Add utilities to update IgBLAST auxiliary and internal data
NCBI occasionally updates some of the files in the 'internal_data/' and 'optional_file/' directories between IgBLAST releases, and it is recommended to use the new files. They make the new files available at https://ftp.ncbi.nih.gov/blast/executables/igblast/release/patch/ The user can now install these new files by calling update_live_igdata(). See '?update_live_igdata' for more information.
1 parent 35a2533 commit cc5b311

153 files changed

Lines changed: 639 additions & 281 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎DESCRIPTION‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Description: The igblastr package provides functions to conveniently install
77
biocViews: Immunology, Immunogenetics, ImmunoOncology, CellBiology
88
URL: https://bioconductor.org/packages/igblastr
99
BugReports: https://github.com/HyrienLab/igblastr/issues
10-
Version: 1.1.3
10+
Version: 1.1.4
1111
License: Artistic-2.0
1212
Encoding: UTF-8
1313
Authors@R: c(
@@ -24,7 +24,7 @@ Authors@R: c(
2424
Depends: R (>= 4.2.0), tibble, Biostrings
2525
Imports: methods, utils, stats, tools,
2626
R.utils, curl, httr, xml2, rvest, xtable, jsonlite,
27-
S4Vectors, IRanges, GenomeInfoDb
27+
S4Vectors, IRanges, GenomeInfoDb (>= 1.47.2)
2828
Suggests: GenomicAlignments, parallel, testthat, knitr, rmarkdown,
2929
BiocStyle, ggplot2, dplyr, scales, ggseqlogo
3030
VignetteBuilder: knitr
@@ -43,7 +43,7 @@ Collate:
4343
get_igblast_root.R
4444
edit_imgt_file.R
4545
igblast_info.R
46-
auxiliary-data-utils.R
46+
igdata-utils.R
4747
install_igblast.R
4848
make_blastdbs.R
4949
create_region_db.R

‎NAMESPACE‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import(methods)
22

33
importFrom(utils, download.file, untar, unzip, read.table, browseURL, URLencode)
44
importFrom(stats, setNames)
5-
importFrom(tools, R_user_dir, file_path_as_absolute)
5+
importFrom(tools, R_user_dir, file_path_as_absolute, md5sum)
66

77
importFrom(R.utils, gunzip)
88
importFrom(curl, has_internet)
@@ -15,7 +15,7 @@ import(tibble)
1515

1616
import(S4Vectors)
1717
import(IRanges)
18-
import(GenomeInfoDb)
18+
importFrom(GenomeInfoDb, list_ftp_dir)
1919
import(Biostrings)
2020

2121

@@ -27,11 +27,12 @@ S3method(print, alignment_summary)
2727
S3method(print, c_region_dbs_df)
2828
S3method(print, fmt7footer)
2929
S3method(print, fmt7record)
30-
S3method(print, outfmt7_specifiers)
3130
S3method(print, germline_dbs_df)
3231
S3method(print, hit_table)
3332
S3method(print, igblast_info)
3433
S3method(print, igblastn_raw_output)
34+
S3method(print, igdata_info)
35+
S3method(print, outfmt7_specifiers)
3536
S3method(print, query_details)
3637
S3method(print, subregion_sequence_details)
3738
S3method(print, VDJ_junction_details)
@@ -48,11 +49,12 @@ export(
4849
print.c_region_dbs_df,
4950
print.fmt7footer,
5051
print.fmt7record,
51-
print.outfmt7_specifiers,
5252
print.germline_dbs_df,
5353
print.hit_table,
5454
print.igblast_info,
5555
print.igblastn_raw_output,
56+
print.igdata_info,
57+
print.outfmt7_specifiers,
5658
print.query_details,
5759
print.subregion_sequence_details,
5860
print.VDJ_junction_details,
@@ -75,9 +77,10 @@ export(
7577
list_igblast_organisms,
7678
igblastn_version, makeblastdb_version, igblast_build, igblast_info,
7779

78-
## auxiliary-data-utils.R:
79-
get_igblast_auxiliary_data,
80-
load_igblast_auxiliary_data,
80+
## igdata-utils.R:
81+
reset_live_igdata, update_live_igdata,
82+
time_since_live_igdata_last_checked, igdata_info,
83+
get_igblast_auxiliary_data, load_igblast_auxiliary_data,
8184

8285
## install_igblast.R:
8386
install_igblast,

‎R/auxiliary-data-utils.R‎

Lines changed: 0 additions & 90 deletions
This file was deleted.

‎R/builtin_db-utils.R‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ create_all_builtin_germline_dbs <- function(destdir)
128128
## rename the temporary folder to 'destdir'. Otherwise we destroy the
129129
## temporary folder and raise an error. This achieves atomicity.
130130
tmp_destdir <- tempfile("builtin_germline_dbs_")
131-
dir.create(tmp_destdir, recursive=TRUE)
131+
dir.create(tmp_destdir)
132132
on.exit(nuke_file(tmp_destdir))
133133

134134
create_missing_builtin_germline_dbs(tmp_destdir)
@@ -186,7 +186,7 @@ create_all_builtin_c_region_dbs <- function(destdir)
186186
## rename the temporary folder to 'destdir'. Otherwise we destroy the
187187
## temporary folder and raise an error. This achieves atomicity.
188188
tmp_destdir <- tempfile("builtin_c_region_dbs_")
189-
dir.create(tmp_destdir, recursive=TRUE)
189+
dir.create(tmp_destdir)
190190
on.exit(nuke_file(tmp_destdir))
191191

192192
## Create IMGT C-region dbs.

‎R/cache-utils.R‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,28 @@
1010
### compartment path
1111
### ---------------- ------------------------------------
1212
### IGBLAST_ROOTS <igblastr-cache>/igblast_roots
13+
### LIVE_IGDATA <igblastr-cache>/live_igdata
1314
### GERMLINE_DBS <igblastr-cache>/germline_dbs
1415
### C_REGION_DBS <igblastr-cache>/c_region_dbs
1516
### IMGT_LOCAL_STORE <igblastr-cache>/store/IMGT-releases
1617
###
1718
### Always use the igblastr_cache() function implemented in this file to
18-
### construct these paths.
19+
### obtain these paths.
1920

2021
IGBLAST_ROOTS <- "IGBLAST_ROOTS"
22+
LIVE_IGDATA <- "LIVE_IGDATA"
2123
GERMLINE_DBS <- "GERMLINE_DBS"
2224
C_REGION_DBS <- "C_REGION_DBS"
2325
IMGT_LOCAL_STORE <- "IMGT_LOCAL_STORE"
2426

25-
2627
### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2728
### igblastr_cache()
2829
###
2930

30-
.IGBLASTR_CACHES <- c(IGBLAST_ROOTS, GERMLINE_DBS,
31-
C_REGION_DBS, IMGT_LOCAL_STORE)
31+
.IGBLASTR_CACHES <- c(IGBLAST_ROOTS, LIVE_IGDATA,
32+
GERMLINE_DBS, C_REGION_DBS, IMGT_LOCAL_STORE)
3233

33-
### Returns the path to the cache compartment specified via 'which'.
34+
### Returns **absolute** path to the cache compartment specified via 'which'.
3435
igblastr_cache <- function(which=NULL)
3536
{
3637
path <- getOption("igblastr_cache", R_user_dir("igblastr", "cache"))
@@ -39,6 +40,7 @@ igblastr_cache <- function(which=NULL)
3940
stopifnot(isSingleNonWhiteString(which))
4041
switch(which,
4142
IGBLAST_ROOTS =file.path(path, "igblast_roots"),
43+
LIVE_IGDATA =file.path(path, "live_igdata"),
4244
GERMLINE_DBS =file.path(path, "germline_dbs"),
4345
C_REGION_DBS =file.path(path, "c_region_dbs"),
4446
IMGT_LOCAL_STORE=file.path(path, "store", "IMGT-releases"),

‎R/create_c_region_db.R‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ create_c_region_db <- function(fasta_dir, loci, destdir, force=FALSE)
9191
## avoids loosing the content of the existing 'destdir' in case something
9292
## goes wrong.
9393
tmp_destdir <- tempfile("c_region_db_")
94-
dir.create(tmp_destdir, recursive=TRUE)
94+
dir.create(tmp_destdir)
9595
on.exit(nuke_file(tmp_destdir))
9696
create_region_db(fasta_files, tmp_destdir, region_type="C")
9797
rename_file(tmp_destdir, destdir, replace=TRUE)

‎R/create_germline_db.R‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ create_germline_db <- function(fasta_dir, loci, destdir, force=FALSE)
160160
## atomicity and avoids loosing the content of the existing 'destdir' in
161161
## case something goes wrong.
162162
tmp_destdir <- tempfile("germline_db_")
163-
dir.create(tmp_destdir, recursive=TRUE)
163+
dir.create(tmp_destdir)
164164
on.exit(nuke_file(tmp_destdir))
165165
.create_VDJ_region_dbs(fasta_dir, loci, tmp_destdir)
166166
rename_file(tmp_destdir, destdir, replace=TRUE)

‎R/igblast_info.R‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,7 @@ igblast_build <- function(igblast_root=get_igblast_root())
103103

104104
print.igblast_info <- function(x, ...)
105105
{
106-
x <- lapply(x, function(x) paste(x, collapse="; "))
107-
x <- paste0(names(x), ": ", as.character(x))
108-
cat(x, sep="\n")
106+
cat(named_list_as_character(x), sep="\n")
109107
}
110108

111109
igblast_info <- function(igblast_root=get_igblast_root())

‎R/igblastn.R‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ print.igblastn_raw_output <- function(x, ...) cat(x, sep="\n")
233233
stopifnot(is.character(exe_args))
234234
igblastn_exe <- get_igblast_exe("igblastn", igblast_root=igblast_root)
235235
oldwd <- getwd()
236-
setwd(igblast_root)
236+
setwd(igblastr_cache(LIVE_IGDATA))
237237
on.exit(setwd(oldwd))
238238

239239
stderr_file <- tempfile("igblastn_stderr_", fileext=".txt")

0 commit comments

Comments
 (0)