Skip to content

Commit

Permalink
Merge pull request #59 from m3g/release-2.11.0
Browse files Browse the repository at this point in the history
set version to 2.11.0
  • Loading branch information
lmiq authored Dec 3, 2024
2 parents 0d0a348 + b89b7ee commit f91cc17
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ComplexMixtures"
uuid = "6f35c628-ac57-5bae-8ea9-703a8964f6e9"
authors = ["Leandro Martinez <[email protected]>"]
version = "2.11.0-DEV"
version = "2.11.0"

[deps]
CellListMap = "69e1c6dd-3888-40e6-b3c8-31ac5f578864"
Expand Down
4 changes: 3 additions & 1 deletion docs/src/density_maps.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ The output of `ResidueContributions` is by default shown as a simple unicode plo
</center>
```

The `ResidueContribution` object can be used to produce a high-quality contour plot using the `Plots.contourf` function:
The `ResidueContribution` object can be used to produce a high-quality contour plot using the `Plots.contourf` (or `contour`, or `heatmap`) function:

```@docs
Plots.contourf(::ResidueContributions)
Expand Down Expand Up @@ -192,6 +192,7 @@ save(::String, ::ResidueContributions)

The above produces a matrix with a number of columns equal to the number of residues and a number of rows equal to the number of MDDF points. That matrix can be plotted as a contour map with adequate plotting software.


## [3D density map around a macromolecule](@id grid3D)

Three-dimensional representations of the distribution functions can also be obtained from the MDDF results. These 3D representations are obtained from the fact that the MDDFs can be decomposed into the contributions of each solute atom, and that each point in space is closest to a single solute atom as well. Thus, each point in space can be associated to one solute atom, and the contribution of that atom to the MDDF at the corresponding distance can be obtained.
Expand Down Expand Up @@ -225,3 +226,4 @@ In the figure on the left, the points in space around the protein are selected w
Clicking on those points we obtain which are the atoms of the protein contributing to the MDDF at that region. In particular, the arrow on the right points to the strongest red region, which corresponds to an Aspartic acid. These residues are shown explicitly under the density (represented as a transparent surface) on the figure in the center.

The figure on the right displays, overlapped with the hydrogen-bonding residues, the most important contributions to the second peak of the distribution, corresponding to distances from the protein between 2.0 and 3.5Å. Notably, the regions involved are different from the ones forming hydrogen bonds, indicating that non-specific interactions with the protein (and not a second solvation shell) are responsible for the second peak.

24 changes: 12 additions & 12 deletions ext/Plotting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ using PDBTools: Residue, residue_ticks, Atom, eachresidue, resnum
"""
contourf(
rc::ResidueContributions;
step::Int=1,
oneletter=false,
xlabel="Residue",
ylabel="r / Å",
step::Int=1,
oneletter=false,
xlabel="Residue",
ylabel="r / Å",
kargs...
)
contour(rc::ResidueContributions, args...; kargs...)
heatmap(rc::ResidueContributions, args...; kargs...)
contour(rc::ResidueContributions; kargs...)
heatmap(rc::ResidueContributions; kargs...)
Plot the contribution of each residue to the solute-solvent pair distribution function as a 2D density map.
This function requires loading the `Plots` package. The calling syntax for `contour` and `heatmap` is the same as for `contourf`.
Expand All @@ -29,7 +30,7 @@ This function requires loading the `Plots` package. The calling syntax for `cont
# Optional arguments
- `step`: The step of the residue ticks in the x-axis of the plot. Default is 1 or will be set to show at most 20 ticks labels.
- `step`: The step of the residue ticks in the x-axis of the plot. Default is 1 or will be set to show at most 50 ticks labels.
- `oneletter::Bool`: Use one-letter residue codes. Default is `false`. One-letter codes are only available for the 20 standard amino acids.
- `xlabel` and `ylabel`: Labels for the x and y axes. Default is `"Residue"` and `"r / Å"`.
Expand Down Expand Up @@ -64,14 +65,13 @@ julia> plt = contourf(rc; step=5, size=(800,400), title="Title", clims=(-0.1, 0.
This function requires loading the `Plots` package.
Support for all `Plots.contourf` parameters was introduced in ComplexMixtures v2.6.0, and support for
`contour` and `heatmap` were introduced in ComplexMixtures v2.11.0.
`contour` and `heatmap` was introduced in ComplexMixtures v2.11.0.
"""
Plots.contourf, Plots.contour, Plots.heatmap
Plots.contourf(rc::ResidueContributions; kargs...) = _density2D(Plots.contourf, rc; kargs...)

Plots.contourf(rc::ResidueContributions, args...; kargs...) = _density2D(Plots.contourf, rc, args...; kargs...)
Plots.contour(rc::ResidueContributions, args...; kargs...) = _density2D(Plots.contour, rc, args...; kargs...)
Plots.heatmap(rc::ResidueContributions, args...; kargs...) = _density2D(Plots.heatmap, rc, args...; kargs...)
Plots.contour(rc::ResidueContributions; kargs...) = _density2D(Plots.contour, rc; kargs...)
Plots.heatmap(rc::ResidueContributions; kargs...) = _density2D(Plots.heatmap, rc; kargs...)

function _density2D(
plot_type::Function,
Expand Down

0 comments on commit f91cc17

Please sign in to comment.