Skip to content

Add hard excluded-volume filtering - #8

Open
zfried wants to merge 2 commits into
masterfrom
feature/soft-excluded-volume
Open

zfried wants to merge 2 commits into
masterfrom
feature/soft-excluded-volume

Conversation

@zfried

@zfried zfried commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

This adds excluded-volume filtering to constrained conformer generation.

The excluded volume is provided as a set of 3D positions, along with either atomic numbers or explicit radii. If atomic numbers are provided, their vdw radii are looked up automatically. If radii are provided, those values are used directly. Providing both is rejected because it would be ambiguous.

For every ligand–excluded-volume atom pair, the minimum allowed distance is:

minimum distance = radius_scale × (ligand radius + excluded-volume radius)

The default radius scale is 0.7. (just figured having a param for strictness here would be nice)

The overlap for each atom pair is calculated as:

max(1 − actual distance² / minimum distance², 0)

This is zero when the atoms are far enough apart and positive when they overlap. These values are summed over all ligand–excluded-volume atom pairs to give the total clash score. For filtering, the size of the score does not affect ranking: any score greater than zero means the conformer clashes and is removed.

Before conformer generation starts, the constrained atoms are checked against the excluded volume. Since these atoms remain fixed, generation fails early with a clear error if any of them overlap. Unconstrained atoms may overlap in the starting geometry because they are still free to move.

This introduces excluded-volume filtering at several points in conformer generation.

During torsion multi-try, OpenConf generates up to four trials and calculates an excluded-volume score for each one. A score of zero means the trial is clear, while any score greater than zero means it clashes and is removed. The size of the excluded-volume score is not used for ranking.

If several trials have a score of zero, OpenConf uses the existing internal-clash score to choose between them (this is the same as the case without excluded-volume score). If every trial clashes, none of them are accepted.

Candidates are checked again after minimization, including candidates from the constrained, batch, and low-mode generation paths. This catches conformers that move into the excluded volume during minimization.

Before final selection, all remaining conformers in the pool are checked and any clashing conformers are removed. The existing diverse or energy-based selection then runs on only the clash-free conformers. After final refinement, the selected conformers receive one last excluded-volume check.

If no clash-free conformers remain, OpenConf raises an error instead of returning a clashing conformer. When no excluded volume is supplied, these new checks are disabled and the previous behavior is unchanged.

When no excluded volume, functionality didn't change from before at all.

Have had some good results testing this on JACS set.

@zfried
zfried requested a review from corinwagen September 4, 2026 18:24
@corinwagen

corinwagen commented Sep 4, 2026 •

Copy link
Copy Markdown
Member

The default radius scale is 0.7. (just figured having a param for strictness here would be nice)

I'm not 100% sure this makes sense?

like the story is a bit weird:
> be me
> call function with radius 3.0
> function blocks anything with radius clash < 2.1
> confuse.jpg

maybe better to just have the radius be the radius - is the issue that vdw is too large? covalent might be better if so?

@corinwagen corinwagen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable and generally in-line w/ openconf vibes. Modulo comment lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants