Learn R Programming

kebabs (version 1.6.2)

genRandBioSeqs: Generate Random Biological Sequences

Description

Generate biological sequences with uniform random distribution of alphabet characters.

Usage

genRandBioSeqs(seqType = c("DNA", "RNA", "AA"), numSequences, seqLength,
  biostring = TRUE, seed)

Arguments

seqType
defines the type of sequence as DNA, RNA or AA and the underlying alphabet. Default="DNA"
numSequences
single numeric value which specifies the number of sequences that should be generated.
seqLength
either a single numeric value or a numeric vector of length 'numSequences' which gives the length of the sequences to be generated.
biostring
if TRUE the sequences will be generated in XStringSet format otherwise as BioVector derived class. Default=TRUE
seed
when present the random generator will be seeded with the value passed in this parameter

Value

  • When the parameter 'biostring' is set to FALSE the function returns a XStringSet derived class otherwise a BioVector derived class.

Details

The function generates a set of sequences with uniform distribution of alphabet characters and returns it as XStringSet or BioVector dependent on the parameter biostring.

References

http://www.bioinf.jku.at/software/kebabs J. Palme, S. Hochreiter, and U. Bodenhofer (2015) KeBABS: an R package for kernel-based analysis of biological sequences. Bioinformatics, 31(15):2574-2576, 2015. DOI: http://dx.doi.org/10.1093/bioinformatics/btv176{10.1093/bioinformatics/btv176}.

Examples

Run this code
## generate a set of AA sequences of fixed length as AAStringSet
aaseqs <- genRandBioSeqs("AA", 100, 1000, biostring=TRUE)

## show AA sequence set
aaseqs

## generate a set of "DNA" sequences as DNAStringSet with uniformly
## distributed lengths between 1500 and 3000 bases
seqLength <- runif(300, min=1500, max=3500)
dnaseqs <- genRandBioSeqs("DNA", 100, seqLength, biostring=TRUE)

## show DNA sequence set
dnaseqs

Run the code above in your browser using DataLab