R: Gene dropping simulations - Sample

gen.simuSample {GENLIB} | R Documentation

## Gene dropping simulations - Sample

### Description

Returns the number of alleles transmitted to specified probands from ancestors

### Usage

    gen.simuSample(gen, pro, ancestors, stateAncestors, simulNo = 5000)

### Arguments

`gen` | An object of class GLgen obtained with gen.genealogy, gen.lineages or gen.branching. Required.
`pro` | Vector of proband id numbers to be included. Required.
`ancestors` | Vector of ancestors id numbers to be included. Required.
`stateAncestors` | Required vector indicating, for each ancestor in ancestors, the genotype state: 0 = no disease allele present 1 = 1 disease allele present 2 = 2 disease alleles present
`simulNo` | Number of simulations to perform. Default is 5000.

### Value

A matrix with number of columns equal to the number of simulations and number of rows equal to the number of probands.

### See Also

`gen.genealogy` `gen.simuProb` `gen.simuSet` `gen.simuSampleFreq`

### Examples

    data(geneaJi)
    genJi<-gen.genealogy(geneaJi)
    simu_1000<-gen.simuSample(genJi, pro=c(1,29), ancestors=c(20,25), stateAncestors=c(2,1),
                              simulNo=1000)
    # Number of alleles received by probants
    table(simu_1000)
    # Number of alleles received by simulation
    table(colSums(simu_1000))
    # Number of alleles received by each probant
    table(simu_1000[1,],simu_1000[2,])

    data(geneaJi)
    genJi<-gen.genealogy(geneaJi)
    simu_5000<-gen.simuSample(genJi, pro=c(1,29), ancestors=c(20,25), stateAncestors=c(2,1),
                              simulNo=5000)
    # Number of alleles received by probants
    table(simu_5000)
    # Number of alleles received by simulation
    table(colSums(simu_5000))
    # Number of alleles received by each probant
    table(simu_5000[1,],simu_5000[2,])

[Package GENLIB version 1.0.9 Index]