Learn R Programming

SNPannotator (version 1.4.3)

findRSID: Query Ensembl for variant information based on genomic position

Description

This function retrieves variant information from Ensembl based on the specified genomic position. It takes the chromosome number, start position, and end position as input parameters and searches for variants within this window, using the specified genomic build. If only the start position is provided, the function automatically sets the end position equal to the start position. This is particularly relevant for SNP variants, where the start and end positions are the same. The function returns all variants found within the defined window.

Usage

findRSID(
  chromosome,
  start_position,
  end_position = NULL,
  build = "38",
  file_path = NULL
)

Value

A data.table containing variant information including:

  • id: variant id in rsID format

  • alleles: variant alleles

  • seq_region_name: chromosome number

  • start: starting base pair

  • end: ending base pair

Arguments

chromosome

Numeric, specifying the chromosome number.

start_position

Numeric, specifying the starting base pair position.

end_position

Numeric, specifying the ending base pair position.

build

Numeric, specifying the genomic build, default value is 38.

file_path

character, path to a file for saving results as Excell spreadsheet.