lengthChromosome: Retrieve chromosomal length

Description Usage Arguments Details Value Author(s) Examples

View source: R/quantsmoothplot.R

Description

Retrieve human chromosomal length from NCBI data

Usage

1
lengthChromosome(chrom, units = "hg19")

Arguments

chrom

vector of chromosomal id, 1:22,X,Y

units

character, or data.frame, see details

Details

The cytoband data was originally obtained from the lodplot package by David Duffy, which contained basepair data from genome version hg17, but also the linkage related positions in cM. These datasets have units "bases" and "cM" respectively. Cytoband data for genome versions "hg18", "hg19", "hg38" and "mm10" has been included, and can be referenced by these strings. It is also possible to use cytoband data as obtained from the UCSC site, by downloading the cytoBand.txt.gz or cytoBandIdeo.txt.gz annotation file for a species (see example below). Note however that this information is not available for most species.

Value

A numeric vector in the requested units

Author(s)

Jan Oosting

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
  # Show length of chromosome 1 in several types of units
  lengthChromosome(1,"cM")
  lengthChromosome(1,"bases")
  lengthChromosome(1,"hg38")
  # mm9 cytoband data
  temp <- tempfile(fileext = ".txt.gz")
  download.file("http://hgdownload.soe.ucsc.edu/goldenPath/mm9/database/cytoBand.txt.gz",temp)
  mm9cytobands <- read.table(temp,sep="\t")
  lengthChromosome(1,mm9cytobands)
  # remove temp file
  unlink(temp)

quantsmooth documentation built on Nov. 8, 2020, 8:27 p.m.