GenerateVars {QSutils} | R Documentation

## Generate variants of a given haplotype

### Description

Function to generate a set of variants for a given DNA sequence.

### Usage

    GenerateVars(seq, nhpl, max.muts, p.muts)

### Arguments

`seq` | A character string with a DNA sequence from which to generate the variants.
`nhpl` | Number of haplotypes to generate.
`max.muts` | Maximum number of mutations in each sequence.
`p.muts` | Vector of length `max.muts` with the probability of each number of mutations, some of which may be 0.

### Details

Given a DNA sequence, `nhpl` variant haplotypes are generated at random, with a maximum of `max.muts` substitutions each. The probability of the number of mutations in each haplotype generated is given by the vector `p.muts`. The positions of the mutations in each haplotype are independent and random.

### Value

A character vector with `nhpl` haplotype variants of the `seq` sequence.

### Author(s)

Mercedes Guerrero-Murillo and Josep Gregori

### See Also

`GetRandomSeq`, `Diverge`

### Examples

    set.seed(123)
    m1 <- GetRandomSeq(50)

    GenerateVars(m1,50,2,c(10,1))

[Package QSutils version 1.0.0 Index]