aacount

Count amino acids in sequence

Syntax

AAStruct = aacount(SeqAA)
AAStruct = aacount(SeqAA, ...'Ambiguous', AmbiguousValue, ...)
AAStruct = aacount(SeqAA, ...'Gaps', GapsValue, ...)
AAStruct = aacount(SeqAA, ...'Chart', ChartValue, ...)

Input Arguments

SeqAA

One of the following:

Examples: 'ARN' or [1 2 3]

AmbiguousValue

String specifying how to treat ambiguous amino acid characters (B, Z, or X). Choices are:

  • 'ignore' (default) — Skips ambiguous characters

  • 'bundle' — Counts ambiguous characters and reports the total count in the Ambiguous field.

  • 'prorate' — Counts ambiguous characters and distributes them proportionately in the appropriate fields. For example, the counts for the character B are distributed evenly between the D and N fields.

  • 'individual' — Counts ambiguous characters and reports them in individual fields.

  • 'warn' — Skips ambiguous characters symbols and displays a warning.

GapsValue

Specifies whether gaps, indicated by a hyphen (-), are counted or ignored. Choices are true or false (default).

ChartValueString specifying a chart type. Choices are 'pie' or 'bar'.

Output Arguments

AAStruct1-by-1 MATLAB structure containing fields for the standard 20 amino acids (A, R, N, D, C, Q, E, G, H, I, L, K, M, F, P, S, T, W, Y, and V).

Description

AAStruct = aacount(SeqAA) counts the number of each type of amino acid in SeqAA, an amino acid sequence, and returns the counts in AAStruct, a 1-by-1 MATLAB structure containing fields for the standard 20 amino acids (A, R, N, D, C, Q, E, G, H, I, L, K, M, F, P, S, T, W, Y, and V).

  • Ambiguous amino acid characters (B, Z, or X), gaps, indicated by a hyphen (-), and end terminators (*) are ignored by default.

  • Unrecognized characters are ignored and cause the following warning message.

    Warning: Unknown symbols appear in the sequence. These will be ignored.

AAStruct = aacount(SeqAA, ...'PropertyName', PropertyValue, ...) calls aacount with optional properties that use property name/property value pairs. You can specify one or more properties in any order. Each PropertyName must be enclosed in single quotation marks and is case insensitive. These property name/property value pairs are as follows:

AAStruct = aacount(SeqAA, ...'Ambiguous', AmbiguousValue, ...) specifies how to treat ambiguous amino acid characters (B, Z, or X). Choices are:

  • 'ignore' (default)

  • 'bundle'

  • 'prorate'

  • 'individual'

  • 'warn'

AAStruct = aacount(SeqAA, ...'Gaps', GapsValue, ...) specifies whether gaps, indicated by a hyphen (-), are counted or ignored. Choices are true or false (default).

AAStruct = aacount(SeqAA, ...'Chart', ChartValue, ...) creates a chart showing the relative proportions of the amino acids. ChartValue can be 'pie' or 'bar'.

Examples

  1. Create an amino acid sequence.

    Seq = 'MATLAB';
  2. Count the amino acids in the sequence and return the results in a structure.

    AA =  aacount(Seq)
    
    AA = 
    
         A: 2
         R: 0
         N: 0
         D: 0
         C: 0
         Q: 0
         E: 0
         G: 0
         H: 0
         I: 0
         L: 1
         K: 0
         M: 1
         F: 0
         P: 0
         S: 0
         T: 1
         W: 0
         Y: 0
         V: 0
    
  3. Get the count for alanine (A) residues.

    AA.A
    
    ans =
    
           2
  4. Use the fastaread function to read the sequence for the human p53 tumor protein into a MATLAB structure.

    p53 = fastaread('p53aa.txt')
    
    p53 = 
    
          Header: 'gi|8400738|ref|NP_000537.2| tumor protein p53 [Homo sapiens]'
        Sequence: [1x393 char]
  5. Count the amino acids in the sequence, return the results in a structure, and display the results in a pie chart.

    AA =  aacount(p53, 'chart', 'pie');

Was this topic helpful?