Module 1: The Form-Agnostic Philosophy#

Welcome, Apprentice Master. Your journey into the heart of molecular matter starts here.

In this course, you are not just learning a software library; you are learning to talk to atoms. You are building your own virtual laboratory where the walls of file formats and software limitations simply do not exist.

The most important concept in MolSysMT is the Form. In traditional Computational Biology, you are often a prisoner of your file format: if you have a PDB file, you use one library; if you have an OpenMM object, you use another.

MolSysMT breaks these chains. It treats every molecular data structure as a Form. Whether it is a file on disk, an object in memory, or a string of text, MolSysMT sees them all as “Molecular Systems”.

1. The Universal Sampler: msm.get_form()#

Let’s begin by importing MolSysMT and its built-in demonstration systems repository.

import molsysmt as msm
from molsysmt import systems

To demonstrate that MolSysMT doesn’t care about the size or the source, let’s look at four systems from our specialized paths. Notice how we use the same msm.get_form() function for all of them.

# 🔬 Path A: Alzheimer (Amyloid-Beta Fibril from PDB ID)
alzheimer_system = 'pdb_id:2BEG'

# ♻️ Path B: Enzyme Engineering (Triosephosphate Isomerase from internal database)
enzyme_system = systems['TcTIM']['1tcd.h5msm']

# 💊 Path C: Antiviral Hunter (Barnase-Barstar Complex)
antiviral_system = systems['Barnase-Barstar']['barnase_barstar.h5msm']

# ⚡ Path D: Nano-Mechanic (POPC Membrane)
membrane_system = systems['POPC membrane']['popc_membrane.dcd']

systems_list = [alzheimer_system, enzyme_system, antiviral_system, membrane_system]
for sys in systems_list:
    print(f"Form found: {msm.get_form(sys)}")
Form found: string:pdb_id
Form found: file:h5msm
Form found: file:h5msm
Form found: file:dcd

2. The Power of Conversion: msm.convert()#

You are never stuck in a form. You can convert() any system into another. But here is the magic: while the Form changes, the Content remains invariant.

# Let's convert the Enzyme (H5MSM file) into an OpenMM Topology
openmm_topo = msm.convert(enzyme_system, to_form='openmm.Topology')

print(f"New form: {msm.get_form(openmm_topo)}")
New form: openmm.Topology

3. Quick Reports with msm.info()#

How do we know the system is still the same after conversion? We use msm.info() to get a styled biological inventory.

# Report of the converted OpenMM object
msm.info(openmm_topo)
form n_atoms n_groups n_components n_chains n_molecules n_entities n_waters n_proteins n_structures
openmm.Topology 3983 662 167 4 167 3 165 2 None

Notice that the biological content is identical. msm.info() is your go-to tool for a quick human-readable audit.


🏆 Challenge 1: The Form Hunter#

  1. Load the T4 Lysozyme training ground using strictly its PDB ID: 'pdb_id:181L'.

  2. Check its form using msm.get_form().

  3. Use msm.info() to see what’s inside (How many protein molecules? How many waters?).

  4. Convert it into a Sequence string (to_form='string:amino_acids_3').

If you succeed, you are ready for Module 2: Molecular Attributes.