This repo is designed to aid in the proccess of creating forcefield files from scratch using the Espaloma Program written by the Chodera Lab (https://github.com/choderalab/espaloma).
CONDA_SUBDIR=osx-64 conda create -n ff_generation python
conda activate ff_generation
conda env config vars set CONDA_SUBDIR=osx-64
conda deactivate
conda activate ff_generation
conda install 'espaloma=0.3.2' mbuild "python=3.10.14" foyer openbabel py3dmol
pip install notebook
from functions import MonToSmiles
from functions.MonToSmiles import mon_to_smiles
from monclasses.py import P3HT
class P3HT(mb.Compound):
def __init__(self):
super(P3HT,self).__init__()
self.add(mb.load("CCCCCCC1=C(SC(=C1))",smiles=True))
self.bond_indices = [24,25]
self.orientations = [[0,0,1],[0,0,-1]]
self.separation = 0.14
self.replace = True
smiles = mon_to_smiles(fragment=P3HT())[1] #this line must be run before importing the espaloma function.
from functions import EspalomaFxn
from functions.EspalomaFxn import espaloma
espaloma(SMILES=smiles, #from mon_to_smiles function
XML_FILEPATH='INSERT DESIRED XML FILEPATH',
TYPED_FILEPATH='INSERT DESIRED MOL2 FILEPATH')