Learn R Programming

Haplin (version 6.2.1)

gwaaToHaplin: Convert a loaded GenABEL gwaa.data object to a Haplin format character matrix

Description

Mostly for internal use. Can be useful as a check that a loaded GenABEL data object converts corretly to a Haplin format; otherwise not needed by the user.

Usage

gwaaToHaplin(data, pedIndex, design = "triad")

Arguments

data

Same as data argument in haplin.

pedIndex

Same as pedIndex argument in haplin.

design

Same as design argument in haplin.

Value

A data matrix (character) with one row for each family. The column names should be more or less self-explanatory. "m", "f", and "c" are used to names columns belonging to the mother, the father, and the child, respectively. Alleles are in separate columns.

Warning

Do not try to convert a large GenABEL object directly. You should rather select a small subset of markers for inspection.

Details

To use Haplin on a large ped-format file, it should first be converted to a GenABEL raw file and loaded into R. See the documentation for haplin how this is done. Once a GenABEL object has been loaded into R, it can be fed directly to Haplin, and the internal conversion to Haplin format is done by gwaaToHaplin. The user might want to check the conversion and can apply gwaaToHaplin to the loaded data object to see the Haplin data matrix. Apart from that, the user has little need for gwaaToHaplin.

References

Gjessing HK and Lie RT. Case-parent triads: Estimating single- and double-dose effects of fetal and maternal disease gene haplotypes. Annals of Human Genetics (2006) 70, pp. 382-396. Web Site: http://folk.uib.no/gjessing/genetics/software/haplin/

See Also

haplin, prepPed, convert.snp.ped, load.gwaa.data

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
## Extract family and phenotype information:
prepPed(pedfile = "data/mygwas.ped", outdir = "data", create.map = T)

## Convert to raw file format:
convert.snp.ped(pedfile = "data/mygwas.ped", 
 mapfile = "data/mygwas.map", outfile = "data/mygwas.raw")

## Load into R:
mygwas.data <- load.gwaa.data(phenofile = "data/mygwas.ph", 
 genofile = "data/mygwas.raw")

## Convert subset of data:
temp <- gwaaToHaplin(mygwas.data[, 1:3], 
 pedIndex = "data/mygwas.pedIndex")

## Inspect:
head(temp)


# }
# NOT RUN {
# }

Run the code above in your browser using DataLab