Skip to content

Instantly share code, notes, and snippets.

@universvm
Last active July 26, 2021 14:01
Show Gist options
  • Save universvm/f9f6f6d4506e4bbec54004bf4cd1d4e3 to your computer and use it in GitHub Desktop.
Save universvm/f9f6f6d4506e4bbec54004bf4cd1d4e3 to your computer and use it in GitHub Desktop.
Convert TIMED-style benchmark predictions to json file
# Written by Rokas Petrenas (https://github.com/rokaske199)
from benchmark import get_cath
from pathlib import Path
import json
PATH_TO_PDB=Path('/scratch/datasets/pdb/')
cath_location = "cath-domain-description-file.txt"
cath_df = get_cath.read_data(cath_location)
#select only monomers
new_df=get_cath.filter_with_user_list(cath_df,"/home/s1706179/project/sequence-recovery-benchmark/monomers_af2.txt")
#choose your model
path_to_file=Path("/home/s1706179/project/sequence-recovery-benchmark/publication_data/default.csv")
predictions = get_cath.load_prediction_matrix(new_df, path_to_file.with_suffix('.txt'), path_to_file)
sequences={}
for x in predictions:
sequences[x]=get_cath.most_likely_sequence(predictions[x])
with open('monomers_af.json', 'w') as f:
json.dump(sequences, f)
@universvm
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment