pytorch-frustratometer 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. pytorch_frustratometer-0.1.0/.gitignore +70 -0
  2. pytorch_frustratometer-0.1.0/AUTHORS.md +18 -0
  3. pytorch_frustratometer-0.1.0/CHANGELOG.md +48 -0
  4. pytorch_frustratometer-0.1.0/CONTRIBUTING.md +35 -0
  5. pytorch_frustratometer-0.1.0/PKG-INFO +612 -0
  6. pytorch_frustratometer-0.1.0/README.md +564 -0
  7. pytorch_frustratometer-0.1.0/pyproject.toml +125 -0
  8. pytorch_frustratometer-0.1.0/pytorch_frustratometer/__init__.py +50 -0
  9. pytorch_frustratometer-0.1.0/pytorch_frustratometer/__main__.py +3 -0
  10. pytorch_frustratometer-0.1.0/pytorch_frustratometer/algorithm/__init__.py +32 -0
  11. pytorch_frustratometer-0.1.0/pytorch_frustratometer/algorithm/awsem.py +575 -0
  12. pytorch_frustratometer-0.1.0/pytorch_frustratometer/algorithm/configurational.py +529 -0
  13. pytorch_frustratometer-0.1.0/pytorch_frustratometer/algorithm/decoy_statistics.py +74 -0
  14. pytorch_frustratometer-0.1.0/pytorch_frustratometer/algorithm/mj.py +180 -0
  15. pytorch_frustratometer-0.1.0/pytorch_frustratometer/algorithm/mutational.py +1059 -0
  16. pytorch_frustratometer-0.1.0/pytorch_frustratometer/algorithm/singleresidue.py +1862 -0
  17. pytorch_frustratometer-0.1.0/pytorch_frustratometer/analysis/__init__.py +3 -0
  18. pytorch_frustratometer-0.1.0/pytorch_frustratometer/analysis/dynamic_clusters.py +613 -0
  19. pytorch_frustratometer-0.1.0/pytorch_frustratometer/base.py +543 -0
  20. pytorch_frustratometer-0.1.0/pytorch_frustratometer/cli.py +658 -0
  21. pytorch_frustratometer-0.1.0/pytorch_frustratometer/coefficients.py +203 -0
  22. pytorch_frustratometer-0.1.0/pytorch_frustratometer/data/__init__.py +2 -0
  23. pytorch_frustratometer-0.1.0/pytorch_frustratometer/data/burial_gamma.dat +20 -0
  24. pytorch_frustratometer-0.1.0/pytorch_frustratometer/data/dataset.py +439 -0
  25. pytorch_frustratometer-0.1.0/pytorch_frustratometer/data/io.py +1761 -0
  26. pytorch_frustratometer-0.1.0/pytorch_frustratometer/data/shard_formats.py +778 -0
  27. pytorch_frustratometer-0.1.0/pytorch_frustratometer/data/shard_io.py +48 -0
  28. pytorch_frustratometer-0.1.0/pytorch_frustratometer/data/shard_writer.py +183 -0
  29. pytorch_frustratometer-0.1.0/pytorch_frustratometer/data/water_gamma.dat +421 -0
  30. pytorch_frustratometer-0.1.0/pytorch_frustratometer/frustratometer.py +1432 -0
  31. pytorch_frustratometer-0.1.0/pytorch_frustratometer/original_code/AWSEM.py +369 -0
  32. pytorch_frustratometer-0.1.0/pytorch_frustratometer/original_code/GenerateVisualizations.pl +82 -0
  33. pytorch_frustratometer-0.1.0/pytorch_frustratometer/original_code/Pdb2Gro.py +106 -0
  34. pytorch_frustratometer-0.1.0/pytorch_frustratometer/original_code/atomisitc_frustration.py +312 -0
  35. pytorch_frustratometer-0.1.0/pytorch_frustratometer/original_code/draw_links.py +124 -0
  36. pytorch_frustratometer-0.1.0/pytorch_frustratometer/original_code/fix_backbone.cpp +8232 -0
  37. pytorch_frustratometer-0.1.0/pytorch_frustratometer/original_code/fix_backbone.h +527 -0
  38. pytorch_frustratometer-0.1.0/pytorch_frustratometer/original_code/functions.R +1507 -0
  39. pytorch_frustratometer-0.1.0/pytorch_frustratometer/original_code/smart_matrix_lib.h +652 -0
  40. pytorch_frustratometer-0.1.0/pytorch_frustratometer/plots/__init__.py +0 -0
  41. pytorch_frustratometer-0.1.0/pytorch_frustratometer/plots/common.py +355 -0
  42. pytorch_frustratometer-0.1.0/pytorch_frustratometer/plots/debug/__init__.py +0 -0
  43. pytorch_frustratometer-0.1.0/pytorch_frustratometer/plots/debug/configurational_outliers.py +186 -0
  44. pytorch_frustratometer-0.1.0/pytorch_frustratometer/plots/debug/frustration_results.py +279 -0
  45. pytorch_frustratometer-0.1.0/pytorch_frustratometer/plots/debug/mutational_outliers.py +133 -0
  46. pytorch_frustratometer-0.1.0/pytorch_frustratometer/plots/debug/offdiagonal_analysis.py +390 -0
  47. pytorch_frustratometer-0.1.0/pytorch_frustratometer/plots/debug/pairwise_results.py +475 -0
  48. pytorch_frustratometer-0.1.0/pytorch_frustratometer/plots/debug/singleresidue_outliers.py +128 -0
  49. pytorch_frustratometer-0.1.0/pytorch_frustratometer/plots/debug/structural_outlier_map.py +291 -0
  50. pytorch_frustratometer-0.1.0/pytorch_frustratometer/plots/mutations.py +1534 -0
  51. pytorch_frustratometer-0.1.0/pytorch_frustratometer/plots/mvsj.py +134 -0
  52. pytorch_frustratometer-0.1.0/pytorch_frustratometer/plots/paper/__init__.py +0 -0
  53. pytorch_frustratometer-0.1.0/pytorch_frustratometer/plots/paper/fig1_kde.py +136 -0
  54. pytorch_frustratometer-0.1.0/pytorch_frustratometer/plots/paper/frustaevo_comparison.py +339 -0
  55. pytorch_frustratometer-0.1.0/pytorch_frustratometer/plots/paper/frustrapy_comparison.py +489 -0
  56. pytorch_frustratometer-0.1.0/pytorch_frustratometer/plots/paper/frustration_results.py +279 -0
  57. pytorch_frustratometer-0.1.0/pytorch_frustratometer/plots/paper/msfa.py +321 -0
  58. pytorch_frustratometer-0.1.0/pytorch_frustratometer/plots/paper/pairwise_results.py +475 -0
  59. pytorch_frustratometer-0.1.0/pytorch_frustratometer/plots/paper/paper_figures.py +2216 -0
  60. pytorch_frustratometer-0.1.0/pytorch_frustratometer/plots/paper/plot_funfam_comparison.py +460 -0
  61. pytorch_frustratometer-0.1.0/pytorch_frustratometer/plots/paper/validation_figures.py +629 -0
  62. pytorch_frustratometer-0.1.0/pytorch_frustratometer/plots/per_protein.py +2029 -0
  63. pytorch_frustratometer-0.1.0/pytorch_frustratometer/plots/plot_self_consistency.py +263 -0
  64. pytorch_frustratometer-0.1.0/pytorch_frustratometer/plots/singleresidue.py +457 -0
  65. pytorch_frustratometer-0.1.0/pytorch_frustratometer/structure/__init__.py +6 -0
  66. pytorch_frustratometer-0.1.0/pytorch_frustratometer/structure/geometry.py +467 -0
  67. pytorch_frustratometer-0.1.0/pytorch_frustratometer/structure/ideal_residues.py +206 -0
  68. pytorch_frustratometer-0.1.0/pytorch_frustratometer/structure/load_structure.py +205 -0
  69. pytorch_frustratometer-0.1.0/pytorch_frustratometer/structure/parse.py +507 -0
  70. pytorch_frustratometer-0.1.0/pytorch_frustratometer/structure/place_ideal_atoms.py +1031 -0
  71. pytorch_frustratometer-0.1.0/pytorch_frustratometer/structure/protein.py +372 -0
  72. pytorch_frustratometer-0.1.0/pytorch_frustratometer/structure/residue_constants.py +751 -0
  73. pytorch_frustratometer-0.1.0/pytorch_frustratometer/utils/__init__.py +1 -0
  74. pytorch_frustratometer-0.1.0/pytorch_frustratometer/utils/density.py +144 -0
  75. pytorch_frustratometer-0.1.0/pytorch_frustratometer/utils/utils.py +138 -0
  76. pytorch_frustratometer-0.1.0/pytorch_frustratometer/utils/weights.py +125 -0
  77. pytorch_frustratometer-0.1.0/tests/data/frustratometeR/README.md +62 -0
  78. pytorch_frustratometer-0.1.0/tests/data/lammps/README.md +29 -0
