Welcome to pywindow
’s documentation!¶
GitHub:
https://github.com/JelfsMaterialsGroup/pywindow - stable release
https://github.com/marcinmiklitz/pywindow - most up-to-date release
Overview¶
pywindow
is a Python 3 library for the structural analysis of molecular pores.
For quick start head to Module Index and see pywindow.molecular.MolecularSystem
.
Installation¶
Git clone the pywindow repository or download a zipped version.
cd pywindow/ python setup.py install
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)