Download any number of byte ranges from a Gesel database file using (possibly multi-part) HTTP range requests.

downloadDatabaseRanges(
  name,
  start,
  end,
  url = databaseUrl(),
  multipart = FALSE,
  concurrency = rangeConcurrency()
)

Arguments

name

String containing the name of a Gesel database file. This usually has the species identifier as a prefix, e.g., "9606_set2gene.tsv.gz".

start

Integer vector containing the zero-indexed closed start of each byte range to extract from the file. This may be of zero length.

end

Integer vector containing the zero-indexed open end of each byte range to extract from the file. This should have the same length as start such that the i-th range is defined as [start[i], end[i]). All ranges supplied in a single call to this function should be non-overlapping.

url

String containing the base URL to the Gesel database files.

multipart

Boolean indicating whether the server at url supports multi-part range requests.

concurrency

Integer specifying the maximum number of concurrent range requests per second. Ignored if multipart=TRUE.

Value

List of length equal to length(start). Each entry is a raw vector representing the contents of the corresponding byte range.

See also

readDatabaseRanges, for a local counterpart to this function that reads byte ranges from the filesystem.

Author

Aaron Lun

Examples

downloadDatabaseRanges("9606_set2gene.tsv", 0L, 100L)
#> [[1]]
#>   [1] 31 31 36 39 31 09 31 35 33 36 0a 38 35 39 09 36 33 32 09 31 32 38 38 09 32
#>  [26] 32 39 36 09 31 34 38 09 39 34 09 33 31 37 36 09 32 36 34 30 09 33 34 32 09
#>  [51] 33 32 32 09 36 30 37 36 09 36 39 36 39 0a 31 34 34 33 09 34 31 09 35 09 31
#>  [76] 35 36 31 09 31 30 37 38 09 33 35 32 09 32 34 32 37 09 31 33 36 09 32 39 33
#> 
downloadDatabaseRanges("9606_set2gene.tsv", c(10, 100, 1000), c(20, 150, 1100))
#> [[1]]
#>  [1] 0a 38 35 39 09 36 33 32 09 31
#> 
#> [[2]]
#>  [1] 39 09 32 39 34 39 0a 31 34 34 35 09 32 09 31 09 31 38 37 31 34 0a 32 37 35
#> [26] 34 0a 34 35 36 33 09 31 0a 32 34 36 39 09 32 31 30 09 32 09 38 30 39 32 09
#> 
#> [[3]]
#>   [1] 09 31 31 09 32 31 09 31 33 30 09 31 31 09 34 09 36 32 09 32 31 31 09 35 33
#>  [26] 09 31 30 09 36 36 34 09 35 09 37 38 09 32 33 31 09 32 39 09 32 33 09 37 31
#>  [51] 30 09 32 09 33 38 37 09 32 38 35 09 32 32 39 09 34 34 35 09 32 39 37 09 31
#>  [76] 32 36 09 34 09 32 38 09 37 39 09 36 36 09 37 39 09 33 33 39 09 39 31 09 31
#>