recodeChromosome: Change chromosomal coding

Description Usage Arguments Value Note Author(s) Examples

View source: R/recodeChromosome.R

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

1
  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

Note

'from' entries should be unique and not overlap with entries in 'to'

Author(s)

Yurii Aulchenko

Examples

1
2
3
4
5
6
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))

GenABEL documentation built on May 30, 2017, 3:36 a.m.