MartiniSurf Quick Guide for New Users¶
This guide is for users with no prior Martini or coarse-grained simulation experience.
Goal:
Know which command to run.
Understand what each flag does.
Avoid common setup errors.
1) 30-second rules¶
Choose only ONE orientation mode:
--anchor ...(Not explicit Linker / anchor mode), or--linker ... --linker-group ...(linker mode).
--ads-modeis a specialized anchor workflow (not linker): uses anchor-based orientation but skips anchor pull/restraint topology and usesminimization -> nvt -> npt -> production(nodepositionstage).In
--pdbworkflows,--anchorand--linker-groupcan use either global residue ids orCHAIN RESID ...syntax from the input PDB.In
--complex-config, chain-basedprotein.anchor_groupsalso work if you provideprotein.reference_pdb.For two-anchor systems, use
--balance-low-z(and optional--balance-low-z-fraction) to flatten the lowest-Z protein face against the surface.In
--complex-config, low-Z balancing is enabled by default (protein.balance_low_z=true), with defaultprotein.balance_low_z_fraction=0.2.If you do NOT pass
--surface, you must pass--lxand--ly.--ionizealways requires--solvate.--freeze-water-fractionworks only with--dnaand--solvate.If you already have a CG system (protein + cofactor), use
--complex-config.
2) Minimum installation¶
pip install -r requirements.txt
pip install -e .
External tools:
Protein mode:
martinize2DNA mode: Python 2.7
Solvation/ionization:
gmx(GROMACS)
Quick checks:
which martinisurf
which martinize2
which gmx
python2.7 -V
3) Pick your workflow¶
Atomistic protein PDB to surface: use protein mode + Not explicit Linker (
--anchor).Protein with linker to surface: use protein mode +
--linker+--linker-group.Atomistic DNA PDB to surface: use
--dna+ Not explicit Linker (--anchor) or explicit linker (--linker).Already CG protein+cofactor complex: use
--complex-config.
Recommended examples: protein/04, dna/03, and protein/05 are the most complete solvated/ionized workflows:
martinisurf/examples/protein/04_anchor_solvate_ionizemartinisurf/examples/dna/03_linker_solvate_ionize_freezemartinisurf/examples/protein/05_pre_cg_nad_substrate
Typical run pattern for the full workflow examples (protein/04, dna/03, protein/05):
cd martinisurf/examples/protein/04_anchor_solvate_ionize
bash run.sh
bash work_flow_gromacs.sh
DNA workflow note:
dna/03runsminimization -> nvt -> deposition (NPT) -> production (NVT).The pressure-coupled equilibration is done in
deposition; there is no separate DNAnpt.mdpstage in this example.
4) Copy-and-run commands¶
If you want the most complete and production-oriented setups, use examples protein/04, dna/03, and protein/05 above.
A) Example protein/04: Protein + Not explicit Linker (--anchor) + solvate + ionize¶
martinisurf \
--pdb inputs/1RJW.pdb \
--dssp \
--go \
--moltype Protein \
--surface-mode 4-1 \
--surface-bead P4 \
--dx 0.47 \
--lx 15 --ly 15 \
--anchor A 8 10 11 \
--anchor D 8 10 11 \
--dist 1.0 \
--solvate \
--ionize \
--salt-conc 0.15 \
--merge A,B,C,D
B) Example dna/03: DNA + linker + solvate + ionize + frozen water¶
martinisurf \
--dna \
--dnatype ds-stiff \
--pdb inputs/4C64.pdb \
--surface-mode 4-1 \
--lx 10 \
--ly 10 \
--dx 0.27 \
--surface-bead C1 \
--linker inputs/ALK.gro \
--linker-group A 1 \
--solvate \
--ionize \
--salt-conc 0.15 \
--freeze-water-fraction 0.10 \
--freeze-water-seed 42 \
--merge A,B
C) Example protein/05: pre-CG protein+cofactor + substrate + solvate + ionize¶
martinisurf \
--complex-config input/complex_config.yaml \
--surface-mode 4-1 \
--surface-bead P4 \
--dx 0.47 \
--lx 15 \
--ly 15 \
--dist 1.0 \
--substrate input/ETO.gro \
--substrate-count 10 \
--solvate \
--ionize \
--salt-conc 0.15 \
--outdir Simulation_Files
5) Flags you will use most often¶
Flag |
What it does |
Typical value |
|---|---|---|
|
Input structure (local file, RCSB ID, or UniProt ID) |
|
|
Molecule name for protein topology |
|
|
Enables DNA workflow |
no value |
|
Reuses an existing surface file |
|
|
Builds |
|
|
Size and spacing for generated surface |
|
|
Not explicit Linker orientation (anchor mode) |
|
|
Anchor-like adsorption mode without anchor pull/restraint topology |
no value |
|
Linker GRO file |
|
|
Residue groups for linker attachment |
|
|
Chain merge during martinization |
|
|
Adds water with GROMACS |
no value |
|
Adds ions (requires solvation) |
no value |
|
Output folder |
|
6) Full flag reference (martinisurf main pipeline)¶
This section includes ALL flags from the main pipeline.
Input and molecule¶
--pdb(default: none): local.pdb, 4-character RCSB ID, or 6-character UniProt ID.Required if you do NOT use
--complex-config.
--complex-config(default: none): YAML for pre-CG workflow (protein + cofactor), skipping martinization.--moltype(default: none): molecule name for protein topology.--go(default: false): enables Go model inmartinize2(protein mode).--ff(default:martini3001): force field argument formartinize2.--dna(default: false): enables DNA mode (martinize-dna.py).--dnatype(default:ds-stiff): DNA type formartinize-dna.py.--merge(default: none, repeatable): chain merge (example:A,B,C,Dorall).
Martinization controls¶
--p {none,all,backbone}(default:backbone): position restraint selection.--pf(default:1000): position restraint force constant.--maxwarn(default:0): max allowed warnings inmartinize2before abort.--dssp(default: enabled): enables DSSP / secondary structure assignment in protein mode.--no-dssp: disables DSSP.--elastic(default: false): enables elastic network.--ef(default:700): elastic network force constant.--go-eps(default: none): Go epsilon.--go-low(default: none): Go minimum contact distance (nm).--go-up(default: none): Go maximum contact distance (nm).
Surface¶
--surface(default: none): existing surface.grofile.--surface-mode {2-1,4-1,graphene,graphene-periodic,graphene-finite,graphite}(default:2-1): mode for generated surfaces.--surface-geometry {planar,3d}(default:planar): orientation handling for the surface. Use3dfor nanotubes and other non-planar surfaces.--lx(default: none): generated surface X size (nm).--ly(default: none): generated surface Y size (nm).--dx(default:0.47): bead spacing (2-1) or C-C parameter (4-1).--surface-layers(default: none): number of layers for4-1mode.--surface-dist-z(default: none): interlayer spacing in nm for4-1mode.--graphite-layers(default: none): number of stacked graphene layers forgraphite.--graphite-spacing(default: none): interlayer spacing in nm forgraphite.--surface-bead(default:C1): bead type for generated surface.--charge(default:0): bead charge for generated surface topology.
Notes:
grapheneandgraphene-periodicuse the vendored Martini 3 periodic graphene generator.graphene-finitebuilds a finite graphene sheet.graphitebuilds a stacked graphitic slab and carries over the generatedposre_GRA.itp.grapheneandgraphiteare intended for Martini 3 / protein workflows.planarkeeps the current surface orientation workflow unchanged.3dfirst lays the surface onto theXYplane using its principal axes and then places the biomolecule above the top external side.
Unit note:
In the main
martinisurfCLI,--lx,--ly, and--dxare provided in nm.
Classic orientation (anchors)¶
--anchor GROUP_OR_CHAIN RESID [RESID ...](default: none, repeatable): defines anchor groups.Legacy syntax:
--anchor 1 8 10 11Chain-based syntax for
--pdbworkflows:--anchor D 8 10 11Chain-based groups are converted internally to global residue ids in appearance order (
Anchor_1,Anchor_2, …).
--dist(default:1.0nm): target anchor-to-surface distance.--ads-mode(default:false): adsorption mode using anchor orientation without anchor pull/restraint topology.MDP stages in this mode:
minimization,nvt,npt,production(nodeposition).Incompatible with linker mode.
--balance-low-z(default:false): in two-anchor mode, picks the roll angle that flattens the lowest-Z region.--balance-low-z-fraction(default:0.2): fraction (0,1] of lowest-Z beads used by--balance-low-z.
Linker orientation¶
--linker(default: none): linker.grofile.--linker-group GROUP_OR_CHAIN RESID [RESID ...](default: none, repeatable): residue groups where linkers attach.Legacy syntax:
--linker-group 1 8 10 11Chain-based syntax for
--pdbworkflows:--linker-group B 8 10 11
--linker-prot-dist(default: auto): linker-to-biomolecule distance (nm).Auto rule:
sigmain DNA linker mode,sigma * 1.2in protein linker mode.
--linker-surf-dist(default: auto): linker-to-surface distance (nm).Auto rule: estimated from Martini bead-size sigma (
sigma * 1.2) using linker-tail and surface bead classes.
--invert-linker(default: false): reverses linker bead order.--surface-linkers(default:0): number of additional random surface linkers.DNA linker coupling behavior:
Uses bonded linker-DNA coupling in topology (no linker-DNA pull).
Bond target bead in DNA residue:
BB1, elseBB2, elseBB3.Adds linker-linker-DNA angle (
180, force20).Keeps linker-surface pull behavior unchanged.
Generated linker ITP includes linker-tail
position_restraintsunder#ifdef POSRESfor surface coupling control.
Notes:
Chain-based syntax is resolved from the cleaned input PDB before martinization.
In
--complex-config,protein.anchor_groupscan also use chain-based syntax ifprotein.reference_pdbpoints to the source PDB that matches the pre-CG complex residue order.In
--complex-config,protein.balance_low_zdefaults totrue; optionally override with:protein.balance_low_z: falseprotein.balance_low_z_fraction: 0.30
Optional substrate¶
--substrate(default: none): substrate.grofile for random insertion.--substrate-itp(default: inferred): substrate.itpfile.--substrate-count(default:0): number of substrate molecules.
Optional solvation and ionization¶
--solvate(default: false): runsgmx solvate.--ionize(default: false): runsgmx genionafter solvation.--salt-conc(default:0.15M): target salt concentration.--water-gro(default: none): custom solvent.grofor solvation.--solvate-radius(default:0.21nm): exclusion radius.--solvate-surface-clearance(default:0.4nm): removes water near surface plane.--freeze-water-fraction(default:0.0): fraction ofWconverted toWF.Requires
--dnaand--solvate.
--freeze-water-seed(default:42): seed parameter for freeze-water step.
Output¶
--outdir(default:Simulation_Files): output directory.
7) Advanced flags (internal modules)¶
These commands are usually called by MartiniSurf internally. Most new users do not need them directly.
7.1 python -m martinisurf.surface_builder¶
--mode {2-1,4-1,graphene,graphene-periodic,graphene-finite,graphite,cnt-m2,cnt-m3}--bead--dx--lx--ly--lz--resname--output--charge--layers(4-1)--dist-z(4-1)--graphite-layers--graphite-spacing--cnt-numrings--cnt-ringsize--cnt-bondlength--cnt-bondforce--cnt-angleforce--cnt-beadtype--cnt-functype--cnt-func-begin--cnt-func-end--cnt-base36
Notes:
cnt-m2wraps the vendoredcnt-martinidefault Martini 2 preset.cnt-m3uses the same CNT generator with Martini 3-style defaults:0.41 nmbond length,9beads per ring, andSC5carbon beads.
7.2 python -m martinisurf.system_tethered¶
--surface--system--out--anchor--anchor-landmark-mode--dist--reference-exclude-resname--linker-gro--linker-group--linker-prot-dist--linker-surf-dist--invert-linker--surface-linkers--surface-min-dist--dna-mode--min-reference-z-dist--balance-low-z--balance-low-z-fraction
7.3 python -m martinisurf.gromacs_inputs¶
--moltype--outdir--anchor--linker-resid--use-linker--linker-resname--linker-size--linker-itp-name--linker-pull-init-prot(optional): explicit initial distance (nm) for linker-head to biomolecule pull coordinates.--linker-pull-init-surf(optional): explicit initial distance (nm) for linker-tail to surface pull coordinates.--go-model--ads-mode--cofactor-itp-name--cofactor-count--substrate-itp-name--substrate-moltype--substrate-count
MDP pull note:
In generated pull coordinates, MartiniSurf writes either
pull-coordX_start = yesorpull-coordX-init = ..., never both for the same coordinate.--linker-pull-init-protand--linker-pull-init-surfingromacs_inputsare in nm (internal module API).In DNA linker mode, linker-DNA is handled with bonded terms in topology instead of pull coordinates.
7.4 Legacy wrapper flags in python -m martinisurf (orient subcommand)¶
These exist for compatibility:
--surface--enzyme--out--dist--display--anchor
Note: modern orientation module is system_tethered (uses --system, not --enzyme).
8) Output structure to check¶
Default output:
Simulation_Files/
0_topology/
system.top
system_res.top
index.ndx
system_itp/
1_mdp/
2_system/
immobilized_system.gro
system.gro
(optional) final_system.gro
If you use --solvate and --ionize, check especially:
0_topology/system_final.top0_topology/system_final_res.top2_system/final_system.gro2_system/system_final.gro
Workflow note for example work_flow_gromacs.sh scripts:
minimization,nvt,npt, anddepositionusesystem_final.top(or base non-restrained topology).productionusessystem_final_res.topwhen present (anchor/linker focused restraints).
9) Common errors and direct fixes¶
Error:
--pdb is required unless --complex-config is providedFix: add
--pdb ...or use--complex-config ....
Error:
When --surface is not provided, both --lx and --ly are requiredFix: add
--lxand--ly, or pass--surface.
Error:
Linker mode requires at least one --linker-groupFix: add at least one
--linker-group.
Error:
--ionize requires --solvateFix: enable
--solvate.
Error:
DNA mode requires python2.7Fix: install Python 2.7 or set
MARTINISURF_PYTHON2.
Error: missing linker
.itpFix: place
linker.itpnext tolinker.gro(same basename).
Random substrate placement fails
Fix: reduce
--substrate-countor use a larger box (--lx,--ly,--dist).
10) Practical checklist before long runs¶
Visualize
2_system/immobilized_system.grobefore production simulation.Confirm
index.ndxincludes expectedAnchor_*groups.Review
[ molecules ]insystem.toporsystem_final.top.If using linker/substrate/cofactor, verify their
.itpfiles are in0_topology/system_itp/.Run a short test first (for example without
--ionize) to validate geometry.
11) Short software evaluation¶
What is strong:
End-to-end automation (structure to GROMACS-ready system).
Supports protein, DNA, linker, and pre-CG complex workflows.
Early validation for incompatible flag combinations.
What to keep in mind:
Depends on external tools (
martinize2, Python2,gmx).DNA path still depends on
martinize-dna.py(Python2 ecosystem).--freeze-water-seedis active in the current implementation and controls the stochastic water-to-WFselection when--freeze-water-fractionis used.
12) Colab behavior notes¶
In
MartiniSurf_Protein.ipynbandMartiniSurf_DNA.ipynb, Step6Brunsgromppwith-maxwarn 3.In
MartiniSurf_DNA.ipynb, Step6Buses the DNA short-MD protocolnvt -> deposition (NPT) -> production (NVT).Step
6C - View MD Resultrenders the stages that are actually available for the selected notebook workflow.