Download any number of byte ranges from a Gesel database file.

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

Arguments

name

String containing the name of the file. This usually has the species identifier as a prefix.

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.

Author

Aaron Lun

Examples

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