Skip to content

Commit

Permalink
Merge pull request #182 from ziadbkh/visualisation
Browse files Browse the repository at this point in the history
 Produce an interactive html report for the predecited strucures
  • Loading branch information
ziadbkh authored Oct 4, 2024
2 parents 98ab01c + 62669fe commit 7789713
Show file tree
Hide file tree
Showing 17 changed files with 1,499 additions and 23 deletions.
Empty file added assets/NO_FILE
Empty file.
944 changes: 944 additions & 0 deletions assets/proteinfold_template.html

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions bin/extract_output.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env python
import pickle
import os
import argparse


def read_pkl(id, pkl_files):
for pkl_file in pkl_files:
dict_data = pickle.load(open(pkl_file, "rb"))
if pkl_file.endswith("features.pkl"):
with open(f"{id}_msa.tsv", "w") as out_f:
for val in dict_data["msa"]:
out_f.write("\t".join([str(x) for x in val]) + "\n")
else:
model_id = (
os.path.basename(pkl_file)
.replace("result_model_", "")
.replace("_pred_0.pkl", "")
)
with open(f"{id}_lddt_{model_id}.tsv", "w") as out_f:
out_f.write("\t".join([str(x) for x in dict_data["plddt"]]) + "\n")


parser = argparse.ArgumentParser()
parser.add_argument("--pkls", dest="pkls", required=True, nargs="+")
parser.add_argument("--name", dest="name")
parser.add_argument("--output_dir", dest="output_dir")
parser.set_defaults(output_dir="")
parser.set_defaults(name="")
args = parser.parse_args()

read_pkl(args.name, args.pkls)
Loading

0 comments on commit 7789713

Please sign in to comment.