sim_chr {Relate}R Documentation

Program used to generate data

Description

~~ A concise (1-5 lines) description of what the function does. ~~

Usage

sim_chr(snp, freq = 0.2, min = 0.5, max = 0.95, k = k, a = 3.854, number_per_cm = 1)

Arguments

snp ~~Describe snp here~~
freq ~~Describe freq here~~
min ~~Describe min here~~
max ~~Describe max here~~
k ~~Describe k here~~
a ~~Describe a here~~
number_per_cm ~~Describe number_per_cm here~~

Details

~~ If necessary, more details than the description above ~~

Value

~Describe the value returned If it is a LIST, use

comp1 Description of 'comp1'
comp2 Description of 'comp2'

...

Warning

....

Note

~~further notes~~

~Make other sections like Warning with section{Warning }{....} ~

Author(s)

~~who you are~~

References

~put references to the literature/web site here ~

See Also

~~objects to See Also as help, ~~~

Examples

##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--    or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (snp, freq = 0.2, min = 0.5, max = 0.95, k = k, a = 3.854, 
    number_per_cm = 1) 
{
    hap11 <- unrelated(snp, freq, min, max)
    hap12 <- unrelated(snp, freq, min, max)
    hap21 <- unrelated(snp, freq, min, max)
    hap22 <- unrelated(snp, freq, min, max)
    pos <- as.integer(rnorm(snp, mean = CM, sd = CM/10))
    pos <- round(pos/number_per_cm, 0)
    pos <- cumsum(pos)
    state = recom(pos/CM, k = k, a = a)
    hap11[state == 2] <- hap21[state == 2]
    hap12[state == 2] <- hap22[state == 2]
    hap11[state == 1] <- hap21[state == 1]
    geno <- cbind(hap11 + hap12, hap21 + hap22)
    obs <- list(geno = geno, state = state, k = k, a = a, freq = freq, 
        number_per_cm = number_per_cm, min = min, max = max, 
        snp = snp, pos = pos)
    class(obs) = "sim_chr"
    return(obs)
  }

[Package Relate version 0.987 Index]