Created
September 5, 2016 00:22
-
-
Save Alexhuszagh/155df91af93bafcda7efc33746dd39ab to your computer and use it in GitHub Desktop.
Align Matrix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
align_matrix | |
------------ | |
Aligns two sturctures and prints the distance matrix (complete) | |
between the two aligned matrices. | |
:author: Alex Huszagh | |
:license: Unlicense, or MIT | |
''' | |
from pymol import cmd | |
def align_matrix(first, second): | |
''' | |
Align two structures and get the full alignment distance pair. | |
Args: | |
first - object name for first structure | |
second - object name for second structure | |
''' | |
cmd.super("%s & guide" %first, "%s & guide" %second, object="aln") | |
pairs = cmd.get_raw_alignment('aln') | |
for pair in pairs: | |
print(pair, cmd.get_distance(pair[0], pair[1])) | |
cmd.delete("aln") | |
cmd.extend('align_matrix', align_matrix) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment