genosetup: Infers possible haplotypes based on genotype data.

Description Usage Arguments Details Value Author(s) Examples

Description

Input is genotype data.

Can handle all genotype data with multialleles and is thus not restricted to SNP data.

Usage

1
geno.setup(G,returnNames=TRUE,haplo.baseline=NULL)

Arguments

G

genotype data, n rows with 2*p columns.

returnNames

return names of haplotype.

haplo.baseline

gives the name of the haplotype that should be used as baseline, for latter MLE fitting. Default is last haplotype.

Details

This function provides an efficient representation of haplotypes that are consistent with genotype data. This speeds up the calculation of the likelihood of the genotype data, given the frequencies of haplotypes.

The component out$HPIordered returned contains the most important information. out$HPIordered is list, with one entry per person. out$HPIordered[[i]] is a list, with one entry per haplotype pair consistent with the genotype data out$HPIordered[[i]][[j]] is a vector of two integers, which are the indices of the jth pair of haplotypes consistent with the genotypes for individual i. The haplotypes that these indices correspond to can be examined by looking at

out$uniqueHaploNames[out$HPIordered[[i]][[j]]].

Value

Returns an object of class geno.setup with the following arguments:

HPIordered

list of indices of haplotype pairs that can lead to the observed genotype

uniqueHaploNames

names of haplotypes, with alleles separated by columns. This list includes only haplotypes which are consistent with the genotypes for individuals in the sample.

nAllelesPerLocus

number of alleles for each locus.

unorderedAlleles

A list, with one component corresponding to a locus, and this component is a vector of the allele names found at this locus.

nPeople

number of subjects.

nPossHaps

A vector of the number of possible haplotype pairs for each subject.

nLoci

number of loci.

initial.freqs

simple estimator of haplotype frequencies, based on simply counting the occurrences of each haplotype relative to the total number of possible haplotypes for all subjects.

Author(s)

Jeremy Silver

Examples

1
2
3
4
5
6
7
n<-10
g<-matrix(rbinom(10*4,1,0.5),n,4); # simple genotypes

gs<-geno.setup(g); 
summary(gs); 

gs

HaploSurvival documentation built on May 2, 2019, 5:49 p.m.