Learn R Programming

gap (version 1.3-1)

hap: Haplotype reconstruction

Description

Haplotype reconstruction using sorting and trimming algorithms.

Usage

hap(
  id,
  data,
  nloci,
  loci = rep(2, nloci),
  names = paste("loci", 1:nloci, sep = ""),
  control = hap.control()
)

Value

The returned value is a list containing:

l1

log-likelihood assuming linkage disequilibrium

converge

convergence status, 0=failed, 1=succeeded

niter

number of iterations

Arguments

id

a column of subject id.

data

genotype table.

nloci

number of loci.

loci

number of alleles at all loci.

names

locus names.

control

is a function with the following arguments,

  1. mb Maximum dynamic storage to be allocated, in Mb

  2. pr Prior (ie population) probability threshold

  3. po Posterior probability threshold

  4. to Log-likelihood convergence tolerance

  5. th Posterior probability threshold for output

  6. maxit Maximum EM iteration

  7. n Force numeric allele coding (1/2) on output (off)

  8. ss Tab-delimited speadsheet file output (off)

  9. rs Random starting points for each EM iteration (off)

  10. rp Restart from random prior probabilities

  11. ro Loci added in random order (off)

  12. rv Loci added in reverse order (off)

  13. sd Set seed for random number generator (use date+time)

  14. mm Repeat final maximization multiple times

  15. mi Create multiple imputed datasets. If set >0

  16. mc Number of MCMC steps between samples

  17. ds Starting value of Dirichlet prior parameter

  18. de Finishing value of Dirichlet prior parameter

  19. q Quiet operation (off)

  20. hapfile a file for haplotype frequencies

  21. assignfile a file for haplotype assignment

Details

The package can hanlde much larger number of multiallelic loci. For large sample size with relatively small number of multiallelic loci, genecounting should be used.

References

Clayton DG (2001) SNPHAP. https://github.com/chr1swallace/snphap.

Zhao JH and W Qian (2003) Association analysis of unrelated individuals using polymorphic genetic markers. RSS 2003, Hassalt, Belgium

Zhao JH (2004). 2LD, GENECOUNTING and HAP: Computer programs for linkage disequilibrium analysis. Bioinformatics 20: 1325-1326

See Also

genecounting

Examples

Run this code
if (FALSE) {
require(gap.datasets)
# 4 SNP example, to generate hap.out and assign.out alone
data(fsnps)
hap(id=fsnps[,1],data=fsnps[,3:10],nloci=4)
dir()

# to generate results of imputations
control <- hap.control(ss=1,mi=5,hapfile="h",assignfile="a")
hap(id=fsnps[,1],data=fsnps[,3:10],nloci=4,control=control)
dir()
}

Run the code above in your browser using DataLab