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

View source: R/preprocessing-blacklisthighmap-utils.R

retrievechromR Documentation

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)

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.

Value

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

Examples

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


tepr documentation built on Sept. 10, 2025, 1:07 a.m.