get.target.geno: Getting genotypes of the target SNPs

Description Usage Arguments Value Examples

Description

This function read out the genotypes of the selected target SNPs from the orignal data set (the data set on which simulation is based).

Usage

1
get.target.geno(input.plink.file, target.snp, snp.all2)

Arguments

input.plink.file

is a vector of three character strings for the file names of the mother's father's and child's plink base filenames with the necessary path to the directory. The plink files are in bed format and three files with extensions .bed .bim and .fam are expected for each individual's genotypes. The mothers, fathers, and childredn must be from the same set of trio families even though the ordering of the families can be different for the three sets of data.

target.snp

is a vector of integers showing the row number of the target SNPs in the .bim file

snp.all2

is a dataframe containing list of SNPs in PLINK .bim format. Only the second column is used which contains the rs number of the SNPs. The colname name of the second column has to be "V2".

Value

A list of three matrices is returned. The three matrices are the observed genotypes of the mothers from family 1 to family n repeated twice, genotypes of the fathers from family 1 to family n repeated twice and genotypes of children from family 1 to n followed by (stacking on top of) genotypes of the complements at the target SNPs.

Examples

1
2
3
4
5
6
tar.snp <- c(21, 118, 121, 140, 155, 168, 218, 383) 
m.file <- file.path(system.file(package = "TriadSim"),'extdata/pop1_4chr_mom')
f.file <- file.path(system.file(package = "TriadSim"),'extdata/pop1_4chr_dad')
k.file <- file.path(system.file(package = "TriadSim"),'extdata/pop1_4chr_kid')
# the preloaded data frame snp.all2 contains the data frame read from the corresponding .bim file.
target.geno <- get.target.geno(c(m.file,f.file,k.file), tar.snp,snp.all2)

bbms09/TrioSim documentation built on May 11, 2019, 9:27 p.m.