Learn R Programming

tepr (version 1.1.14)

retrievechrom: Retrieve chromosome lengths and information for a specified genome.

Description

This function connects to the UCSC Genome Browser database using the `rtracklayer` package to retrieve chromosome information. It returns a `Seqinfo` object, filtering out unwanted chromosomes such as mitochondrial DNA (`chrM`) and those with alternative contigs (indicated by an underscore `_`).

Usage

retrievechrom(genomename, verbose, filterchrom = TRUE)

Value

A `Seqinfo` object containing the names and lengths of the main chromosomes for the specified genome.

Arguments

genomename

A character string specifying the UCSC genome name (e.g., "hg19" or "mm10").

verbose

A logical value. If `TRUE`, the function will print messages during execution, including a list of the chromosomes being kept.

filterchrom

A logical value. If `TRUE`, mitochondrial and non-canonical chromosomes are removed. Default is TRUE.

Examples

Run this code
# This example requires an internet connection to the UCSC database
hg19_chroms <- retrievechrom(genomename = "hg19", verbose = TRUE)
hg19_chroms

Run the code above in your browser using DataLab