basecount

Count nucleotides in a sequence

Syntax

Bases = basecount(SeqNT, 
                  'PropertyName', PropertyValue...)

basecount(..., 'Chart', ChartValue)
basecount(..., 'Others', OthersValue)

Arguments

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'.

Description

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.

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.

Examples

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

See Also

Bioinformatics Toolbox functions aacount, baselookup, codoncount, dimercount, nmercount, ntdensity


© 1994-2005 The MathWorks, Inc.