Main Content

seqcomplement

Complement of nucleotide sequence

    Description

    SeqC = seqcomplement(SeqNT) returns the complementary sequence of the DNA or RNA nucleotide sequence contained in SeqNT. The format of SeqC matches SeqNT. For example, if SeqNT is a vector of integers, then so is SeqC. For complementary base pairs, see Complementary DNA and RNA Base Pairs. For complementary ambiguous characters, see Complementary IUPAC Ambiguity Codes.

    example

    Examples

    collapse all

    Create a random DNA nucleotide sequence.

    SeqNT = randseq(8,Alphabet="dna")
    SeqNT = 
    'TTATGACG'
    

    Find the complement sequence.

    SeqC = seqcomplement(SeqNT)
    SeqC = 
    'AATACTGC'
    

    Input Arguments

    collapse all

    Nucleotide sequence, specified as one of the following:

    More About

    collapse all

    Complementary DNA and RNA Base Pairs

    Nucleotide in Input SequenceNucleotide in Complimentary Sequence
    AT or U
    CG
    GC
    T or UA

    Complementary IUPAC Ambiguity Codes

    IUPAC Code in Input SequenceIUPAC Code in Complimentary Sequence
    MK
    RY
    WW
    SS
    VB
    NN

    Version History

    Introduced before R2006a