Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
6aea286
Added min_dist option
LV-IQ Jun 21, 2024
5a72a7c
Fixed file functions
LV-IQ Jul 1, 2024
df65be4
Added mindist for one set
LV-IQ Jul 1, 2024
07b5d11
CompatHelper: bump compat for TestItems to 1, (keep existing compat)
Jul 8, 2024
802d34a
Merge pull request #3 from LV-IQ/compathelper/new_version/2024-07-08-…
LV-IQ Jul 23, 2024
f9ce419
Text and version fix (not finished)
LV-IQ Jul 23, 2024
6fe7976
Test examples fix
LV-IQ Jul 23, 2024
15d03b0
Merge branch 'main' into main
LV-IQ Jul 23, 2024
2a50729
Text testing
LV-IQ Jul 23, 2024
55c12aa
Text fixing
LV-IQ Jul 23, 2024
b4e1df3
function fix
LV-IQ Aug 9, 2024
b439ccd
Fixed version
LV-IQ Sep 18, 2024
33ce41d
Merge branch 'main' into main
LV-IQ Mar 6, 2025
65c2002
Added min dist option. Text was revised
LV-IQ Mar 10, 2025
8bee276
Fixed test
LV-IQ Mar 10, 2025
ac122c9
Merge pull request #5 from LV-IQ/Min_dist-addition
LV-IQ Mar 11, 2025
28373bf
functions rework
LV-IQ Mar 19, 2025
c4c3ce8
Add new options
LV-IQ Mar 20, 2025
4761c84
Merge pull request #7 from LV-IQ/Reweight-Functions-Additions
LV-IQ Mar 20, 2025
c859805
Update README.md
LV-IQ Mar 20, 2025
99443cd
Update README.md
LV-IQ Mar 20, 2025
c69b0ec
Merge branch 'm3g:main' into main
LV-IQ Mar 20, 2025
b62922f
Warn fix
LV-IQ Mar 23, 2025
989c131
Function fix
LV-IQ Mar 24, 2025
58f45d8
Function Rework
LV-IQ Mar 24, 2025
1a50155
Function rework and example addition
LV-IQ Mar 25, 2025
217470b
Function addition
LV-IQ Mar 25, 2025
989ee7c
Debug fix
LV-IQ Mar 25, 2025
579c343
.
LV-IQ Mar 25, 2025
1cc9c9f
Debug option
LV-IQ May 12, 2025
7e8904b
Added Dependency
LV-IQ Jun 17, 2025
67cba7a
FullReweight addition
LV-IQ Jun 17, 2025
f58565e
Function Fix
LV-IQ Jun 17, 2025
fbac09c
Function Fix
LV-IQ Jun 17, 2025
2ab9b03
Function fix
LV-IQ Jun 17, 2025
6bd2d07
Dict fix
LV-IQ Jun 17, 2025
12fe54d
More fixing
LV-IQ Jun 17, 2025
efdd4c8
More fixing
LV-IQ Jun 17, 2025
85b6f56
Removed one test
LV-IQ Jun 17, 2025
53e689b
Merge branch 'main' into Minhas-mod
LV-IQ Jun 17, 2025
a1d9426
Added package
LV-IQ Jun 17, 2025
f8d89d7
Merge branch 'Minhas-mod' of https://github.com/LV-IQ/MyDevMolSimTool…
LV-IQ Jun 17, 2025
5f4fc63
Fix
LV-IQ Jun 17, 2025
2992059
fix
LV-IQ Jun 17, 2025
3706c13
Merge pull request #8 from LV-IQ/Minhas-mod
LV-IQ Jun 18, 2025
79584da
Additional resources for debugging
LV-IQ Jun 18, 2025
f531d4b
Merge pull request #9 from LV-IQ/Minhas-mod
LV-IQ Jun 18, 2025
0326057
Fix
LV-IQ Jun 18, 2025
463f51d
Merge pull request #10 from LV-IQ/Minhas-mod
LV-IQ Jun 18, 2025
958f6ad
Fix
LV-IQ Jun 18, 2025
2baf11e
Merge pull request #11 from LV-IQ/Minhas-mod
LV-IQ Jun 18, 2025
5c728eb
Fix
LV-IQ Jun 18, 2025
0541694
Fix
LV-IQ Jun 18, 2025
d96e760
Merge pull request #12 from LV-IQ/Minhas-mod
LV-IQ Jun 18, 2025
f6e18e0
Added show progress option
LV-IQ Jun 19, 2025
a2c6975
Added Coordination number result
LV-IQ Jun 26, 2025
ea3eab4
Function Fix
LV-IQ Jun 26, 2025
e428428
Fixxed dataframe conversion
LV-IQ Jun 26, 2025
27e42c3
Add function export
LV-IQ Jun 26, 2025
a812eb7
More fix
LV-IQ Jun 26, 2025
53c1d70
Fix
LV-IQ Jun 26, 2025
0469fa7
Small Rework
LV-IQ Jun 30, 2025
87035dc
Small fix
LV-IQ Jul 2, 2025
d8a4005
Small Fix
LV-IQ Jul 2, 2025
e53b7e0
Small Fix
LV-IQ Jul 2, 2025
085a77b
Small FIx
LV-IQ Jul 2, 2025
9941a76
Small Fix
LV-IQ Jul 2, 2025
1702d3f
Small Fix
LV-IQ Jul 2, 2025
45e6c88
Added tolerance option
LV-IQ Jul 7, 2025
f68155d
One group function rework and tests rework
LV-IQ Jul 23, 2025
b989e21
.
LV-IQ Jul 23, 2025
f6a63a9
.
LV-IQ Jul 23, 2025
62c02d0
Test fixing
LV-IQ Jul 23, 2025
989e9f4
Merge branch 'm3g:main' into main
LV-IQ Jul 23, 2025
805198b
Function fix
LV-IQ Jul 23, 2025
30ddd3c
Added Progress meter
LV-IQ Aug 11, 2025
82c130e
Fixing test
LV-IQ Sep 13, 2025
f97e304
Merge branch 'main' into main
LV-IQ Sep 13, 2025
4bc587c
Merge branch 'm3g:main' into main
LV-IQ Sep 13, 2025
7b3547e
Mutable structure addition
LV-IQ Oct 27, 2025
6e9d551
Merge branch 'main' into main
LV-IQ Oct 27, 2025
c99d1ce
fix
LV-IQ Oct 27, 2025
5d43d51
Fix
LV-IQ Oct 27, 2025
9839865
Fix
LV-IQ Oct 27, 2025
4ec1945
Fix
LV-IQ Oct 27, 2025
737f9df
Fix
LV-IQ Oct 27, 2025
e2d3073
Merge branch 'm3g:main' into main
LV-IQ Oct 27, 2025
882eaff
Changed output to non-mutable structure
LV-IQ Nov 16, 2025
ebc5954
Merge branch 'm3g:main' into main
LV-IQ Nov 16, 2025
c226280
Removed mutable structure
LV-IQ Nov 27, 2025
dd97ebc
Merge branch 'main' of https://github.com/LV-IQ/MyDevMolSimToolkit.jl
LV-IQ Nov 27, 2025
d5b3c85
Minor correction
LV-IQ Nov 27, 2025
2644811
Minor correction
LV-IQ Nov 27, 2025
305e36a
Merge branch 'm3g:main' into main
LV-IQ Nov 27, 2025
9b9036d
Minor corrections
LV-IQ Nov 27, 2025
d36a812
Merge branch 'main' of https://github.com/LV-IQ/MyDevMolSimToolkit.jl
LV-IQ Nov 27, 2025
cc2a4c6
Minor fix
LV-IQ Nov 27, 2025
e8f0de4
minor fix
LV-IQ Nov 27, 2025
0bea88b
Erased unused function
LV-IQ Nov 27, 2025
e57ba9b
Fix
LV-IQ Nov 27, 2025
d9656d8
added more tolerance to the test
LV-IQ Nov 28, 2025
443a324
Minor fix
LV-IQ Nov 28, 2025
5aaa9c1
Minor fix
LV-IQ Nov 28, 2025
f7fbf0c
.
LV-IQ Nov 28, 2025
d88b5d5
Fix
LV-IQ Nov 28, 2025
d57376f
.
LV-IQ Nov 28, 2025
aa0758b
.# Please enter the commit message for your changes. Lines starting
LV-IQ Nov 28, 2025
5aaa18d
Massive Rework
LV-IQ Dec 24, 2025
387e1a7
More fix
LV-IQ Dec 24, 2025
03f844d
Minor Test Fix
LV-IQ Dec 24, 2025
060b396
Output Fix
LV-IQ Dec 24, 2025
49dbb29
.
LV-IQ Dec 24, 2025
78081e5
Merge branch 'm3g:main' into main
LV-IQ Jan 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
[![codecov](https://codecov.io/gh/m3g/MolSimToolkit.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/m3g/MolSimToolkit.jl)
[![Aqua QA](https://JuliaTesting.github.io/Aqua.jl/dev/assets/badge.svg)](https://github.com/JuliaTesting/Aqua.jl)

# MyDevMolSimToolkit

[MolSimToolkit.jl](https://github.com/m3g/MolSimToolkit.jl) provides a set of tools to
analyse molecular dynamics simulations, and a framework for the development of custom
analysis tools. This repository is a experimental version of the package for Work in Progress functionalities
# MolSimToolkit.jl

**MolSimToolkit.jl** is a Julia package for analyzing molecular dynamics (MD) simulations. It provides fast, flexible tools for trajectory analysis, structural alignment, secondary structure mapping, and more. The toolkit is designed to be lightweight and extensible, making it easy to build custom analysis workflows.
Expand Down
33 changes: 22 additions & 11 deletions docs/src/Reweighting.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,40 +39,46 @@ julia> i1 = PDBTools.selindex(atoms(simulation), "resname TFE and name O")

julia> i2 = PDBTools.selindex(atoms(simulation), "protein and name O")
```
In the picture below, it is shown the interaction which will be perturbed in this system:

!!!!INSERT FIGURE

## Setting perturbation function
In order to obtain these weights, we have to use two functions: the ```reweight``` function, which will calculate each weight and the ```perturbation``` function, responsible for taking each computed distance between atomic pairs in every frame and determine the resulting energy using these distances in that particular frame based on the applied perturbation.

So, secondly, we define some "perturbation" function (here we call it ```gaussian decay```) and set up its parameters. Please, take a look at the interface:
So, secondly, we define some "perturbation" function (here we call it ```polynomial_decay```) and set up its parameters. Please, take a look at the interface:

```julia-repl
julia> gaussian_decay(r, α, β) = α*exp(-abs(β)*r^2)
julia> poly_decay_perturbation(r, α, cut) = α * ((r/cut)^2 - 1)^2
gaussian_decay (generic function with 1 method)

julia> α = 5.e-3
0.005

julia> β = 5.e-3
0.005
julia> cut = 10.0
10.0
```

As it can be seen, the function has to receive two parameters: `r` which corresponds to the distance between two selected atoms and some parameter to account a modification and change its magnitude, here, we inserted two of them in the same function, `α`, to change the maximum value of the gaussian curve and `β`, to adjust its decay behaviour with a given value of `r`.
As it can be seen, the function has to receive three parameters: `r` which corresponds to the distance between two selected atoms and some parameter to account a modification and change its magnitude, here, we inserted two of them in the same function, `α`, to change the maximum value of the curve (at r = 1) and `cut`, the distance `r` where the function equals zero. In the image below, we can see the curve and how it changes with different values of `α` and `cut`:

!!! INSERT FIGURE

## Computing the new weights
Finally, using the ```reweight``` function, we pass both the ```simulation``` and the last function anonymously in the input. Again, watch the interface:

```julia-repl
julia> cut_off = 12.0
12.0

julia> weights = reweight(simulation, (i,j,r) -> gaussian_decay(r, α, β), i1, i2; cutoff = cut_off)
julia> weights = reweight(simulation, r -> gaussian_decay(r, α, cut), i1, i2; cutoff = cut)
```

`i and j`: if you selected two atom types, `i` will be the index for either the first, the second, the third and so on up to the last atom of the first group and `j` will be same, but now for the second one. With these two parameters, it is possible to determine every combination of two atoms, each one coming from one group, and compute the associated dsitance `r`, so that we are taking into account all interactions between these two atom types to our perturbation. However, if we are dealing with just one group, both of them are indexes for all the atoms of the selected group. Bear in mind that repeated combinations (like `i,j = 1,2 or 2,1`) will no be computed, since the `reweight` function calls the `map_pairwise!` function, from [CellListMap.jl](https://github.com/m3g/CellListMap.jl) that is able to avoid this problem.
`r`: the distance between the twos atoms

`r`: the distance between the twos atoms with indexes `i` and `j` in the selected groups.
`cutoff`: the maximum distance that will be computed between two atoms. The default value is `12.0 Å`.

`cutoff`: the maximum distance that will be computed between two atoms. The default value is `12.0` Angstrom.
!!! warning
It is highly recommended to set the same value of `cutoff` for both `perturbation` and `reweight` functions.
With this in mind, calculations will be done more quickly and you do not need to worry about your input function
behaviour above the `cutoff` value, since distances out of the perturbation range will not be computed.

Once the calculations are finished, the resulted interface is shown, like the example below:
```julia-repl
Expand Down Expand Up @@ -125,6 +131,11 @@ julia> weights.probability
0.12988266765019355
```

!!! tip
Note that these values (and, consequently, calculations that use them) are functions of `r`,
so in other to avoid mathematical complications, a good piece of advice is to create functions that
are continous in the closed interval from zero to the cutoff value.

## Reference Functions
```@autodocs
Modules = [MolSimToolkit.Reweighting]
Expand Down
1 change: 1 addition & 0 deletions src/MolSimToolkit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ using Reexport: @reexport
using ProgressMeter: Progress, next!, @showprogress
using Statistics: mean
using Printf: @sprintf
using OrderedCollections

export wrap, wrap_to_first
export distances
Expand Down
Loading
Loading