Commit 84ac2ec9 authored by Sachin Kadyan's avatar Sachin Kadyan
Browse files

Bug fix #4: Obsolete PDBs were not getting replaced by newer ones.

parent 1f87c6e5
......@@ -798,6 +798,8 @@ def _process_single_hit(
hit: parsers.TemplateHit,
mmcif_dir: str,
max_template_date: datetime.datetime,
release_dates: Mapping[str, datetime.datetime],
obsolete_pdbs: Mapping[str, str],
kalign_binary_path: str,
strict_error_check: bool = False,
) -> SingleHitResult:
......@@ -805,6 +807,10 @@ def _process_single_hit(
# Fail hard if we can't get the PDB ID and chain name from the hit.
hit_pdb_code, hit_chain_id = _get_pdb_id_and_chain(hit)
if hit_pdb_code not in release_dates:
if hit_pdb_code in obsolete_pdbs:
hit_pdb_code = obsolete_pdbs[hit_pdb_code]
mapping = _build_query_to_hit_index_mapping(
hit.query,
hit.hit_sequence,
......@@ -1054,6 +1060,8 @@ class TemplateHitFeaturizer:
hit=hit,
mmcif_dir=self._mmcif_dir,
max_template_date=template_cutoff_date,
release_dates=self._release_dates,
obsolete_pdbs=self._obsolete_pdbs,
strict_error_check=self._strict_error_check,
kalign_binary_path=self._kalign_binary_path,
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment