# Structural alignment of proteins by sequence¶

In the field of Bioinformatics it is usual to perform a BLAST search in order to find similar proteins to the one of your interest. If the structures of some of the results are available, you might want to align them all together to see the differences. These structures will usually have mutations, or vary in the number of residues and atom order in the PDB files, which makes simple, full-structural alignment functions fail.

Therefore, HTMD provides the function htmd.molecule.util.sequenceStructureAlignment, which takes two proteins and aligns both structures using their longest sequence aligment.

In this example, we will use Dopamine receptor (PDB code: ‘3PBL’) and Beta Adrenergic receptor (PDB code: ‘3NYA’). Both are GPCR proteins, so they share a great fraction of their sequence. We will use this feature to align their structures.

## Quick Example¶

Adrenergic receptor will be used as the reference

from htmd.ui import *
from htmd.molecule.util import sequenceStructureAlignment

# We will use adrenaline receptor as the reference/template

# Load dopamine receptor and display in red
dop_receptor = Molecule('3PBL')
# The crystal is a dimer, so we discard one of the units
dop_receptor.filter('protein and chain A',_logger=False)
dop_receptor.view(style='NewCartoon',color='1',name='DopRec')

adr_receptor.filter('resid 0 to 342',_logger=False) # filter out the G-protein

# adr_receptor acts as the template
# pick the top result
dop_receptor_aligned = dop_receptor_results[0]

# See the result, dopamine receptor is now aligned and displayed in green
dop_receptor_aligned.view(style='NewCartoon',color='7',name='DopAligned')


## Detailed Explanation¶

First, we load the dopamine receptor. The crystal is a dimer of two receptors, so we discard one of the units.

from htmd.ui import *
from htmd.molecule.util import sequenceStructureAlignment

dop_receptor = Molecule('3PBL')
dop_receptor.filter('protein and chain A') # discard one of the units


Next, we load the beta adrenergic receptor. The G-protein from the Adrenergic receptor (residues from 343 to last) is discarded, to ensure that these region is not used to align both proteins

adr_receptor = Molecule('3NYA')


Let’s see the two proteins together before the alignment. The dopamine receptor is displayed in red.

dop_receptor.view(style='NewCartoon',color='1',name='DopRec') # visualize it in red


Now, both proteins are ready to be aligned, so we call the sequenceStructureAlignment function. The second protein molecule passed to the function acts as the reference, in our case, the adrenaline receptor

dop_receptor_results = sequenceStructureAlignment(dop_receptor,adr_receptor)


dop_receptor_results stores different structural alignments, each using a different portion of the sequence alignment. By default, only the best 10 alignments are stored, but you can modify this behaviour setting the parameter maxalignments to an arbitrary number.

Let’s look at the best result by choosing the first item in dop_receptor_results. Dopamine receptor is shown in green.

dop_receptor_aligned = dop_receptor_results[0] # pick the best result
dop_receptor_aligned.view(style='NewCartoon',color='7',name='DopAligned')