<jupyter_start><jupyter_text>Protein Folding | EPOCH Lab 2022<jupyter_code>from openmm.app import *
from openmm import *
from openmm.unit import *
from sys import stdout

import pytraj as pt
import nglview as nv
try:
    platform = Platform.getPlatformByName("CUDA")
except Exception:
    platform = Platform.getPlatformByName("OpenCL")
pdb = PDBFile('pdb/.pdb')
forcefield = ForceField('amber99sb.xml', 'tip3p.xml')
unmatched_residues = forcefield.getUnmatchedResidues(pdb.topology)
# unmatched_residues
modeller = Modeller(pdb.topology, pdb.positions)
modeller.addHydrogens(forcefield)
modeller.addSolvent(forcefield)
modeller.topology
system = forcefield.createSystem(modeller.topology,
                                 nonbondedMethod=PME,
                                 nonbondedCutoff=1*nanometer,
                                 constraints=HBonds)
integrator = LangevinIntegrator(300*kelvin, 1/picosecond, 0.002*picoseconds)
simulation = Simulation(modeller.topology, system, integrator, platform)
simulation.context.setPositions(modeller.positions)
simulation.minimizeEnergy()
simulation.reporters.append(PDBReporter('/tmp/output.pdb', 10))
simulation.reporters.append(StateDataReporter(stdout, 10, step=True, potentialEnergy=True, temperature=True))
simulation.step(1000)
traj = pt.load('/tmp/output.pdb')

view = nv.show_pytraj(traj)
view.add_representation('licorice')
view<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10437235543018336, 'fraction_numerical': 0.01692524682651622, 'mean_word_length': 4.937238493723849, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '356952', 'license': 'MIT', 'n_tokens_mistral': 491, 'n_tokens_neox': 456, 'n_words': 76, 'path': 'fold.ipynb', 'repo_name': 'epochlab/codon', 'size': '1418'}