Introduction¶
Overview¶
pywindow is a Python 3 library for the structural analysis of molecular
pores.
For quick start head to Module Index and see
pywindow.MolecularSystem.
Installation¶
pywindow can be installed with pip:
pip install pywindowx
Developer Setup¶
To develop with pywindow, you can clone the repo and use
just and uv
to setup the dev environment:
just setup
Examples¶
For the specific examples of pywindow usage see
Examples/ directory in the pywindow Github repository.
Loading input¶
Using file as an input:
import pywindow as pw
molsys = pw.MolecularSystem.load_file("data/input/PUDXES.xyz")
Using RDKit molecule object as an input:
import pywindow as pw
from rdkit import Chem
rdkit_mol = Chem.MolFromMol2File("data/input/PUDXES.mol2")
molsys = pw.MolecularSystem.load_rdkit_mol(rdkit_mol)
Using a dictionary (or another
MoleculeSystem.system) as input:
import pywindow as pw
molsys = pw.MolecularSystem.load_file("data/input/PUDXES.xyz")
molsys2 = pw.MolecularSystem.load_system(molsys.system)
Pre-processing¶
If our input requires pre-processing (rebuilding molecules through periodic boundary and/or force field atom ids deciphering) the following methods allow that:
Rebuilding a periodic system
rebuild_molsys = molsys.rebuild_system()
Deciphering force field atom ids
molsys.decipher_atom_keys('OPLS')
If the force field is not supported by pywindow we can use
pywindow.MolecularSystem.decipher_atom_keys() to generate a custom
force field deciphering tool.
some_forcefield = {
'ca': 'C',
'ni': 'N',
'hc': 'H',
'ha': 'H'
}
molsys.swap_atom_keys(some_forcefield)