From: Peter Freddolino (
Date: Wed Sep 07 2022 - 07:52:54 CDT

Hi Enrico,
If you are preparing for MD simulations, then presumably you have topology
files for use by psfgen or *leap? These should specify the protonation
states that you actually want to simulate anyway right? Since both of those
pieces of software can also add the protons I don't understand the need for
the extra step.

On Wed, Sep 7, 2022 at 3:45 AM Enrico Martinez <>

> Thank you very much Peter!
> Actually I need to protonate a small molecule prior to the MD
> simulation with Amber and NAMD. In some cases molefacture predicts
> protonation much better compared to the openbabel, so I need to
> integrate it to my scripting pipeline to produce protonated input. BTW
> if no-gui mode is not possible, may I open quickly in the terminal vmd
> gui-session which will open on the fly the Molefacture window in vmd
> with my small molecule ?? ;-)
> Cheers
> Enrico
> Il giorno mar 6 set 2022 alle ore 23:42 Peter Freddolino
> <> ha scritto:
> >
> > Hi Enrico,
> > What is the intended downstream application for the modified file?
> Molefacture is pretty tightly wrapped up with the GUI, so this is not going
> to be easy to pull off. You can see the set of steps that it uses in the
> ::Molefacture::add_all_hydrogen function in molefacture_builder.tcl, but I
> am not sure whether the state will update properly without the GUI running.
> (Perhaps someone who has worked on molefacture more recently than me can
> provide an estimate. It definitely would have crashed and burned last I
> tried). This package is really intended for interactive usage. Using
> babel/openbabel (general case) or psfgen (if you're planning to use the
> resulting molecules for MD simulations with NAMD) is almost certainly going
> to be easier.
> > Best,
> > Peter
> >
> > On Tue, Sep 6, 2022 at 6:03 AM Enrico Martinez <>
> wrote:
> >>
> >> Dear VMD users!
> >> I need to protonate a small molecule using the Molefacture plugin. I
> >> have already done it via VMD gui and now would like to test batch mode
> >> that should be activated using:
> >> vmd -dispdev text -e input.file |& output.file
> >>
> >> Could you please suggest to me a possibility of the script which will
> >> call Molefacture from the script for such purpose?
> >> Many thanks in advance
> >> Enrico
> >>