Created
May 12, 2020 18:59
-
-
Save collinarnett/484c800210454efecfa980990320a6c6 to your computer and use it in GitHub Desktop.
Create alpha-carbon distance maps
This file contains hidden or 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
def calc_dist_matrix(residues): | |
"""Returns a matrix of distances between residues of the same chain.""" | |
size = len(residues) | |
answer = np.zeros((size, size), np.float) | |
for row, residue_one in enumerate(residues): | |
for col, residue_two in enumerate(residues): | |
answer[row, col] = residue_one["CA"] - residue_two["CA"] | |
return answer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment