Skip to content

Commit

Permalink
Merge pull request #12 from glycojones/fix-absent-chain-bug-for-iris
Browse files Browse the repository at this point in the history
tortoize entries exist for non-amino acid chains
  • Loading branch information
glycojones authored Mar 17, 2023
2 parents 7c19750 + e92a2ba commit 8a7ca2b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions iris_validation/metrics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ def _get_covariance_data(model_path,
return covariance_data


def _get_tortoize_data(model_path, model_id=None, out_queue=None):
rama_z_data = {}
def _get_tortoize_data(model_path, seq_nums, model_id=None, out_queue=None):
rama_z_data = {chain_id: {} for chain_id in seq_nums.keys()}
try:
tortoize_process = subprocess.Popen(
f'tortoize {model_path}',
Expand All @@ -190,8 +190,7 @@ def _get_tortoize_data(model_path, model_id=None, out_queue=None):
tortoize_dict = json.loads(tortoize_output)
residues = tortoize_dict["model"]["1"]["residues"]
for res in residues:
chain_rama_z_data = rama_z_data.setdefault(res['pdb']['strandID'], {})
chain_rama_z_data[res['pdb']['seqNum']] = res['ramachandran']['z-score']
rama_z_data[res['pdb']['strandID']][res['pdb']['seqNum']] = res['ramachandran']['z-score']

if out_queue is not None:
out_queue.put(('rama_z', model_id, rama_z_data))
Expand Down Expand Up @@ -271,13 +270,13 @@ def metrics_model_series_from_files(model_paths,
if calculate_rama_z:
if multiprocessing:
p = Process(target=_get_tortoize_data,
args=(model_path,),
args=(model_path, seq_nums),
kwargs={ 'model_id': model_id,
'out_queue': results_queue })
p.start()
num_queued += 1
else:
rama_z_data = _get_tortoize_data(model_path)
rama_z_data = _get_tortoize_data(model_path, seq_nums)

all_minimol_data.append(minimol)
all_covariance_data.append(covariance_data)
Expand Down

0 comments on commit 8a7ca2b

Please sign in to comment.