Count n-mers in nucleotide or amino acid sequence
Nmer = nmercount(Seq, Length)
Nmer = nmercount(Seq, Length, C)
One of the following:
Integer specifying the length of n-mer to count.
Nmer = nmercount(Seq, Length) counts the n-mers or patterns of a specific length in Seq, a nucleotide sequence or amino acid sequence, and returns the n-mer counts in a cell array.
Nmer = nmercount(Seq, Length, C) returns only the n-mers with cardinality of at least C.
Use the getgenpept function to retrieve the amino acid sequence for the human insulin receptor.
S = getgenpept('AAA59174','SequenceOnly',true);
Count the number of four-mers in the amino acid sequence and display the first 20 rows in the cell array.
nmers = nmercount(S,4); nmers(1:20,:) ans = 'APES'  'DFRD'  'ESLK'  'FRDL'  'GNYS'  'LKEL'  'SHCQ'  'SLKD'  'SVRI'  'TDYL'  'TSLA'  'TVIN'  'VING'  'VPLD'  'YALV'  'AAAA'  'AAAP'  'AAEI'  'AAEL'  'AAFP'