Metadata-Version: 2.4
Name: MBN_tools
Version: 1.0.0
Summary: Useful tools for use with MBN Explorer simulations, files, and their analysis
Author-email: Matthew Dickers <mattdickers@gmail.com>
License: Copyright 2024, MBN-tools Developers.
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        
Project-URL: Homepage, https://github.com/mattdickers/MBN-tools
Project-URL: Source, https://github.com/mattdickers/MBN-tools
Keywords: MBN Explorer,MBN Studio,Molecular Dynamics,MD,Data Analysis
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: numpy>=1.26
Requires-Dist: scipy>=1.12
Requires-Dist: mdtraj
Requires-Dist: vispy
Dynamic: license-file


# MBN Tools

**MBN Tools** provides a set of utilities for running, processing, and analysing simulations with [MBN Explorer](https://mbnresearch.com/get-mbn-explorer-software).

## Features

- **Run MBN Explorer simulations**  
  Run MBN Explorer simulation tasks directly from Python.

- **File handling utilities**  
  Create, read, modify, and convert simulation input/output files including `.task`, `.xyz`, `.dcd`, and`.pdb`.

- **Trajectory analysis**  
  Analyze simulation outputs, including radial distribution functions (RDF), mean squared displacement (MSD), RMSD, and more.

- **Crystallography utilities**  
  Group atoms by crystallographic planes, translate coordinates to planes, and remove atoms near simulation boundaries.

- **3D visualisation**  
  Render atoms, planes, and simulation boxes in 3D using `VisPy` with customisable colours, sizes, and markers.

## Installation

```bash
pip install MBN-tools
```

## Usage
```python
import MBN_tools as MBN
from MBN_tools import analysis, crystallography, visualise

# Run an MBN Explorer simulation
stdout, stderr = MBN.run_task("example.task", "/path/to/MBN_Explorer")

# Read an XYZ file
xyz_data = MBN.read_xyz("simulation.xyz")

# Compute RMSD
rmsd_values = analysis.calculate_rmsd(xyz_data, box_size=[50, 50, 100])

# Group atoms by a crystalline plane
planes = crystallography.group_atoms_by_plane(xyz_data, hkl=(1,1,0), tolerance=0.5)

# Visualize atoms in 3D
canvas = visualise.create_canvas()
visualise.draw_atoms(xyz_data['coordinates'], parent=canvas.central_widget.add_view())
```

## Dependencies

- `numpy >= 1.26`
- `scipy >= 1.12`
- `mdtraj`
- `vispy`
