Skip to content

Instantly share code, notes, and snippets.

@aozalevsky
Last active July 25, 2021 10:04
Show Gist options
  • Save aozalevsky/d909bf95c34e35f296b99a3900817ec4 to your computer and use it in GitHub Desktop.
Save aozalevsky/d909bf95c34e35f296b99a3900817ec4 to your computer and use it in GitHub Desktop.
Snippet to map alphafold multi-fragment structures to the reference sequence
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