Skip to content

Commit 8722a47

Browse files
committed
Fix lints
1 parent b7d3841 commit 8722a47

File tree

17 files changed

+68
-51
lines changed

17 files changed

+68
-51
lines changed

.lintr

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
encoding: "UTF-8"
2+
linters: linters_with_defaults(
3+
line_length_linter = NULL,
4+
object_name_linter = NULL,
5+
object_length_linter = NULL,
6+
commented_code_linter = NULL,
7+
trailing_blank_lines_linter = NULL,
8+
trailing_whitespace_linter(allow_empty_lines = TRUE)
9+
)

DESCRIPTION

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Roxygen: list(markdown = TRUE)
1717
RoxygenNote: 7.3.2
1818
Collate:
1919
'count.R'
20-
'ena.R'
2120
'process.R'
2221
'fetch.R'
2322
'id_set.R'

R/count.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#' Count the number of entries in an ID set
2-
#'
2+
#'
33
#' If `id_set` is an [`id_list`] then this is equivalent to `length()`.
44
#' If it is a `web_history`, this may involve an Entrez API call to get the
55
#' number of entries. In this case the result is cached so that subsequent

R/fetch.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#' Fetch records from Entrez
2-
#'
2+
#'
33
#' Fetching can be slow, and Entrez will time out requests that take too long.
44
#' This helper supports pagination if you specify `retmax`.
5-
#'
5+
#'
66
#' @family API methods
77
#' @param id_set ID set object.
88
#' @param retstart integer: index of first result (starts from 0).
@@ -65,11 +65,11 @@ efetch <- function(
6565
}
6666

6767
#' Fetch document summaries from Entrez
68-
#'
68+
#'
6969
#' ESummary is faster than EFetch because it only interacts with the frontend
7070
#' rather than the full database. It contains more limited information.
7171
#' Consider adding `version = "2.0"` to request the revised output format.
72-
#'
72+
#'
7373
#' @family API methods
7474
#' @param version character: requested format version.
7575
#' @inheritParams efetch

R/id_set.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22
NULL
33

44
#' Entrez identifier sets
5-
#'
5+
#'
66
#' Many Entrez APIs accept either a UID list or tokens that point to a result stored
77
#' on its history server. The classes here wrap these and keep track of the
88
#' database name that the identifiers belong to. Most of the API helpers in this
99
#' package are generic over the type of ID set and so can be used the same way with
1010
#' either type. For large numbers of UIDs, the web history versions are generally
1111
#' recommended to avoid running into server-side request timeouts.
12-
#'
12+
#'
1313
#' `id_list` is a vector and can be manipulated to take subsets (e.g. `id_set[1:10]` or
1414
#' `tail(id_set)`).
15-
#'
15+
#'
1616
#' `web_history` is an opaque reference to an ID list stored on the Entrez
1717
#' history server. Through the course of API calls, information about the length or
1818
#' the actual list of IDs may be discovered and cached, avoiding subsequent API calls.
1919
#' `as_id_list()` can be used to extract the list of IDs.
20-
#'
20+
#'
2121
#' Convert `id_list` to `web_history` with [`epost()`].
2222
#' Convert `web_history` to `id_list` with `as_id_list()`.
23-
#'
23+
#'
2424
#' @rdname id_set
2525
#' @param db name of the associated Entrez database (e.g. `"biosample"`).
2626
#' @param ids UIDs, coercible to a character vector (can be accessions or GI numbers).
@@ -192,7 +192,7 @@ check_compatible_db <- function(
192192
}
193193

194194
#' Check ID set is well formed
195-
#'
195+
#'
196196
#' @param x ID set object.
197197
#' @param database name of intended database.
198198
#' If `NULL` the database name is not checked.
@@ -217,7 +217,7 @@ check_id_set <- function(
217217
}
218218

219219
if (!is.null(database)) {
220-
actual_db <- entrez_database(x)
220+
actual_db <- entrez_database(x)
221221
if (database != actual_db) {
222222
cli::cli_abort(c(
223223
"{.arg {arg}} is an ID set from the wrong Entrez database",

R/id_set_validate.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#' Look up accessions and other IDs on Entrez
2-
#'
2+
#'
33
#' Passes the provided IDs through Entrez which has the effect of normalising the
44
#' accepted UIDs, and removing invalid UIDs.
55
#' For web history lists, this forces results to be freshly downloaded
66
#' (unlike [`as_id_list()`] which can use cached results).
7-
#'
7+
#'
88
#' @family API methods
99
#' @inheritParams epost
1010
#' @inheritParams efetch
@@ -43,7 +43,7 @@ as_id_list <- function(x, .paginate = 5000L, .path = NULL, .call = current_env()
4343

4444
ids <- wh_ids_get(x)
4545
if (is.null(ids)) {
46-
res <- download_web_history(x, .paginate = .paginate, .path = .path, .call = .call)
46+
res <- download_web_history(x, .paginate = .paginate, .path = .path, .call = .call)
4747
ids <- il_ids_get(res)
4848
wh_ids_set(x, ids)
4949
}

R/info.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#' Get details about Entrez databases
2-
#'
2+
#'
33
#' These functions call the EInfo endpoint. `einfo()` provides the number
44
#' of entries in the databases, the name and description, list of terms
55
#' usable in the query syntax, and list of link names usable with the ELink
66
#' endpoint.
7-
#'
7+
#'
88
#' @param db name of database to provide information about.
99
#' @param retmode response format.
1010
#' @param version response format version.

R/jentre-package.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#' jentre: Toolkit for the 'Entrez' API
2-
#'
2+
#'
33
#' To use this package effectively, you should have some understanding of
44
#' the design of the Entrez API which is documented at
55
#' <https://www.ncbi.nlm.nih.gov/books/NBK25500/>.
66
#' Helper functions will make it easier to avoid common pitfalls, and to
77
#' make use of features like pagination, but you'll still need to understand
88
#' how to structure your requests efficiently to avoid undue load.
9-
#'
9+
#'
1010
#' Entrez API usage is subject to guidelines that are available at the URL above.
1111
#' Entrez datasets are also subject to copyright. Refer to the NCBI policies at
1212
#' <https://www.ncbi.nlm.nih.gov/home/about/policies/> for details.

R/link.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#' ELink API for fetching links between databases
2-
#'
2+
#'
33
#' `elink()` offers direct access to the ELink API endpoint, which has many different
44
#' input and output formats depending on parameters. If you just want a one-to-one
55
#' mapping of `neighbor` links, use `elink_map()`, which handles this for you.
6-
#'
6+
#'
77
#' @section One-to-one mapping:
88
#' Note that some ways of calling this API on multiple UIDs result in the one-to-one
99
#' association of the input and output sets getting lost. The way around this is to
@@ -12,7 +12,7 @@
1212
#' history token as input, there is no corresponding way to ensure one-to-one mapping.
1313
#' To ensure that the result is always one-to-one, use `elink_map()`, which may make
1414
#' several API requests to achieve the result.
15-
#'
15+
#'
1616
#' @family API methods
1717
#' @inheritParams entrez_request
1818
#' @param id_set ID set object.

R/post.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#' Register UIDs with the Entrez history server
2-
#'
2+
#'
33
#' @param id_set an [`id_list`] object.
44
#' @param WebEnv either a character to pass on as-is, or a [`web_history`] object.
55
#' @inheritParams entrez_request

0 commit comments

Comments
 (0)