palindromes

Find palindromes in a sequence

Syntax

[Position, Length] = palindromes(SeqNT, 
                                 'PropertyName', PropertyValue)
[Postion, Length, Pal] = palindromes(SeqNT)

palindromes(..., 'Length', LengthValue)
palindromes(..., 'Complement', ComplementValue)

Description

[Position, Length] = palindromes(SeqNT, 'PropertyName', PropertyValue) finds all palindromes in sequence SeqNT with a length greater than or equal to 6, and returns the starting indices, Position, and the lengths of the palindromes, Length.

[Position, Length, Pal] = palindromes(SeqNT) also returns a cell array Pal of the palindromes.

palindromes(..., 'Length',LengthValue) finds all palindromes longer than or equal to Length. The default value is 6.

palindromes(..., 'Complement', ComplementValue) finds complementary palindromes if Complement is true, that is, where the elements match their complementary pairs A-T(or U) and C-G instead of an exact nucleotide match.

Examples

[p,l,s] = palindromes('GCTAGTAACGTATATATAAT') 

p =
    11
    12
l =
     7
     7
s = 
    'TATATAT'
    'ATATATA'

[pc,lc,sc] = palindromes('GCTAGTAACGTATATATAAT',...
                         'Complement',true); 

Find the palindromes in a random nucleotide sequence.

a = randseq(100)

a =
TAGCTTCATCGTTGACTTCTACTAA
AAGCAAGCTCCTGAGTAGCTGGCCA
AGCGAGCTTGCTTGTGCCCGGCTGC
GGCGGTTGTATCCTGAATACGCCAT

[pos,len,pal]=palindromes(a)

pos =
    74
len =
     6
pal = 
    'GCGGCG' 

See Also

Bioinformatics Toolbox functions seqrcomplement, seqshowwords

MATLAB functions regexp, strfind


© 1994-2005 The MathWorks, Inc.