get_populations: Get populations for a species

View source: R/populations.R

get_populationsR Documentation

Get populations for a species

Description

This function retrieves population-level information. The data is returned as a tibble where each row is a population of a given species and the columns are metadata about each population. See below under section Value for details about each column. The parameter ld_only to restrict populations returned to only populations with linkage disequilibrium information.

Usage

get_populations(
  species_name = "homo_sapiens",
  ld_only = TRUE,
  verbose = FALSE,
  warnings = TRUE,
  progress_bar = TRUE
)

Arguments

species_name

The species name, i.e., the scientific name, all letters lowercase and space replaced by underscore. Examples: 'homo_sapiens' (human), 'ovis_aries' (Domestic sheep) or 'capra_hircus' (Goat).

ld_only

Whether to restrict populations returned to only populations with linkage disequilibrium data.

verbose

Whether to be verbose about the http requests and respective responses' status.

warnings

Whether to show warnings.

progress_bar

Whether to show a progress bar.

Value

A tibble of 4 variables:

species_name

Ensembl species name: this is the name used internally by Ensembl to uniquely identify a species by name. It is the scientific name but formatted without capitalisation and spacing converted with an underscore, e.g., 'homo_sapiens'.

population

Population.

description

Description of the population.

cohort_size

Cohort sample size.

Ensembl REST API endpoints

get_populations() makes GET requests to /info/variation/populations/:species.

Examples

# Get all human populations with linkage disequilibrium data
get_populations(species_name = 'homo_sapiens', ld_only = TRUE)

# Get all human populations
get_populations(species_name = 'homo_sapiens', ld_only = FALSE)


ramiromagno/ensemblr documentation built on Sept. 5, 2024, 9:22 a.m.