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

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)