| Bioinformatics Toolbox | ![]() |
Count nucleotides in a sequence
Bases = basecount(SeqNT,
'PropertyName', PropertyValue...)
basecount(..., 'Chart', ChartValue)
basecount(..., 'Others', OthersValue)
SeqNT | Nucleotide sequence. Enter a character string with the letters A, T, U, C, and G. The count for U characters is included with the count for T characters. . You can also enter a structure with the field Sequence. |
Chart | Property to select a type of plot. Enter either 'pie' or 'bar'. |
Others | Property to control counting ambiguous characters individually. Enter either full' or 'bundle'. The default value is 'bundle'. |
Bases = basecount(SeqNT, 'PropertyName', PropertyValue...) counts the number of bases in a nucleotide sequence (SeqNT) and returns the base counts in a 1-by-1 structure (Bases) with the fields A, C, G, T.
For sequences with the character U, the number of U characters is added to the number of T characters.
If the sequence contains ambiguous nucleotide characters (R, Y, K, M, S, W, B, D, H, V, N), or gaps indicated with a hyphen (-), this function creates a field Others and displays a warning message.
Warning: Ambiguous symbols 'symbol list' appear in the sequence.
These will be in Others.
If the sequence contains undefined nucleotide characters (E F H I J L O P Q X Z) , the characters are counted in the field Others and a warning message is displayed.
Warning: Unknown symbols 'symbol list' appear in the sequence.
These will be ignored.
If Others = 'full'', ambiguous characters are listed separately and hyphens are counted in a new field (Gaps).
basecount(..., 'Chart', ChartValue) creates a chart showing the relative proportions of the nucleotides.
basecount(..., 'Others', OthersValue), when OthersValue is 'full', counts all the ambiguous nucleotide symbols individually instead of bundling them together into the Others field of the output structure.
basecount(..., 'Structure', StructureValue) when StructureValue is 'full' , blocks the unknown characters warning and ignores counting unknown characters.
basecount(SeqNT) — Display 4 nucleotides, and only if there are ambiguous and unknown characters, add an Others field with the counts.
basecount(SeqNT, 'Others', 'full') — Display 4 nucleotides, 11 ambiguous nucleotides, gaps, and only if there are unknown characters, add an Others field with the unknown counts.
basecount(SeqNT, 'Structure', 'full') — Display 4 nucleotides and always display an Others field. If there are ambiguous and unknown characters, adds counts to the Others field otherwise display 0.
basecount(SeqNT, 'Others', 'full', 'Structure', 'full') — Display 4 nucleotides, 11 ambiguous nucleotides, gaps, and Others field. If there are unknown characters, add counts to the Others field otherwise display 0.
Count the number of bases in a DNA sequence.
Bases = basecount('TAGCTGGCCAAGCGAGCTTG')
Bases =
A: 4
C: 5
G: 7
T: 4
Bases.A
ans =
4
Count the bases in a DNA sequence with ambiguous characters.
basecount('ABCDGGCCAAGCGAGCTTG','Others','full')
ans =
A: 4
C: 5
G: 6
T: 2
R: 0
Y: 0
K: 0
M: 0
S: 0
W: 0
B: 1
D: 1
H: 0
V: 0
N: 0
Gaps: 0
Bioinformatics Toolbox functions aacount, baselookup, codoncount, dimercount, nmercount, ntdensity
| atomiccomp | baselookup | ![]() |
© 1994-2005 The MathWorks, Inc.