Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

read.chromInfo

Read/parse chromInfo data from a data frame/file/UCSC database


Description

Read/parse chromInfo data from a data frame/file/UCSC database

Usage

read.chromInfo(
    chromInfo = system.file(package = "circlize", "extdata", "chromInfo.txt"),
    species = NULL,
    chromosome.index = usable_chromosomes(species),
    sort.chr = TRUE)

Arguments

chromInfo

Path of the chromInfo file or a data frame that already contains chromInfo data

species

Abbreviations of species. e.g. hg19 for human, mm10 for mouse. If this value is specified, the function will download chromInfo.txt.gz from UCSC website automatically.

chromosome.index

subset of chromosomes, also used to reorder chromosomes.

sort.chr

Whether chromosome names should be sorted (first sort by numbers then by letters). If chromosome.index is set, this argument is enforced to FALSE

Details

The function read the chromInfo data, sort the chromosome names and calculate the length of each chromosome. By default, it is human hg19 chromInfo data.

You can find the data structure for the chromInfo data from https://hgdownload.cse.ucsc.edu/goldenpath/hg19/database/chromInfo.txt.gz

Value

df

Data frame for chromInfo data (rows are sorted if sort.chr is set to TRUE)

chromosome

Sorted chromosome names

chr.len

Length of chromosomes. Order are same as chromosome

Examples

data = read.chromInfo(species = "hg19")
data = read.chromInfo(chromInfo = system.file(package = "circlize", "extdata", "chromInfo.txt"))
chromInfo = read.table(system.file(package = "circlize", "extdata", "chromInfo.txt"),
    colClasses = c("character", "numeric"), sep = "\t")
data = read.chromInfo(chromInfo = chromInfo)

circlize

Circular Visualization

v0.4.12
MIT + file LICENSE
Authors
Zuguang Gu
Initial release
2021-1-8

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.