mirror of
https://github.com/johrpan/geposan.git
synced 2025-10-26 10:47:25 +01:00
Reindent code to use just two spaces
This commit is contained in:
parent
a1e6147466
commit
c04b6337e9
17 changed files with 1583 additions and 1582 deletions
|
|
@ -5,23 +5,23 @@ ensembl_api_url <- "https://rest.ensembl.org"
|
|||
|
||||
#' Perform a request to the Ensembl REST API.
|
||||
ensembl_request <- function(api_path) {
|
||||
content(stop_for_status(GET(
|
||||
paste0(ensembl_api_url, api_path),
|
||||
content_type_json()
|
||||
)))
|
||||
content(stop_for_status(GET(
|
||||
paste0(ensembl_api_url, api_path),
|
||||
content_type_json()
|
||||
)))
|
||||
}
|
||||
|
||||
#' Get IDs of all available vertebrates.
|
||||
get_species_ids <- function() {
|
||||
species <- ensembl_request("/info/species")$species
|
||||
sapply(species, function(species) species$name)
|
||||
species <- ensembl_request("/info/species")$species
|
||||
sapply(species, function(species) species$name)
|
||||
}
|
||||
|
||||
#' Get all chromosomes names for a species.
|
||||
get_species_chromosomes <- function(species_id) {
|
||||
chromosomes <- unlist(ensembl_request(
|
||||
paste0("/info/assembly/", species_id)
|
||||
)$karyotype)
|
||||
chromosomes <- unlist(ensembl_request(
|
||||
paste0("/info/assembly/", species_id)
|
||||
)$karyotype)
|
||||
}
|
||||
|
||||
#' Get a vector of all available unqiue chromosome names.
|
||||
|
|
@ -29,6 +29,6 @@ get_species_chromosomes <- function(species_id) {
|
|||
#' There are multiple names for mitochondrial DNA which have to be removed
|
||||
#' manually, unfortunately.
|
||||
get_all_chromosomes <- function() {
|
||||
chromosomes <- sapply(get_species_ids(), get_species_chromosomes)
|
||||
unique(unlist(chromosomes))
|
||||
chromosomes <- sapply(get_species_ids(), get_species_chromosomes)
|
||||
unique(unlist(chromosomes))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue