R: Change chromosomal coding

recodeChromosome {GenABEL} | R Documentation

## 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

### Note

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

### Author(s)

Yurii Aulchenko

### Examples

    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))

[Package GenABEL version 1.8-0 Index]