@@ -0,0 +1,70 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.pyo
5
+ *.pyd
6
+ *.so
7
+ *.egg
8
+ *.egg-info/
9
+ dist/
10
+ build/
11
+ .eggs/
12
+ wheels/
13
+
14
+ # Virtual environments
15
+ .venv/
16
+ venv/
17
+ env/
18
+
19
+ # Distribution / packaging
20
+ .installed.cfg
21
+ pip-wheel-metadata/
22
+ share/python-wheels/
23
+ MANIFEST
24
+
25
+ # Testing
26
+ .tox/
27
+ .nox/
28
+ .coverage
29
+ .coverage.*
30
+ .cache
31
+ htmlcov/
32
+ .pytest_cache/
33
+ results/
34
+
35
+ # Type checkers
36
+ .mypy_cache/
37
+ .dmypy.json
38
+ .pyre/
39
+
40
+ # Editors
41
+ .vscode/
42
+ .idea/
43
+ *.swp
44
+ *.swo
45
+ *~
46
+ .DS_Store
47
+ *.conflict1
48
+
49
+ # Jupyter
50
+ .ipynb_checkpoints/
51
+
52
+ # Project-specific
53
+ *.pdb_singleresidue
54
+ *.pdb_mutational
55
+ *.pdb_configurational
56
+ *.pml
57
+ runs/
58
+ wandb/
59
+
60
+ *.log
61
+ *.lock
62
+ *.pdb
63
+ *.png
64
+
65
+
66
+ # Test fixtures
67
+ !tests/data/*.pdb
68
+ !tests/data/frustratometeR/**/*.pdb_singleresidue
69
+ !tests/data/frustratometeR/**/*.pdb_mutational
70
+ !tests/data/frustratometeR/**/*.pdb_configurational
@@ -0,0 +1,18 @@
1
+ # Code Contributors
2
+
3
+ - Eli J. Draizen <edraizen@gmail.com> ([@edraizen](https://github.com/edraizen))
4
+ - Hana Jaafari ([@HanaJaafari](https://github.com/HanaJaafari))
5
+ - Carlos Bueno <cabb99@gmail.com> ([@cabb99](https://github.com/cabb99))
6
+ - Arnau Llaberia <arnaullaberia27@gmail.com> ([@Zackon123-afk](https://github.com/Zackon123-afk))
7
+ - Ezequiel A. Galpern ([@eagalpern](https://github.com/eagalpern))
8
+ - Franco L. Simonetti <francolsimonetti@gmail.com> ([@francosimonetti](https://github.com/francosimonetti))
9
+
10
+ # Paper Authors
11
+
12
+ Eli J. Draizen, Hana Jaafari, Carlos Bueno, Arnau Llaberia, Finley Clark,
13
+ Ezequiel A. Galpern, Franco L. Simonetti, Maria I. Freiberger, Peter G. Wolynes,
14
+ Diego U. Ferreiro, R. Gonzalo Parra
15
+
16
+ ---
17
+
18
+ Contributions welcome — see [CONTRIBUTING.md](CONTRIBUTING.md).
@@ -0,0 +1,48 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented here.
4
+ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
5
+
6
+ ---
7
+
8
+ ## [Unreleased]
9
+
10
+ ### Added
11
+ - Full PyTorch implementation of single-residue, mutational, and configurational frustration modes
12
+ - GPU-accelerated batch processing via `FrustratometerDataset` and `DataLoader`
13
+ - Multi-chain PDB support with chain-aware residue lookup
14
+ - AWSEM potential with burial and water-mediated terms
15
+ - `Coefficients` dataclass for unified hyperparameter management
16
+ - CLI (`pytorch_frustratometer`) with YAML config and per-field overrides
17
+ - PyMOL `.pml` script generation for visualising frustration on 3D structure
18
+ - Plotting subpackage: frustration distributions, outlier maps, FrustraPy/FrustraEvo comparisons
19
+ - Subpackage layout: `algorithm/`, `data/`, `features/`, `structure/`, `utils/`, `plots/`
20
+ - Optional `[plots]` extra for matplotlib/seaborn/umap dependencies
21
+ - Parity tests against Frustratometer web-server and frustratometeR outputs: residue density, native energies
22
+ and frustration indices in every mode, for single-chain structures and a chain break in contact
23
+ - Exact (decoy-free) mutational frustration: the decoy mean and standard deviation of each contact are the weighted
24
+ moments over all 20 x 20 amino-acid pairs, as single-residue frustration does over the 20 amino acids
25
+ - Plain functions `decoy_aa_frequencies`, `decoy_aa_weights` and `decoy_statistics`
26
+ (`pytorch_frustratometer.algorithm`)
27
+
28
+ ### Changed
29
+ - The residue density counts same-chain pairs with `|i-j| > burial_min_sep`.
30
+ The default `burial_min_sep` is `1`, equivalent to the old `>= 2` convention with default `2`
31
+ - `--min-seq-sep` no longer changes the residue density
32
+ - A `tert_frust_cutoff` (`--cutoff`) shorter than the residue density's reach, `max(well_rmax[0], burial_rmax) +
33
+ 5 / eta` (7.5 A by default), raises an error instead of silently dropping residue pairs from the density
34
+ - Mutational frustration is exact, as single-residue frustration. Results carry no sampling noise, and the decoy
35
+ standard deviation is the population value (divides by N), as in LAMMPS. `--decoys` sets the decoy count of
36
+ configurational frustration and of `--use-c-rand` runs only
37
+ - `--use-c-rand` mutational statistics use the population standard deviation, as in LAMMPS
38
+ - MJ mutational frustration honors `--decoy-distribution` and is exact
39
+ - Mutational decoy energies and their background water are evaluated in chunks of `DECOY_CHUNK_ELEMENTS` contacts x decoys, which bounds the memory of large structures with the same results
40
+
41
+ ### Fixed
42
+ - The residue density matches the AWSEM LAMMPS implementation and the Frustratometer web server
43
+ - Decoys are drawn only from valid standard residues, as in LAMMPS. An unknown residue (`aa_type` 20) inside `seq_mask` was drawn as alanine, and with `--use-c-rand` mutational decoys were drawn by tensor position, so a residue excluded from the calculation shifted the draws
44
+ - `Frustratometer("singleresidue" | "mutational" | "configurational")` returns `Frustratometer3`, the model the CLI uses, instead of raising a method-resolution-order `TypeError`
45
+ - `SingleResidueFrustratometer`, `MutationalFrustratometer` and `ConfigurationalFrustratometer` can be built,
46
+ and so their module CLIs run: their bases repeated a mode mixin that `AWSEM` already holds (`TypeError`).
47
+ Their densities now count different-chain pairs as `Frustratometer3` does, and the single-residue module
48
+ CLI no longer stops with a `NameError` after writing its mutation table
@@ -0,0 +1,35 @@
1
+ # Contributing
2
+
3
+ Contributions are welcome and appreciated.
4
+
5
+ ## Getting started
6
+
7
+ ```bash
8
+ git clone https://github.com/ParraLab-ESBG/pytorch-frustratometer.git
9
+ cd pytorch-frustratometer
10
+ pip install -e ".[plots]"
11
+ ```
12
+
13
+ ## Reporting bugs
14
+
15
+ Open an issue on GitHub with:
16
+ - Python and package version (`pip show pytorch-frustratometer`)
17
+ - A minimal reproducible example
18
+ - Full traceback
19
+
20
+ ## Submitting changes
21
+
22
+ 1. Fork the repository and create a branch from `main`.
23
+ 2. Make your changes. Add or update tests where relevant.
24
+ 3. Ensure existing tests pass: `pytest tests/`
25
+ 4. Open a pull request with a clear description of what changed and why.
26
+
27
+ ## Code style
28
+
29
+ - Follow existing conventions in the file you are editing.
30
+ - Keep functions focused; avoid adding abstractions beyond what the change requires.
31
+ - Default to writing no comments — only add one when the *why* is non-obvious.
32
+
33
+ ## License
34
+
35
+ By contributing you agree that your work will be released under the [CC BY 4.0](LICENSE) licence.