Small Molecule Pipeline

[2]:
from openpharmmdflow.pipeline.sm.pipeline_settings import *
from openpharmmdflow.pipeline.sm.pipeline import SmallMoleculePipeline
import nglview

First we create the pipeline config settings object

[6]:
# Any file supported by openff-toolkit or cif
inputA = {"name": "ibuprofen", "path": "ibuprofen.sdf"}
inputB = {"name": "ibuprofen1", "path": "ibuprofen.sdf"}

sm_inputA = SmallMoleculePipelineInputConfig(**inputA)
sm_inputB = SmallMoleculePipelineInputConfig(**inputB)

settings = {
    # Not used right now
    "work_dir": "/home/mmh/Projects/OpenPharmMDFlow/experiments/sm/scratch",
    "inputs": [sm_inputA, sm_inputB],
    "prep_config": SmallMoleculePipelinePrepConfig(
        bespokefit_config=BespokefitConfig(
            bespoke_workflow_factory_config=BespokeWorkflowFactoryConfig(),
            bespoke_executor_config=BespokeExecutorConfig(),
            mol_to_bespoke="ibuprofen",
        )
    ),
    "pack_config": SmallMoleculePipelinePackConfig(
        molecule_names=["ibuprofen", "ibuprofen1"],
        number_of_copies=[5, 5],
        target_density=0.1,
    ),
    "parameterize_config": SmallMoleculePipelineParameterizeConfig(),
    "simulate_config": SmallMoleculePipelineSimulateConfig(),
    "analyze_config": SmallMoleculePipelineAnalyzeConfig(),
}
sm_config = SmallMoleculePipelineConfig(**settings)

Now we can create our pipeline object

[7]:
smp = SmallMoleculePipeline(sm_config)
[8]:
smp.load()

Prep will run bespoke fit

[9]:
# smp.prep()
[10]:
smp.pack()

We can view the topology

[11]:
smp.topology.to_file("system.pdb")
nglview.show_structure_file("system.pdb")
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[11], line 1
----> 1 smp.topology.to_file("system.pdb")
      2 nglview.show_structure_file("system.pdb")

AttributeError: 'SmallMoleculePipeline' object has no attribute 'topology'
[14]:
smp.parameterize()
[15]:
smp.interchange.visualize("nglview")
[17]:
smp.simulate()
Starting simulation
Step, volume (nm^3)
0 34.254
500 33.93
1000 32.046
1500 31.12
2000 31.412
2500 32.509
3000 32.153
3500 31.297
4000 27.585
4500 28.9
Elapsed time: 0.60 seconds
[ ]: