makeSeq: 'makeSeq' output a random DNA sequence.

Description Usage Arguments Value Examples

Description

makeSeq outputs a string that contains a random sequence of characters (A/C/G/T by default). By default the first three letters are "ATG" and the last three letters are a stop-codon ("TAA", "TAG" or "TGA"). The number of characters in the output is three times the len argument, i.e. it contains len codons

Usage

1
2
makeSeq(len, useInit = TRUE, useStop = TRUE, alphabet = c("A", "C",
  "G", "T"), p = rep(0.25, 4), seed = NULL)

Arguments

len

(integer) number of codons in the returned string

useInit

(logical) make the first codon an initiation codon. Default is TRUE.

useStop

(logical) make the last codon a stop codon. Default is TRUE.

alphabet

(character vector) the elements that are randomly concatenated. Default is A/C/G/T.

p

(numeric vector) Probabilites for each character to occur. Default is equiprobable.

seed

(numeric) the seed for the RNG. Default is NULL i.e. the RNG behaves as if no seed had been set..

Value

(character) a single string

Examples

1
2
3
makeSeq(7)
makeSeq(7, p = c(0.2, 0.4, 0.4, 0.2), seed = 112358)
gsub("T", "U", makeSeq(7)) # for RNA

hyginn/BCB420.2019.ESA documentation built on May 29, 2019, 1:23 p.m.