random_sq {tidysq} | R Documentation |
Generate random sequences
Description
Generates an sq
object with specified
number of sequences of given length and alphabet.
Usage
random_sq(n, len, alphabet, sd = NULL, use_gap = FALSE)
Arguments
n |
[ |
len |
[ |
alphabet |
[ |
sd |
[ |
use_gap |
[ |
Details
Letter '*' is not used in generating ami sequences. If parameter
sd
is passed, then all generated negative values are replaced with 0s.
Value
An object of class sq
with type as specified.
See Also
Functions from input module:
import_sq()
,
read_fasta()
,
sq()
Examples
# Setting seed for reproducibility
set.seed(16)
# Generating random sequences
random_sq(10, 10, "ami_bsc")
random_sq(25, 18, "rna_bsc", sd = 6)
random_sq(50, 8, "dna_ext", sd = 3)
random_sq(6, 100, "ami_bsc", use_gap = TRUE)
# Passing whole alphabet instead of type
random_sq(4, 12, c("Pro", "Gly", "Ala", "Met", "Cys"))
# Generating empty sequences (why would anyone though)
random_sq(8, 0, "rna_ext")