Last active
July 25, 2021 10:04
-
-
Save aozalevsky/d909bf95c34e35f296b99a3900817ec4 to your computer and use it in GitHub Desktop.
Snippet to map alphafold multi-fragment structures to the reference sequence
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
import prody | |
# Set fname | |
fname = 'AF-Q96M86-F13-model_v1.cif.gz' | |
# Use prody to parse AlphaFold structure in mmCIF format | |
pdb, header = prody.parseMMCIF(fname, header=True) | |
# extract coordinates of the fragment in the reference sequence | |
# e.g. Uniprot AC Q96M86 | |
# remember, that both PDB and Uniprot start counting from 1 | |
# index of first residue | |
b = int(header[0].search('_ma_target_ref_db_details.seq_db_align_begin').data[0]) | |
# index of last residue | |
e = int(header[0].search('_ma_target_ref_db_details.seq_db_align_end').data[0]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment