Skip to content

Commit d3e6231

Browse files
committed
Support DockGen in mmCIF to PDB and apo-to-holo alignment scripts
1 parent ed3cdf2 commit d3e6231

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

posebench/data/components/convert_mmcif_to_pdb.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@ def main(cfg: DictConfig):
4444
if cfg.lowercase_id:
4545
# Support the DockGen dataset's hybrid lowercase-uppercase pdb id-CCD ID format
4646
new_id_parts = new_id.split("_")
47-
new_id = "_".join([part.lower() for part in new_id_parts[:2]] + new_id_parts[2:])
47+
new_id = (
48+
"_".join([part.lower() for part in new_id_parts[:2]])
49+
+ "_"
50+
+ "-".join([part.upper() for part in new_id_parts[2:-1]])
51+
+ "_"
52+
+ new_id_parts[-1]
53+
)
4854
else:
4955
new_id = new_id.upper()
5056
mmcif_filepath = os.path.join(

posebench/data/components/protein_apo_to_holo_alignment.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ def read_mols(
119119
ligs.append(lig)
120120
else:
121121
for file in os.listdir(os.path.join(dataset_dir, name)):
122-
if file.endswith("_ligand.sdf") and "rdkit" not in file:
122+
if (
123+
file.endswith("_ligand.sdf") or file.endswith("_ligand.pdb")
124+
) and "rdkit" not in file:
123125
lig = read_molecule(
124126
os.path.join(dataset_dir, name, file), remove_hs=remove_hs, sanitize=True
125127
)

0 commit comments

Comments
 (0)