Structure Comparison
This module defines functions for comparing and mapping polypeptide chains.
- prody.proteins.compare.alignChains(atoms, target, match_func=<function bestMatch>, **kwargs)[source]
Aligns chains of atoms to those of target using
mapOntoChains()andcombineAtomMaps(). Please check out those two functions for details about the parameters.
- prody.proteins.compare.combineAtomMaps(mappings, target=None, **kwargs)[source]
Builds a grand
AtomMapinstance based on mappings obtained frommapOntoChains(). The function also accepts the outputmapOntoChain()but will trivially return all theAtomMapin mappings. mappings should be a list or an array of matching chains in a tuple that contain 4 items:- Parameters:
mappings (tuple, list,
ndarray) – a list or an array of matching chains in a tuple, or just the tupletarget (
Atomic) – reference structure for superposition and checking RMSDdrmsd (float) – amount deviation of the RMSD with respect to the top ranking atommap. This is to allow multiple matches when mobile has more chains than target. Default is 3.0
rmsd_reject (float) – upper RMSD cutoff that rejects an atommap. Default is 15.0
least (int) – the least number of atommaps requested. If None, it will be automatically determined by the number of chains present in target and mobile. Default is None
debug (dict) – a container (dict) that saves the following information for debugging purposes: * coverage: original coverage matrix, rows and columns correspond to the reference and the mobile, respectively, * solutions: matched index groups that obtained by modeling the coverage matrix as a linear assignment problem, * rmsd: a list of ranked RMSDs of identified atommaps.
- prody.proteins.compare.getGapExtPenalty()[source]
Returns gap extension penalty used for pairwise alignment.
- prody.proteins.compare.getGapPenalty()[source]
Returns gap opening penalty used for pairwise alignment.
- prody.proteins.compare.mapChainOntoChain(mobile, target, **kwargs)[source]
Map mobile chain onto target chain. This function returns a mapping that contains 4 items:
Mappings are returned in decreasing percent sequence identity order.
AtomMapthat keeps mapped atom indices contains dummy atoms in place of unmapped atoms.- Parameters:
- Keyword Arguments:
seqid – percent sequence identity, default is 90. Note that this parameter is only effective for sequence alignment
overlap – percent overlap with target, default is 70
mapping – what method will be used if the trivial mapping based on residue numbers fails. If
"ce"or"cealign", then the CE structural alignment [IS98] will be performed. It can also be a list of prealigned sequences, aMSAinstance, or a dict of indices such as that derived from aDaliRecord. If set to True then the sequence alignment from Biopython will be used. If set to False, only the trivial mapping will be performed. Default is “auto”, which means try sequence alignment then CE.pwalign – if True, then pairwise sequence alignment will be performed. If False then a simple mapping will be performed based on residue numbers (as well as insertion codes). This will be overridden by the mapping keyword’s value.
[IS98]Shindyalov IN, Bourne PE. Protein structure alignment by incremental combinatorial extension (CE) of the optimal path. Protein engineering 1998 11(9):739-47.
- prody.proteins.compare.mapOntoChain(atoms, chain, **kwargs)[source]
Map atoms onto chain. This function is a wrapper of
mapChainOntoChain()that manages to map chains onto target chain. The function returns a list of mappings. Each mapping is a tuple that contains 4 items:Mappings are returned in decreasing percent sequence identity order.
AtomMapthat keeps mapped atom indices contains dummy atoms in place of unmapped atoms.- Parameters:
- Keyword Arguments:
subset – one of the following well-defined subsets of atoms:
"calpha"(or"ca"),"backbone"(or"bb"),"heavy"(or"noh"), or"all", default is"calpha"
See
mapChainOntoChain()for other keyword arguments. This function tries to map atoms to chain based on residue numbers and types. Each individual chain in atoms is compared to target chain.[IS98]Shindyalov IN, Bourne PE. Protein structure alignment by incremental combinatorial extension (CE) of the optimal path. Protein engineering 1998 11(9):739-47.
- prody.proteins.compare.mapOntoChainByAlignment(atoms, chain, **kwargs)[source]
This function is similar to
mapOntoChain()but correspondence of chains is found by alignment provided.- Parameters:
alignments (list, dict,
MSA) – A list of predefined alignments. It can be also a dictionary orMSAinstance where the keys or labels are the title of atoms or chains.
- prody.proteins.compare.mapOntoChains(atoms, ref, match_func=<function bestMatch>, **kwargs)[source]
This function is a generalization and wrapper of
mapOntoChain()that manages to map chains onto chains (instead of a single chain).
- prody.proteins.compare.matchAlign(mobile, target, **kwargs)[source]
Superpose mobile onto target based on best matching pair of chains. This function uses
matchChains()for matching chains and returns a tuple that contains the following items:- Parameters:
- Keyword Arguments:
seqid – percent sequence identity, default is 90
overlap – percent overlap, default is 90
pwalign – perform pairwise sequence alignment
- prody.proteins.compare.matchChains(atoms1, atoms2, **kwargs)[source]
Returns pairs of chains matched based on sequence similarity. Makes an all-to-all comparison of chains in atoms1 and atoms2. Chains are obtained from hierarchical views (
HierView) of atom groups. This function returns a list of matching chains in a tuple that contain 4 items:List of matches are sorted in decreasing percent sequence identity order.
AtomMapinstances can be used to calculate RMSD values and superpose atom groups.- Parameters:
- Keyword Arguments:
subset – one of the following well-defined subsets of atoms:
"calpha"(or"ca"),"backbone"(or"bb"),"heavy"(or"noh"), or"all", default is"calpha"seqid – percent sequence identity, default is 90
overlap – percent overlap, default is 90
pwalign – perform pairwise sequence alignment
If subset is set to calpha or backbone, only alpha carbon atoms or backbone atoms will be paired. If set to all, all atoms common to matched residues will be returned.
This function tries to match chains based on residue numbers and names. All chains in atoms1 is compared to all chains in atoms2. This works well for different structures of the same protein. When it fails, Biopython is used for pairwise sequence alignment, and matching is performed based on the sequence alignment. User can control, whether sequence alignment is performed or not with pwalign keyword. If
pwalign=Trueis passed, pairwise alignment is enforced.
- prody.proteins.compare.setAlignmentMethod(method)[source]
Set pairwise alignment method (global or local).
- prody.proteins.compare.setGapExtPenalty(gap_ext_penalty)[source]
Set gap extension penalty used for pairwise alignment.
- prody.proteins.compare.setGapPenalty(gap_penalty)[source]
Set gap opening penalty used for pairwise alignment.