Learn R Programming

GenABEL (version 1.8-0)

recodeChromosome: Change chromosomal coding

Description

Recoding of chromosomes according to the provided 'rules' for from -> to pairs. Most common use is anticipated when importing data from other software using only integers to represent chromosomes. In this situation the list of rules may look like this: list(24="X",25="Y",26="mt").

Usage

recodeChromosome(data, rules, quiet = FALSE)

Arguments

data
object of class for which 'chromosome' method is defined, e.g. 'gwaa.data', 'snp.data', 'scan.gwaa'
rules
list of pairs 'from=to'; the chromosomes coded in the original data set with 'from' will be recoded with 'to' value
quiet
if summary of recoding should not be printed to the screen

Value

modified 'data' object

Examples

Run this code
require(GenABEL.data)
data(ge03d2)
table(chromosome(ge03d2))
# merge chromosome 3 and X, call chromosome 2 as 15
newdat <- recodeChromosome(ge03d2,rules=list("3"="X","2"=15))
table(chromosome(ge03d2),chromosome(newdat))

Run the code above in your browser using DataLab