This release is a pre-release and may not be stable for production use.
FishMol
A pure-Python package for post-processing molecular dynamics trajectories.
Welcome! ▄▄█▀ FishMol
▄▄███▀ version 0.0.1
○ ▄▄█████▀ ○
○ ▄▄████████▄ /
▄▄▄████████████▄ ○--○
○ ▄▄▄████████████████████▄▄ \
▄▄▄██████▀███████████████████████▄▄ ○--○ ▄
▄▄████████████ ██████████████████████████▄▄ / ▄▄█▀
○ ▄█████████████████ ████████████████████████████▄▄ ○ ▄███▀
▄██████████▀▀▀████████ ██████████████████████████████▄▄ ▄█████▀
▄████████▀ ○ ▀███████ █████████████████████████████████▄▄ ▄▄█████▀
■▄███████▄ ▄███████ █████████████████████████████████████▄▄▄███████▀
▀█████████▄▄▄█████████ ███████████████████████████████████████████████
▀██████████████████ ████████████████████████████████████████████████▄
▀██████████████▀▄███████████████████████████████████▀▀▀▀▀████████████▄
▀▀█████████▀▄███████████████████████████████▀▀ ▀▀████████▀
▀▀█████▄████████████████████████▀▀▀▀██▀ ▀▀████▀
▀▀▀█████████████████▀▀▀▀ ▀■ ▀█▀
▀▀▀███████▀▀
▀████
▀▀▄ Contact: Lei.Lei@durham.ac.uk
Features
- Trajectory I/O — fast memory-mapped reading of extended XYZ files; write filtered trajectories back to disk
- PBC-aware geometry — distances, angles, dihedrals, and vectors under the minimum image convention for triclinic cells
- Molecule recognition — automatic clustering of atoms into molecules via a covalent-radius bonding graph
- Distribution functions — radial (RDF), angular (ADF), dihedral (DDF), and combined 2-D (CDF) distribution functions
- MSD & diffusion — FFT-based mean square displacement; self-diffusion coefficient via the Einstein relation
- Diffusion anisotropy — spherical projection of 1-D MSD to map the directional diffusion surface; Voronoi channel assignment
- Hydrogen bonds — frame-by-frame H-bond recognition with distance + angle criteria; biexponential lifetime from autocorrelation
- Vector Reorientation Dynamics — Legendre polynomial autocorrelation (l = 1, 2, 3) with KWW stretched-exponential fitting
- Dimer analysis — dimer lifetime–displacement distribution function (DLDDF)
- Visualisation — interactive 3-D viewer embedded in Jupyter via the ASE backend
Requirements
- Python ≥ 3.8
- NumPy ≥ 1.21
- SciPy ≥ 1.7
- matplotlib ≥ 3.5
- recordclass ≥ 0.17.2
- iteration_utilities ≥ 0.11.0
- colour ≥ 0.1.5
- ASE ≥ 3.22.1 (optional, for 3-D visualisation)
Installation
From PyPI (recommended)
pip install fishmol
To include the optional 3-D visualisation backend (ASE):
pip install fishmol[vis]
Verify the installation:
fishmol
From source
For the latest development version or to contribute:
git clone https://github.com/Lei-Lei-alpha/fishmol.git
cd fishmol
pip install -e ".[vis]" # omit [vis] if you don't need visualisation
fishmol
Quick Start
from fishmol import trj, funcs
# Define the simulation cell (lattice vectors as rows, in Å)
cell = [
[21.2944, 0.0000, 0.0000],
[-4.6030, 20.7909, 0.0000],
[-0.9719, -1.2106, 15.1054],
]
# Load a trajectory (5 fs timestep, all frames)
traj = trj.Trajectory(timestep=5, data="trajectory.xyz", index=":", cell=cell)
# Calibrate centre-of-mass drift, wrap into box
traj.calib().wrap2box()
# Compute radial distribution function between O and H atoms
o_idx = [i for i, s in enumerate(traj.frames[0].symbs) if s == "O"]
h_idx = [i for i, s in enumerate(traj.frames[0].symbs) if s == "H"]
rdf = funcs.RDF(traj, at_g1=o_idx, at_g2=h_idx, nbins=200, range=(0.0, 8.0))
results = rdf.calculate(plot=True)
Documentation
Full worked examples are in the online documentation:
| Notebook | Description |
|---|---|
| Trajectory I/O | Reading, viewing, calibrating, wrapping, writing, and filtering trajectories; automatic molecule recognition |
| MSD & Diffusion Coefficient | FFT-based MSD, Einstein relation, unit conversion, dual-axis MSD/D plot |
| Diffusion Anisotropy | Spherical MSD projection, 3-D anisotropy surface, Voronoi channel analysis |
| Hydrogen Bond Lifetime | H-bond recognition, geometry heatmap, biexponential lifetime fitting |
| Vector Reorientation Dynamics | Legendre autocorrelation (l = 1–3), KWW fitting, O–H and C–C bond examples |
Metadata
Release files for fishmol 0.1.0a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fishmol-0.1.0a1.tar.gz | 76.6 kB | Without provenance | Details for fishmol-0.1.0a1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fishmol-0.1.0a1-py3-none-any.whl | Python 3 | none | any | Details for fishmol-0.1.0a1-py3-none-any.whl |
Total release size: 142.3 kB
Release files / fishmol-0.1.0a1.tar.gz
| Download URL | fishmol-0.1.0a1.tar.gz |
|---|---|
| Size | 76.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f4b4e98f7416fe386b46bab9ed2a8d8ce2f59d815998be19cd5b0b498027b67f
|
|
BLAKE2b-256 checksum How to use checksums |
423f48beec39fe9231bab433951118ad7dfaa0ef0919c22a7f96ff02a1991775
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / fishmol-0.1.0a1-py3-none-any.whl
| Download URL | fishmol-0.1.0a1-py3-none-any.whl |
|---|---|
| Size | 65.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4e1d82002e7ffa4db6278d777bbfacd35f17efdb14992e003267748f7ecc1c78
|
|
BLAKE2b-256 checksum How to use checksums |
43a920aca3b2284ab183ef7507303aaa812600b3b3c32fefe63b3fa92fe40c6f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Security for fishmol 0.1.0a1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.