MCPcopy Create free account
hub / github.com/DeepGraphLearning/S3F / load_protein

Function load_protein

script/preload_dataset.py:12–23  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

10
11
12def load_protein(file):
13 try:
14 data_object = protein.from_pdb_string(open(file).read()).to_dict()
15 except ValueError as err:
16 print("Fail to load pdb %s." % os.path.basename(file), err)
17 return
18
19 file = os.path.basename(file)
20 name, ext = os.path.splitext(file)
21 output_fname = os.path.join(output_dir, name+".pkl")
22 with open(output_fname, "wb") as f:
23 pickle.dump(data_object, f, protocol=pickle.HIGHEST_PROTOCOL)
24
25
26parser = argparse.ArgumentParser()

Callers 1

preload_dataset.pyFile · 0.70

Calls 1

to_dictMethod · 0.80

Tested by

no test coverage detected