What data structure is used in representing protein structures in computers so that we can apply algorithms?
Matrix or Graph or tree?
P.S. I am absolutely new to Bioinformatics.
Bioinformatics Stack Exchange is a question and answer site for researchers, developers, students, teachers, and end users interested in bioinformatics. It only takes a minute to sign up.
Sign up to join this communityWhat data structure is used in representing protein structures in computers so that we can apply algorithms?
Matrix or Graph or tree?
P.S. I am absolutely new to Bioinformatics.
comments from above fleshed out.
Both: A graph network is a handy way to represent a molecule, but a matrix makes for fast maths.
A graph network is a list of nodes
(atoms), a list of edges
, the connections between nodes and a list of properties
associated with the nodes (symbol, name, index, residue index, residue number, chain, coordinates etc.) and occasionally a list of those of the edges (single, double etc.).
A protein is a big molecule. Same rules apply.
A small compound can be represented with a string, i.e. SMILES, which is a form of graph network even if it looks nothing like one.
In a mol file and its sdf/mol2 derivatives, a tabular representation is used to store coordinates (properties
) of the atoms of the small molecule (top part below), while the connectivity has an edge-node relationship, i.e. are edges. Note that the index of the properties in the first block is the id of the atom.
RDKit 3D
12 12 0 0 0 0 0 0 0 0999 V2000
-5.5310 24.4560 -8.2060 O 0 0 0 0 0 0 0 0 0 0 0 0
0.9560 21.4190 -7.6300 O 0 0 0 0 0 0 0 0 0 0 0 0
-5.4170 23.9250 -6.8750 C 0 0 0 0 0 0 0 0 0 0 0 0
0.2770 19.3290 -8.7330 O 0 0 0 0 0 0 0 0 0 0 0 0
-3.9460 23.5670 -6.5510 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.3270 19.7590 -6.4400 O 0 0 0 0 0 0 0 0 0 0 0 0
-3.4590 22.5590 -7.5870 N 0 0 0 0 0 0 0 0 0 0 0 0
-3.5890 23.1360 -8.9920 C 0 0 0 0 0 0 0 0 0 0 0 0
-5.0600 23.5190 -9.2240 C 0 0 0 0 0 0 0 0 0 0 0 0
-2.0390 22.1150 -7.2780 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.6090 21.0030 -8.2230 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.0430 20.3530 -7.7350 S 0 0 1 0 0 0 0 0 0 0 0 0
1 3 1 0
1 9 1 0
3 5 1 0
9 8 1 0
12 2 1 1
12 4 1 0
12 6 1 0
12 11 1 0
5 7 1 0
7 8 1 0
7 10 1 0
10 11 1 0
M END
A PDB, CIF, etc. file is the same. It has a per-atom tabular representation of the properties, with an optional connectivity part (CONECT
entries) for non-standard residues (not AAs and DNA).
Now when these are loaded into memory, they become an array of atoms and bonds, each with their properties —graph network.
However, the coordinates within get often converted into a matrix for speedy operations. For example to calculate an atom to atom distance matrix, converting the coordinates with the array of atoms to a matrix can be very easily be converted into a distance matrix via simple matrix calculations.
So both matrix representations and graph network representations are used.
For 3D visualisation, a pre-existing library is used and bonds and atoms become primitive shapes, whose splines may be connected to each other (in knots/vertices) or simply the bonds shapes clip through the atoms. That is there is not graph relationship.