randseq
Generate random sequence from finite alphabet
Syntax
Seq
= randseq(SeqLength
)
Seq
= randseq(SeqLength
,
...'Alphabet', AlphabetValue
, ...)
Seq
= randseq(SeqLength
,
...'Weights', WeightsValue
, ...)
Seq
= randseq(SeqLength
,
...'FromStructure', FromStructureValue
,
...)
Seq
= randseq(SeqLength
,
...'Case', CaseValue
, ...)
Seq
= randseq(SeqLength
,
...'DataType', DataTypeValue, ...
)
Arguments
SeqLength | Integer that specifies the number of nucleotides or amino acids in the random sequence . |
AlphabetValue | Character vector or string that specifies the alphabet for the sequence. Choices are
|
WeightsValue | Property to specify a weighted random sequence. |
FromStructureValue | Property to specify a weighted random sequence using
output structures from the functions from |
CaseValue | Character vector or string that specifies the case of letters in a sequence when
|
DataTypeValue | Character vector or string that specifies the data type for a sequence. Choices are
Creates a sequence as an
array of |
Description
creates
a random sequence with a length specified by Seq
= randseq(SeqLength
)SeqLength
.
calls Seq
= randseq(SeqLength
,
...'PropertyName
', PropertyValue
, ...)randseq
with optional
properties that use property name/property value pairs. You can specify
one or more properties in any order. Each PropertyName
must
be enclosed in single quotation marks and is case insensitive. These
property name/property value pairs are as follows:
generates
a sequence from a specific alphabet.Seq
= randseq(SeqLength
,
...'Alphabet', AlphabetValue
, ...)
creates
a weighted random sequence where the Seq
= randseq(SeqLength
,
...'Weights', WeightsValue
, ...)i
th letter
of the sequence alphabet is selected with weight W(i)
.
The weight vector is usually a probability vector or a frequency count
vector. Note that the i
th element of the nucleotide
alphabet is given by int2nt(i)
, and the i
th
element of the amino acid alphabet is given by int2aa(i)
.
creates a weighted random sequence with weights given
by the output structure from Seq
= randseq(SeqLength
,
...'FromStructure', FromStructureValue
,
...)basecount
, dimercount
, codoncount
,
or aacount
.
specifies
the case for a letter sequence.Seq
= randseq(SeqLength
,
...'Case', CaseValue
, ...)
specifies
the data type for the sequence array.Seq
= randseq(SeqLength
,
...'DataType', DataTypeValue, ...
)
Examples
Generate a random DNA sequence.
randseq(20) ans = TAGCTGGCCAAGCGAGCTTG
Generate a random RNA sequence.
randseq(20,'alphabet','rna') ans = GCUGCGGCGGUUGUAUCCUG
Generate a random protein sequence.
randseq(20,'alphabet','amino') ans = DYKMCLYEFGMFGHFTGHKK
Version History
Introduced before R2006a
See Also
hmmgenerate
| randsample
| rand
| randperm