This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ForceField> | |
<AtomTypes> | |
<Type name="lopes_010" class="" element="N" mass="14.00672" def="[N;X3;r5]1[C;X3;r5][N;X3;r5][C;X3;r5][C;X3;r5]1" overrides="" desc="" doi="10.1021/jp0362133"/> | |
<Type name="lopes_011" class="" element="C" mass="12.01078" def="[C;X3;r5]1[N;%lopes_010][C;X3;r5][C;X3;r5][N;%lopes_010]1" overrides="" desc="" doi="10.1021/jp0362133"/> | |
<Type name="lopes_012" class="" element="C" mass="12.01078" def="[C;X3;r5]1[C;X3;r5][N;%lopes_010][C;X3;r5][N;%lopes_010]1" overrides="" desc="" doi="10.1021/jp0362133"/> | |
<Type name="lopes_013" class="" element="H" mass="1.007947" def="H[C;%lopes_011,%lopes_012]" overrides="" desc="" doi="10.1021/jp0362133"/> | |
<Type name="lopes_014" class="" element="C" mass="12.01078" def="[C;X4][N;%lopes_010]" overrides="," desc="" doi="10.1021/jp0362133"/> | |
<Type name="lopes_015" class="" element="H" mass="1.007947" def="H[C;%lopes_014]" overrides="" desc="" doi="10.1021/jp0362133"/> | |
<Type name="lopes_017" class="" element="C" mass="12.01078" de |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def apply_multiple_forcefields(compound, residue_dict): | |
""" | |
Applies multiple forcefields to a mb.Compound | |
Parameters | |
---------- | |
compound: mb.Compound | |
residue_dict: dict | |
Dictionary containing residues (key) and foyer Forcefields (value) pairs | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ForceField> | |
<AtomTypes> | |
<Type name="CH3" class="CT" element="C" mass="12.01100" def="[C;X4](C)(H)(H)H" desc="alkane CH3" doi="10.1021/ja9621760"/> | |
<Type name="CH2" class="CT" element="C" mass="12.01100" def="[C;X4](C)(C)(H)H" desc="alkane CH2" doi="10.1021/ja9621760"/> | |
<Type name="CH" class="CT" element="C" mass="12.01100" def="[C;X4](C)(C)(C)H" desc="alkane CH" doi="10.1021/ja9621760"/> | |
<Type name="CH4" class="CT" element="C" mass="12.01100" def="[C;X4](H)(H)(H)H" desc="alkane CH4" doi="10.1021/ja9621760"/> | |
<Type name="C" class="CT" element="C" mass="12.01100" def="[C;X4](C)(C)(C)C" desc="alkane C" doi="10.1021/ja9621760"/> | |
<Type name="HC" class="HC" element="H" mass="1.00800" def="H[C;X4]" desc="alkane H" doi="10.1021/ja9621760"/> | |
</AtomTypes> | |
<HarmonicBondForce> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mbuild as mb | |
import foyer | |
from foyer import Forcefield | |
butane = mb.load('CCCC', smiles=True) | |
gomc = Forcefield('opls_gomc.xml') | |
typed = gomc.apply(butane, assert_dihedral_params=False) | |
typed.save('butane.top', overwrite=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dimension 3 | |
units real | |
boundary p p p | |
atom_style full | |
pair_style lj/cut/coul/long 7.0 | |
bond_style harmonic | |
angle_style harmonic | |
box tilt large | |
read_data data.water |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
il = mb.Compound() | |
solvent = mb.Compound() | |
for child in system.children: | |
if child.name in ['bmim', 'tf2n']: | |
il.add(mb.clone(child)) | |
elif child.name == 'acn': | |
sollvent.add(mb.clone(child)) | |
opls = Forcefield(name='oplsaa') | |
lopes = Forcefield('kpl.xml') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mbuild as mb | |
import matplotlib.pyplot as plt | |
import time | |
import foyer | |
def build_mbuild(): | |
from mbuild.formats.lammpsdata import write_lammpsdata | |
from foyer import Forcefield | |
water = mb.load("files/tip3p.mol2") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mdtraj as md | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from scattering.scattering import structure_factor | |
# Load trajectory with MDTraj | |
trj = md.load('sample.trr', top='sample.gro') | |
il = trj.topology.select('resid 0') | |
trj_il = trj.atom_slice(il) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import signac | |
import os | |
project = signac.get_project() | |
for job in project.find_jobs(): | |
sq = os.path.join(job.workspace(), 'sq.txt') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
project = signac.get_project() | |
for job in project.find_jobs(): | |
fig, ax = plt.subplots() | |
if os.path.isfile(os.path.join(job.workspace(), 'all-reducs.pkl')): | |
with open(os.path.join(job.workspace(), 'all-reducs.pkl'), 'rb') as f: | |
reduc = pickle.load(f) | |
c = deepcopy(reduc) | |
cluster_sizes = [] | |
for proc in c: | |
for matrix in proc: |
OlderNewer