convertLoc {iGenomicViewer}R Documentation

Converts Genomic Locations

Description

This function will convert genomic locations with respect to chromosome to genomic locations with respect to the entire genome or vice versa.

Usage

convertCloc(x,
            chr,
            row=TRUE,
            bandobj=NA)

convertGloc(x,
            chr,
            row=TRUE,
            bandobj=NA)

Arguments

x numeric vector or matrix of values
chr indication of chromosome
row when x is a matrix, should the chr value be applied by row or by column
bandobj an object of the class bandinfo. if NA, useds iGenomicViewer's default band.info object

Details

Some applications require genomic locations to be with respect to the genome instead of by chromosome and vice versa. These functions provide a way to convert a numeric vector or matrix of one type to the other.

chr indicates which chromosome the value is on. If x is a vector, chr should be a vector of equal length, or a single value indicating all values of x are on the same chromosome. If x is a matrix, the values may be applied by row or by column. If by row, chr should be equal to dim(x)[1] and if by column, chr should be equal to dim(x)[2]. A single value may be used if all values are on the same chromosome.

The offset is calculated through the band.info object. See band.info for more information. If a bandobj is not specified the package's default bandinfo object is used.

Value

vector or matrix, of same form as input, of converted values

Author(s)

Lori A. Shepherd

See Also

Band.Info

Examples


#
# this is a mock example
#

x = matrix(0,24,3)
x[,2] = 1
x[,3] = 2

# this is x before
x

chr = 1:24

newx = convertGloc(x=x, chr=chr, row=TRUE, bandobj=NA)

# this is x after
newx


[Package iGenomicViewer version 2.4.6 Index]