aaindex
– AAIndex annotations¶
- class AAIndex(aaindex_files=None)¶
Provides access to data from the amino acid index database (aaindex):
Kawashima, S. and Kanehisa, M.; AAindex: amino acid index database. Nucleic Acids Res. 28, 374 (2000).
Files are available here
- Parameters:
aaindex_files (
list
ofstr
) – Paths to aaindex files. If not given, the files aaindex1, aaindex2 and aaindex3 from the specified source are used (Release 9.2, Feb 2017).
- __getitem__(key)¶
Getter by aaindex accession number (e.g. ANDN920101)
- Parameters:
key (
str
) – aaindex accession number- Returns:
AAIndexData
object
- keys()¶
Emulate dict like behvaiour and returns all available keys, accession numbers respectively.
- Returns:
keys (or accession numbers) of all available aaindex entries
- values()¶
Emulate dict like behvaiour and returns all available entries.
- Returns:
iterable of entries (type
AAIndexData
)
The annotations/scores can either refer to single amino acids or represent pairwise values. The two types are:
- class AnnoType(value)¶
Possible types of aaindex entries
- PAIR = 'PAIR'¶
Pairwise amino acid annotation, substitution/pairwise scores
- SINGLE = 'SINGLE'¶
Single amino acid annotation
The actual data of an entry in the aaindex database is stored in a
aaindex.AAIndexData
object:
- class AAIndexData¶
Data object representing an annotation in aaindex, preferably constructed from it’s static
Parse()
method. The following attributes are available:key: aaindex accession number (e.g. ANDN920101)
desc: descriptive title
ref: Reference to article if available
authors: Authors of article if available
title: Title of article if available
journal: Journal of article if available
- anno_type: Enum (
AnnoType
) specifying whether we’re dealing with a single or pairwise amino acid annotation/score.
- anno_type: Enum (
- anno:
dict
with annotation. If anno_type is SINGLE, keys are amino acid one letter codes (single character strings). If anno_type is PAIR, keys are two one letter codes added together (two character strings). Even when the thing is symmetric, both keys exist. I.e. ‘AB’ AND ‘BA’. Values are of type
float
(None if not available).
- anno:
- GetPairScore(olc_one, olc_two)¶
Score/Annotation getter
- Parameters:
olc_one (
string
) – One letter code of first amino acidolc_two (
string
) – One letter code of second amino acid
- Returns:
Pairwise annotation/score for olc_one/olc_two
- Raises:
ValueError
if key constructed from olc_one and olc_two is not known orRuntimeError
if anno_type of thisAAIndexData
object is not AnnoType.PAIR.
- GetScore(olc)¶
Score/Annotation getter
- Parameters:
olc (
string
) – One letter code of amino acid- Returns:
Annotation/score for olc
- Raises:
ValueError
if olc is not known orRuntimeError
if anno_type of thisAAIndexData
object is not AnnoType.SINGLE.
- static Parse(data)¶
Creates
AAIndexData
from data.- Parameters:
data – Iterable with strings in data format described for aaindex.
- Returns:
AAIndexData
, if iterable contains several entries, parsing stops at separation sequence (‘//’). None is returned if nothing could be parsed.- Raises:
descriptive error in case of corrupt data