Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ The rules for this file:

<!-- New added features -->

- Added built-in widgets documentation (PR #63)
- Added batching and parallel support for com distance widget (PR #64)

### Fixed
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/images/acf_output.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/images/contacts_output.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/images/dssp_output.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/images/janin_output.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/images/msd_output.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/images/rmsd_output.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/images/rog_output.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
92 changes: 92 additions & 0 deletions docs/source/built_in_widgets.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
Built-in Analysis Widgets
=========================

Here is a list of built-in analysis widgets and whether they support batching
and can run in parallel:

.. list-table::
:widths: 20 60 10 10
:header-rows: 1

* - Widget
- Description
- Batching
- Parallel
* - :mod:`~mdadash.backend.analyses.acf`
- Autocorrelation Function (ACF)
- —
- ✅
* - :mod:`~mdadash.backend.analyses.com_distance`
- Distance between two center-of-masses
- ✅
- ✅
* - :mod:`~mdadash.backend.analyses.contacts`
- Contacts within a cutoff
- ✅
- ✅
* - :mod:`~mdadash.backend.analyses.custom_code`
- Custom user-defined code
- —
- —
* - :mod:`~mdadash.backend.analyses.dssp`
- DSSP Analysis
- ✅
- ✅
* - :mod:`~mdadash.backend.analyses.energies`
- Widgets for various simulation energies
- —
- —
* - :mod:`~mdadash.backend.analyses.helix_analysis`
- Helix Analysis
- ✅
- ✅
* - :mod:`~mdadash.backend.analyses.hydrogen_bonds`
- Number of Hydrogen bonds
- ✅
- ✅
* - :mod:`~mdadash.backend.analyses.janin`
- Janin plot (Dihedral angles analysis)
- —
- —
* - :mod:`~mdadash.backend.analyses.msd`
- MSD Analysis
- —
- ✅
* - :mod:`~mdadash.backend.analyses.native_contacts`
- Native Contacts Analysis
- ✅
- ✅
* - :mod:`~mdadash.backend.analyses.ramachandran`
- Ramachandran plot (Dihedral angles analysis)
- —
- —
* - :mod:`~mdadash.backend.analyses.rmsd`
- RMSD Analysis
- ✅
- ✅
* - :mod:`~mdadash.backend.analyses.rog`
- Radii of Gyration
- ✅
- ✅

.. raw:: html

<p style="text-align: center;">✅ Supported, ❌ Not supported, — Not applicable</p>

.. toctree::
:hidden:

ACF <autosummary/mdadash.backend.analyses.acf>
COMDistance <autosummary/mdadash.backend.analyses.com_distance>
Contacts <autosummary/mdadash.backend.analyses.contacts>
Custom Code <autosummary/mdadash.backend.analyses.custom_code>
DSSP <autosummary/mdadash.backend.analyses.dssp>
Energies <autosummary/mdadash.backend.analyses.energies>
Helix Analysis <autosummary/mdadash.backend.analyses.helix_analysis>
Hydrogen bonds <autosummary/mdadash.backend.analyses.hydrogen_bonds>
Janin Plot <autosummary/mdadash.backend.analyses.janin>
MSD Analysis <autosummary/mdadash.backend.analyses.msd>
Native Contacts <autosummary/mdadash.backend.analyses.native_contacts>
Ramachandran Plot <autosummary/mdadash.backend.analyses.ramachandran>
RMSD <autosummary/mdadash.backend.analyses.rmsd>
ROG <autosummary/mdadash.backend.analyses.rog>
6 changes: 1 addition & 5 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@
# -- Project information -----------------------------------------------------

project = "mdadash"
copyright = (
"2026, MDAnalysis. "
"Project structure based on the "
"MDAnalysis Cookiecutter version 0.1"
)
copyright = "2026, MDAnalysis. Project based on the MDAnalysis Cookiecutter version 0.1"
author = "Pardhav Maradani"

# The short X.Y version
Expand Down
3 changes: 1 addition & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ Source code and contributing instructions for this project can be found in the `
:caption: Contents:

getting_started
built_in_widgets
api



Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
2 changes: 1 addition & 1 deletion mdadash/backend/analyses/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Module that has all the analyses widgets
Module for all the built-in analyses widgets
"""

from . import (
Expand Down
95 changes: 93 additions & 2 deletions mdadash/backend/analyses/acf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,93 @@


class ACFAnalysis(WidgetBase):
"""

**Autocorrelation Function**

This widget calculates time-lag autocorrelation for different physical properties.

The following physical properties are supported:

* velocity
* position
* force

A custom :class:`SlidingWindowACF` is used to calculate autocorrelation of chosen
physical property for each new frame against the time-lag buffer / window of past frames.

.. important::
To correctly compute positional ACF using this widget, you must supply
coordinates in the unwrapped convention, also known as no-jump. That is,
when atoms pass the periodic boundary, they must not be wrapped back into
the primary simulation cell. You can enable NoJump for the universe in the
Universe Configuration section in the Settings page of the dashboard.

**Inputs**

Run mode
The mode in which the widget is run - `serial` or `parallel`
Default: ``serial``

Physical property
The physical property to analyze - `velocity`, `position` or `force`
Default: ``velocity``

Selection
The MDAnalysis selection phrase to run this analysis on
Default: ``all``

Dimension type
The desired dimensions to include in the ACF -
`xyz`, `xy`, `yz`, `xz`, `x`, `y` or `z`

Default: ``xyz``

Centered
Use mean subtacted values to calculate ACF
Default: ``False``

.. caution::
A running updated mean based on data processed so far is used.
The number of data samples must be much greater than the lag-time
window for this to be accurate

Show running integral
Show running integral of the ACF
Default: ``False``

.. tip::
Using this option with the `velocity` physical property, i.e., (VACF)
can be used to observe the diffusion coefficient value in the output plot

Show particle ACFs
Show ACFs for individual particles of the selection in the plot
Default: ``False``

.. caution::
Enabling this option for large selections can slow down the
analysis and generation of the plot data

Normalize
Normalize the computed ACF values
Default: ``False``

Custom title
Custom title for the output plot
Default: ''

**Output**

Here is an example output plot of this widget:

.. figure:: /_static/images/acf_output.jpg
:alt: ACF output

.. tip::
This widget can run in parallel

"""

name = "ACF"
description = "Autocorrelation Function"

Expand Down Expand Up @@ -227,9 +314,13 @@ def apply_parallel_results(self, values):


class SlidingWindowACF:
"""Sliding Window ACF
"""

**Sliding Window ACF**

Calculate ACF for a sliding window of frames
This class computes the ACF of a physical property for each new frame
against the time-lag buffer / window of past N frames. The total number
of computations for each frame is O(N).

"""

Expand Down
67 changes: 65 additions & 2 deletions mdadash/backend/analyses/com_distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,72 @@


class COMDistance(WidgetBase):
"""COM Distance
"""

**COM Distance**

This widget shows the distance between two center-of-masses (COMs).

**Inputs**

Run frequency
.. compound::
The frequency with which the widget is run - `every-frame` or `batch`
Default: ``every-frame``

Run mode
The mode in which the widget is run - `serial` or `parallel`
Default: ``serial``

Selection 1
First MDAnalysis selection phrase
Default: ``protein``

Selection 2
Second MDAnalysis selection phrase
Default: ``resid 1``

Periodic
Select with periodic boundary conditions
Default: ``True``

Updating
Update selection during each timestep
Default: ``False``

Custom title
Custom title for the plot
Default: ''

Max values
Max values to show in plot
Default: ``100``

Max distance
Max distance for alert check
Default: ``50.0``

Alert if distance > 'Max distance
Create an alert if the above condition is met
Default: ``False``

Pause simulation if distance > 'Max distance'
Pause the simulation if the above condition is met
Default: ``False``

X-axis
X-axis value - `time` or `step`
Default: ``time``

**Output**

Here is an example output plot of this widget:

.. figure:: /_static/images/com_distance_output.jpg
:alt: COM Distance output

Distance between two center-of-masses (COMs)
.. tip::
This widget supports batching and can run in parallel

"""

Expand Down
54 changes: 51 additions & 3 deletions mdadash/backend/analyses/contacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,64 @@


class Contacts(WidgetBase):
"""
r"""

**Contacts within a cutoff**

This widget uses `MDAnalysis.lib.distances.capped_distance`_ to calculate number
of contacts with a given cutoff between two groups.
This widget uses `MDAnalysis.lib.distances.capped_distance`_ to caclulate
`number of contacts within a cutoff`_ between two contacting groups.

.. _number of contacts within a cutoff: https://userguide.mdanalysis.org/
stable/examples/analysis/distances_and_contacts/contacts_within_cutoff.html

.. _MDAnalysis.lib.distances.capped_distance: https://docs.mdanalysis.org/stable/
documentation_pages/lib/distances.html#MDAnalysis.lib.distances.capped_distance

**Inputs**

Run frequency
.. compound::
The frequency with which the widget is run - `every-frame` or `batch`
Default: ``every-frame``

Run mode
The mode in which the widget is run - `serial` or `parallel`
Default: ``serial``

Contacting Group 1
MDAnalysis selection phrase of first group
Default: ``(resname ASP GLU) and (name OE* OD*)``

Contacting Group 2
MDAnalysis selection phrase of second group
Default: ``(resname ARG LYS) and (name NH* NZ)``

Radius
Radius within which contacts exist
Default: ``4.5``

Custom title
Custom title for the plot
Default: ''

Max values
Max values to show in plot
Default: ``100``

X-axis
X-axis value - `time` or `step`
Default: ``time``

**Output**

Here is an example output plot of this widget:

.. figure:: /_static/images/contacts_output.jpg
:alt: Contacts output

.. tip::
This widget supports batching and can run in parallel

"""

name = "Contacts"
Expand Down
Loading
Loading