Sba formfactors#5
Conversation
IVinterbladh
commented
May 29, 2026
- Removed incorrect Amino acid form factors from Single_beads.yaml
- Added yaml-files for the polynomial form factor for the amino acid and matrini3 beads. Both with and without excluded solvent in addition to pure excluded solvent models.
- Added a new excluded solvent method where a polynomial form factor from the yaml-file is used.
- Updated python notebook for plotting results.
… such that pripps can read martini structures and the martini form factors. Added a new excluded solvent option 'polynomial', where a yaml file with the polynomial coefficients are given.
There was a problem hiding this comment.
Pull request overview
This PR adds support for polynomial form-factor tables (including a new “polynomial” excluded-volume model) and updates the structure atom-kind resolution to support residue-scoped coarse-grained names, alongside new/updated test datasets and form-factor assets.
Changes:
- Added a new excluded-volume model (
ExcludedVolume::Polynomial) that reads per-kind excluded-volume form factors from a dedicated YAML table. - Updated structure atom-kind lookup to prefer residue-scoped keys (
RES_ATOM) before falling back to united-atom and atom-name-only lookup (with unit tests). - Added/updated polynomial form-factor YAML/CSV assets and supplemental test/example inputs (lysozyme XYZ, batch fitting script, README updates).
Reviewed changes
Copilot reviewed 22 out of 25 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/lysozyme/lyzexp.dat | Adjusts lysozyme experimental data header/comment line. |
| tests/lysozyme/6lyz.xyz | Adds an XYZ structure file for lysozyme test/example usage. |
| src/structure.rs | Adds residue-scoped atom-kind resolution with tests. |
| src/solvent/polynomial_excluded.rs | Implements polynomial excluded-volume dummy generation from a separate YAML table (+ tests). |
| src/solvent/mod.rs | Wires the new ExcludedVolume::Polynomial variant into solvent dummy generation and scaling. |
| src/cli.rs | Adds CLI support for --excluded polynomial and an optional --excluded-atomfile path. |
| README.md | Documents the new excluded-volume option and excluded_atomfile parameter in Python examples/tables. |
| pripps-py/src/lib.rs | Exposes excluded_atomfile and the polynomial excluded model in the Python bindings. |
| pripps-py/examples/batch_sba_sasbdb.py | Adds a batch-fitting helper script for SASBDB cache entries using the polynomial excluded-volume model. |
| assets/single_bead.yaml | Updates/removes incorrect single-bead form factors and reorganizes amino-acid bead definitions. |
| assets/poly_martini_excl.yaml | Adds Martini polynomial excluded-volume form-factor table (YAML). |
| assets/poly_martini_excl.csv | Adds Martini polynomial excluded-volume coefficients source (CSV). |
| assets/poly_martini_atomic.yaml | Adds Martini polynomial atomic form-factor table (YAML). |
| assets/poly_martini_atomic.csv | Adds Martini polynomial atomic coefficients source (CSV). |
| assets/poly_martini_atev.yaml | Adds Martini polynomial ATEV form-factor table (YAML). |
| assets/poly_martini_atev.csv | Adds Martini polynomial ATEV coefficients source (CSV). |
| assets/poly_excl.yaml | Adds amino-acid polynomial excluded-volume form-factor table (YAML). |
| assets/poly_excl.csv | Adds amino-acid polynomial excluded-volume coefficients source (CSV). |
| assets/poly_atomic.yaml | Adds amino-acid polynomial atomic form-factor table (YAML). |
| assets/poly_atev.yaml | Adds amino-acid polynomial ATEV form-factor table (YAML). |
| assets/poly_atev.csv | Adds amino-acid polynomial ATEV coefficients source (CSV). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…d the pdf files of lysozyme
…f the same file as the atomistic form factors and not a separate file. Code changed accordingly such that the excluded solvent form factors will be called from the same file as the others.
…ady had it)and added such that all three have the same scaling to experimental data
… hydration shell points from grid method
…nts from the model when using the grid version
Polynomial excluded volume reads `excluded_solvent` from the per-bead entries in the main atom file, so the separate `excluded_atomfile` / `--excluded-atomfile` parameter is dead surface area. Remove it from the CLI args and from all three pyo3 model constructors plus the `solvent_from_kwargs` helper. Drop the now-orphaned `log` dependency in pripps-py (its only direct use was the deprecation warning). Also: - polynomial_excluded: defer the `kind_name` lookup into the error path - structure: collapse nested `if let` into a let-chain (clippy)
…ders The "polynomial" excluded-volume model named an incidental form-factor representation rather than its mechanism: it reads an explicit per-kind `excluded_solvent` form factor from the table (which need not be a polynomial), unlike the geometry-derived Fraser/FoXS/Grid/Voronoi variants. Rename the model to `PerKind` across the enum, CLI (`--excluded per-kind`), Python bindings (`excluded="per-kind"`), the module file (`per_kind_excluded.rs`), and README. The per-kind `excluded_solvent` field name is unchanged. Also clarify the poly_ asset header comments: the plain files keep the excluded solvent as a separate, fittable `excluded_solvent` term (`--excluded per-kind`), while the `_combined` files fold it into a single form factor (`--excluded disabled`). Fix stale CSV provenance lines to reference the current file names.
The PerKind rename of the excluded-volume model broke the example references to the old `excluded="polynomial"` string. Update the batch script and the notebook source cell to `excluded="per-kind"`. Also rename the cryptic batch_sba_sasbdb.py to batch_single_bead_fit_sasbdb.py (matching the notebook's spelled-out "single-bead") and expand SBA/SASBDB in its docstring.
|
@IVinterbladh
So both the filename Could you either split it into separate atomistic and CG-bead files, or at least pick a name that covers both and rewrite the header comment to describe the two parts? Just flagging so the asset names stay self-explanatory. |
The `excluded_solvent` form-factor field was shown in the YAML example and the model/shipped-files tables but never explained: add a property- table row and a paragraph describing that it is a second form factor for the displaced bulk solvent, read only by the `per-kind` excluded-volume model. Also add a `!Linear` example to the YAML snippet so every model in the supported-models table is illustrated.
List all seven shipped YAML assets (was three): add stovgaard2010, poly_martini, and both `_combined` variants, pair each `per-kind` file with its `combined` counterpart, and correct the gaussian_atoms entry to note it is a mixed residue-polynomial + atomic-Gaussian table.
These two classes arrived from master (PR #5) after the original docstring commit, so they lacked the class-level `__doc__` that Pripps and MultipoleModel already carry. Mirror the same description.