Skip to content

Commit

Permalink
fix: One of lhs_pdb and ref_pdb is required
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Christie authored and alanbchristie committed Jan 11, 2024
1 parent a3aa0c4 commit 1e3ecb2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions viewer/sdf_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,18 @@ def missing_field_check(mol, field, validate_dict):


def check_mol_props(mol, validate_dict):
# check for missing fields
fields = ['ref_pdb', 'ref_mols', 'original SMILES']
# Check for (mandatory, isolated) missing fields
fields = ['ref_mols', 'original SMILES']
for field in fields:
validate_dict = missing_field_check(mol, field, validate_dict)
# More complex checks?
# One of ref_pdb and lhs_pdb must be set
if not (mol.HasProp('ref_pdb') or mol.HasProp('lhs_pdb')):
validate_dict = add_warning(
molecule_name=mol.GetProp('_Name'),
field='ref_pdb/lhs_pdb',
warning_string="Molecule has neither 'ref_pdb' nor 'lhs_pdb' property",
validate_dict=validate_dict,
)

return validate_dict

0 comments on commit 1e3ecb2

Please sign in to comment.