peelingRC {LFSPRO}R Documentation

Peeling interface in R.

Description

Peeling (Elston-Stewart algorithm) is the key function in LFSpro. We implmented it in C++ to make it fast. peelingRC is used to link the peeling algorithm in C++ version to R.

Usage

peelingRC(allef, LIK, ped, counselee.id, nloci = 1, mRate = 0)

Arguments

allef

List. Allele frequency for each locus/gene. If there is only one gene and two alleles in the gene (allele frequency is 0.1 and 0.9), allef = list(c(0.1,0.9)), If there are two genes,two alleles (allele frequency is 0.1 and 0.9) for gene 1 and three alleles (allele frequncy is 0.2, 0.2 and 0.6) for gene 2. allef = list(c(0.1,0.9),c(0.2,0.2,0.6))

LIK

Matrix, likelihood, Pr(D|G), for three kinds of genotype for all the individuals in the family. D: healthy status. G: genotype.

ped

Pedigree structure. A data frame with four varaibles: ID(individual id), Gender (gender, 0: female, 1: male), FatherID(father id) and MotherID(mother id).

counselee.id

Individual id for the counselee. If you want to estimate multiple samples at the same time, just set counselee.id as a vector of IDs for all the samples you want to estimate.

nloci

Number of loci/genes in the model.

mRate

Mutation rate.

Details

One family a time.

Value

The posterior probability (Pr(G|D)) for each counselee

Author(s)

Gang Peng

References

Elston, R. C., Stewart, J. (1971) A general model for the genetic analysis of pedigree data. Hum Hered., 21, 523-542.

See Also

lfsproC

Examples

  fam.cancer.data <- CombineData(fam.data, cancer.data)
  allef <- allef.g <- list(c(0.9997,0.0003))
  mRate.g <- 6e-05
  FamData <- fam.cancer.data[[1]]
  lik <- calLK(FamData, LFSpenet.2010)
  
  ##################################
  # convert data
  ##################################
  counselee.id <- FamData$id[1]
  id <- as.integer(FamData$id)
  fid <- as.integer(FamData$fid)
  mid <- as.integer(FamData$mid)
  counselee.id <- as.integer(counselee.id)
  
  if(min(id)==0){
    id <- id+1
    fid <- fid+1
    mid <- mid+1
    counselee.id <- counselee.id+1
  }
  fid[is.na(fid)] <- 0
  mid[is.na(mid)] <- 0
  
  ped <- data.frame(ID=id, Gender = FamData$gender,
                    FatherID = fid, 
                    MotherID = mid, 
                    stringsAsFactors=FALSE)
  
  peelingRC(allef, lik, ped, counselee.id, 1, mRate.g)

[Package LFSPRO version 1.0.5 Index]