Load data from JSON rather than pickle.
Increases platform independence.
This commit is contained in:
@@ -3,6 +3,7 @@ from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
import pickle,sys,os,math,propka.calculations
|
||||
import json
|
||||
|
||||
import pkg_resources
|
||||
from propka.lib import info, warning
|
||||
@@ -28,11 +29,9 @@ class bondmaker:
|
||||
self.max_sq_distance = max(list(self.distances_squared.values())+[self.default_dist_squared])
|
||||
|
||||
# protein bonding data
|
||||
self.data_file_name = pkg_resources.resource_filename(__name__, 'protein_bonds.dat')
|
||||
|
||||
data = open(self.data_file_name,'rb')
|
||||
self.protein_bonds = pickle.load(data)
|
||||
data.close()
|
||||
self.data_file_name = pkg_resources.resource_filename(__name__, 'protein_bonds.json')
|
||||
with open(self.data_file_name,'rt') as json_file:
|
||||
self.protein_bonds = json.load(json_file)
|
||||
|
||||
|
||||
self.intra_residue_backbone_bonds = {'N': ['CA'],
|
||||
|
||||
Reference in New Issue
Block a user