forked from nf-core/proteinfold
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
239 additions
and
149 deletions.
There are no files selected for viewing
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env python | ||
import pickle | ||
import os, sys | ||
import argparse | ||
|
||
def read_pkl(id, pkl_files): | ||
for pkl_file in pkl_files: | ||
dict_data = pickle.load(open(pkl_file,'rb')) | ||
#print(dict_data.keys()) | ||
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) |
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
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
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
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
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
Oops, something went wrong.