From: Pawel Kedzierski (pawel.kedzierski_at_pwr.edu.pl)
Date: Fri Nov 10 2023 - 02:43:50 CST

Dear Diego,
I have found another bug, triggered depending on the workflow.
* workflow 1 (working correctly):
    1. Load a mol2 file into VMD
    2. Open Molefacture, create the molecule using File->New
molecule->From selection using the selection "all"
    3. Write out PSF and PDB files from Molefacture using File->Write
psf and pdb files, answering "No" to the question whether to download
the topology from the CGenFF server.
Using this approach, the topology file is created by Molefacture and
used to generate the angles and dihedrals with psfgen.

* workflow 2 (crashing)
    1. Load a pair of PSF and PDB files into VMD. It is not relevant
whether you use the File->New molecule dialog, the commands "mol new
file.psf" followed by "mol addfile file.pdb" or start vmd like "vmd -f
file.psf file.pdb". It also does not depend on whether there are angles
& dihedrals in the PSF file file.ps or not.
    2. as above
    3. as above, however this time there is no question about
downloading topology file from CGenFF server, but a crash instead.

The reason of the crash is that with workflow 2, psfgen invoked to
generate bonds and dihedrals is not given the topology file file.top
even, if this file is already there. Apparently, this topology file is
also not created by Molefacture in workflow 2, as it is in workflow 1.

Below I am pasting the files to reproduce the problem and the messages
printed in the VMD console.
Thank you, and best regards,
Pawel

----<h2o2.pdb file contents>----
REMARK original generated coordinate pdb file
ATOM      1  O1  H2O2X   1      -0.843   0.900   0.239  1.00 0.00     
X    O
ATOM      2  O2  H2O2X   1       0.376   0.269  -0.239  1.00 0.00     
X    O
ATOM      3  H3  H2O2X   1      -1.056   1.373  -0.588  1.00 0.00     
X    H
ATOM      4  H4  H2O2X   1       0.978   1.004  -0.014  1.00 0.00     
X    H
END
----<cut above this line>-----

----<h2o2.psf file contents>----
PSF

       10 !NTITLE
  REMARKS original generated structure x-plor psf file
  REMARKS topology h2o2.top
  REMARKS topology top_all36_prot.rtf
  REMARKS topology top_all36_lipid.rtf
  REMARKS topology top_all36_na.rtf
  REMARKS topology top_all36_carb.rtf
  REMARKS topology top_all36_cgenff.rtf
  REMARKS topology toppar_all36_carb_glycopeptide.str
  REMARKS topology toppar_water_ions_namd.str
  REMARKS segment X { first NONE; last NONE; auto angles dihedrals }

        4 !NATOM
        1 X    1    H2O2 O1   OH1   -0.252800 15.9990           0
        2 X    1    H2O2 O2   OH1   -0.252800 15.9990           0
        3 X    1    H2O2 H3   H      0.252800 1.0080           0
        4 X    1    H2O2 H4   H      0.252800 1.0080           0

        3 !NBOND: bonds
        1       2       1       3       2       4

        0 !NTHETA: angles

        0 !NPHI: dihedrals

        0 !NIMPHI: impropers

        0 !NDON: donors

        0 !NACC: acceptors

        0 !NNB

        0       0       0       0

        1       0 !NGRP
        0       0       0

----<cut above this line>-----

----<VMD command and output>----
$ vmd -f h2o2.psf h2o2.pdb
Info) VMD for LINUXAMD64, version 1.9.4a57 (April 27, 2022)
Info) http://www.ks.uiuc.edu/Research/vmd/
Info) Email questions and bug reports to vmd_at_ks.uiuc.edu
Info) Please include this reference in published work using VMD:
Info)    Humphrey, W., Dalke, A. and Schulten, K., `VMD - Visual
Info)    Molecular Dynamics', J. Molec. Graphics 1996, 14.1, 33-38.
Info) -------------------------------------------------------------
Info) Multithreading available, 4 CPUs.
Info)   CPU features: SSE2 SSE4.1 AVX AVX2 FMA F16 HT
Info) Free system memory: 6238MB (79%)
Info) No CUDA accelerator devices available.
XRequest.143: GLXUnsupportedPrivateRequest 0x1000a
Info) OpenGL renderer: llvmpipe (LLVM 15.0.6, 256 bits)
Info)   Features: MDE CVA MTX NPOT PP PS GLSL(OVFS)
Info)   Full GLSL rendering mode is available.
Info)   Textures: 2-D (16384x16384), 3-D (512x512x512), Multitexture (8)
Info) Internal command editing disabled, external rlwrap in use.
Info) Dynamically loaded 3 plugins in directory:
Info) /usr/local/vmd1.9.4a57/plugins/LINUXAMD64/molfile
Info) File loading in progress, please wait.
Info) Using plugin psf for structure file h2o2.psf
psfplugin) WARNING: no angles defined in PSF file.
psfplugin) WARNING: no dihedrals defined in PSF file.
psfplugin) WARNING: no impropers defined in PSF file.
psfplugin) no cross-terms defined in PSF file.
Info) Analyzing structure ...
Info)    Atoms: 4
Info)    Bonds: 3
Info)    Angles: 0  Dihedrals: 0  Impropers: 0  Cross-terms: 0
Info)    Bondtypes: 0  Angletypes: 0  Dihedraltypes: 0 Impropertypes: 0
Info)    Residues: 1
Info)    Waters: 0
Info)    Segments: 1
Info)    Fragments: 1   Protein: 0   Nucleic: 0
Info) Using plugin pdb for coordinates from file h2o2.pdb
Info) Finished with coordinate file h2o2.pdb.
vmd > Info) Analyzing structure ...
Info)    Atoms: 300
Info)    Bonds: 0
Info)    Angles: 0  Dihedrals: 0  Impropers: 0  Cross-terms: 0
Info)    Bondtypes: 0  Angletypes: 0  Dihedraltypes: 0 Impropertypes: 0
Info)    Residues: 300
Info)    Waters: 0
Info)    Segments: 2
Info)    Fragments: 300   Protein: 0   Nucleic: 0
Info) Building new molecule with 304 atoms from 2 selections.
Info) All atoms will be assigned atomic coordinates.
Info) Analyzing structure ...
Info)    Atoms: 304
Info)    Bonds: 3
Info)    Angles: 0  Dihedrals: 0  Impropers: 0  Cross-terms: 0
Info)    Bondtypes: 0  Angletypes: 0  Dihedraltypes: 0 Impropertypes: 0
Info)    Residues: 301
Info)    Waters: 0
Info)    Segments: 2
Info)    Fragments: 301   Protein: 0   Nucleic: 0
Info) ======================
Info) Please cite TopoTools as:
Info) Axel Kohlmeyer & Josh Vermaas, (2019). TopoTools: Release 1.8
Info) https://urldefense.com/v3/__https://doi.org/10.5281/zenodo.598373__;!!DZ3fjg!4Xxo05Y92VyvqdtoLQou5zUov3ISK4Dv5v0aGHevPlkGxXMf3XQn3HWQF5zvsdtuyiGx9IuPK7olu_2dsgyepozGRLIX-vFw$
Info) ======================

Info) Analyzing structure ...
Info)    Atoms: 304
Info)    Bonds: 3
Info)    Angles: 0  Dihedrals: 0  Impropers: 0  Cross-terms: 0
Info)    Bondtypes: 0  Angletypes: 0  Dihedraltypes: 0 Impropertypes: 0
Info)    Residues: 301
Info)    Waters: 0
Info)    Segments: 2
Info)    Fragments: 301   Protein: 0   Nucleic: 0
Using IDATM for atom typing and bond assignment
The atom typing here is based on:
   Elaine Meng and Richard Lewis, JCC 12:891-898 (1991)
Please read and cite this reference if you make use of these results

   Bond order guessing added by the VMD team
Info) Opened coordinate file X.pdb for writing.
Info) Finished with coordinate file X.pdb.
psfgen) clearing structure, topology, and aliases
psfgen) clearing structure, preserving topology and aliases
DEBUG topolist top_all36_prot.rtf top_all36_lipid.rtf top_all36_na.rtf
top_all36_carb.rtf top_all36_cgenff.rtf
toppar_all36_carb_glycopeptide.str toppar_water_ions_namd.str
psfgen) reading topology file top_all36_prot.rtf

psfgen) >>>>>>>>CHARMM36 All-Hydrogen Topology File for Proteins <<<<<<
psfgen) >>>>> Includes phi, psi cross term map (CMAP) correction <<<<<<<
psfgen) >>>>>>>>>>>>>>>>>>>>>>>>>> May 2011 <<<<<<<<<<<<<<<<<<<<<<<<<<<<
psfgen)  All comments to the CHARMM web site: https://urldefense.com/v3/__http://www.charmm.org__;!!DZ3fjg!4Xxo05Y92VyvqdtoLQou5zUov3ISK4Dv5v0aGHevPlkGxXMf3XQn3HWQF5zvsdtuyiGx9IuPK7olu_2dsgyepozGRMsl5zRb$
psfgen)              parameter set discussion forum
psfgen)
psfgen) Created by CHARMM version 36 1
psfgen) cross-term entries present in topology definitions
psfgen) reading topology file top_all36_lipid.rtf

psfgen)   \\\\\\\ CHARMM36 All-Hydrogen Lipid Topology File ///////
psfgen)   All comments and questions should be submitted to the
psfgen)   parameter forum at the CHARMM website: https://urldefense.com/v3/__http://www.charmm.org__;!!DZ3fjg!4Xxo05Y92VyvqdtoLQou5zUov3ISK4Dv5v0aGHevPlkGxXMf3XQn3HWQF5zvsdtuyiGx9IuPK7olu_2dsgyepozGRMsl5zRb$
psfgen)
psfgen) Created by CHARMM version 36 1
psfgen) reading topology file top_all36_na.rtf

psfgen)   \\\\ CHARMM36 All-Hydrogen Nucleic Acid Topology File ////
psfgen)    Alexander D. MacKerell Jr. and coworkers
psfgen)                       April 2011
psfgen)  All comments to the CHARMM web site: https://urldefense.com/v3/__http://www.charmm.org__;!!DZ3fjg!4Xxo05Y92VyvqdtoLQou5zUov3ISK4Dv5v0aGHevPlkGxXMf3XQn3HWQF5zvsdtuyiGx9IuPK7olu_2dsgyepozGRMsl5zRb$
psfgen)            parameter set discussion forum
psfgen)
psfgen) Created by CHARMM version 36 1
psfgen) reading topology file top_all36_carb.rtf

psfgen)  $Id: top_all36_carb.rtf,v 1.2 2015/04/20 17:05:20 ryanmcgreevy
Exp $
psfgen) >>>>>>>>>>>> All-hydrogen topologies used in the <<<<<<<<<<<<<<<<
psfgen) >>>>> development of the CHARMM carbohydrate  force field<<<<<<<<
psfgen) >>>>>>>>>>>>>>>>>>>>>>>>> June 2009 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
psfgen) >>>>>>>> Direct comments to Alexander D. MacKerell Jr. <<<<<<<<<<
psfgen) >>>>>>>>>> via the CHARMM web site: https://urldefense.com/v3/__http://www.charmm.org__;!!DZ3fjg!4Xxo05Y92VyvqdtoLQou5zUov3ISK4Dv5v0aGHevPlkGxXMf3XQn3HWQF5zvsdtuyiGx9IuPK7olu_2dsgyepozGRMsl5zRb$ <<<<<<<<<<<<<<
psfgen) >>>>>>>>>>>>>>> parameter set discussion forum <<<<<<<<<<<<<<<<<<
psfgen)
psfgen) Created by CHARMM version 32 1
psfgen) reading topology file top_all36_cgenff.rtf

psfgen)
-------------------------------------------------------------------------- *
psfgen)           CGenFF: Topology for the Charmm General Force Field v.
3.0.1        *
psfgen)                     for Small Molecule Drug
Design                            *
psfgen)
-------------------------------------------------------------------------- *
psfgen)
psfgen) Created by CHARMM version 36 1
psfgen) reading topology file toppar_all36_carb_glycopeptide.str

psfgen) reading topology from stream file
psfgen)  Topology for glycopeptide linkages
psfgen)
psfgen) Created by CHARMM version 32 1
psfgen) skipping parameters in stream file
psfgen)     new parametes
psfgen)
psfgen) reading topology file toppar_water_ions_namd.str

psfgen)  Toplogy and parameter information for water and ions.
psfgen)
psfgen) reading topology from stream file
psfgen)  Topology for water and ions
psfgen)
psfgen) Created by CHARMM version 31 1
psfgen) skipping parameters in stream file
psfgen)  Parameters for water and ions
psfgen)
psfgen) skipping parameters in stream file
psfgen)  NBFix between carboxylate and sodium
psfgen)
psfgen) building segment X
psfgen) reading residues from pdb file X.pdb
psfgen) unknown residue type H2O2
psfgen) extracted 1 residues from pdb file
psfgen) setting patch for first residue to NONE
psfgen) setting patch for last residue to NONE
psfgen) enabling angle autogeneration
psfgen) enabling dihedral autogeneration
Info: generating structure...
psfgen) unknown residue type H2O2

W dniu 2.11.2023 o 18:21, Diego Gomes pisze:
> Thanks to Yupeng & Hale the issue has been found and addressed in the
> CVS source.
> To fix it in your installed version, please change line 2692 of
> *molefacture_internals.tcl *
>
> from
> *set notcgenfftopo 1
> *
> to
> *set notcgenfftopo 0*
>
>  (see attached image)
>
> You may find molefacture_internals.tcl at
>
> MacOS
> /Applications/VMD\
> 1.9.4a57-arm64-Rev12.app/Contents/vmd/plugins/noarch/tcl/molefacture2.0/molefacture_internals.tcl
> <https://urldefense.com/v3/__http://1.9.4a57-arm64-Rev12.app/Contents/vmd/plugins/noarch/tcl/molefacture2.0/molefacture_internals.tcl__;!!DZ3fjg!4Xxo05Y92VyvqdtoLQou5zUov3ISK4Dv5v0aGHevPlkGxXMf3XQn3HWQF5zvsdtuyiGx9IuPK7olu_2dsgyepozGRBASgoyr$ >
>
>
> Linux
>
> vmd_install_path/lib/vmd/plugins/noarch/tcl/molefacture2.0/molefacture_internals.tcl
>
>
>
> Please let us know if you find any other issues.
>
>
> Friendly regards,
>
> Diego.
>
>
> Screenshot 2023-11-02 at 12.12.32 PM.png
>
>
>
> On Mon, Oct 30, 2023 at 12:58 PM Jirui Yang <jirui_at_hawaii.edu> wrote:
>
> I still need to regenerate your problem. However, in my most
> recent research using VMD, it has appeared that some bonds will
> disappear after running calculations. We thought it was a bug at
> first. Please keep me updated on this issue.
> Respectfully
> Jirui
>
> On Mon, Oct 30, 2023 at 3:07 AM Pawel Kedzierski
> <pawel.kedzierski_at_pwr.edu.pl> wrote:
>
> My apology for the double posting, but I've just realized that
> my vmd
> was not the most recent one and I have confirmed, that the
> problem
> persists in 1.9.4a57 for Linux
> Also, at the time of saving PSF and PDB files from Molefacture I
> answered "No" to the question, whether to download the
> topology from the
> CGenFF server.
> With regards,
> Paweł Kędzierski
>
> W dniu 30.10.2023 o 08:54, Paweł Kędzierski pisze:
> > Dear All,
> >
> > Since several years I use Molefacture & FFTK on my molecular
> modeling
> > classes. This year I have switched to using Molefacture 2
> and I have
> > observed, that the angles and dihedrals are not generated
> from the
> > bonds and therefore missing in the saved the PSF file.
> Perhaps I am
> > missing something, but I don't see any option to generate
> them on
> > request. On the other hand, Molefacture 1.0 available with
> vmd1.9.4a8
> > saved the PSF file with complete topology information.
> >
> > To reproduce the problem, you may save the example below as a
> > h2o2.mol2 file, load it into VMD, open
> > Extensions->Modeling->Molefacture, create a new working
> molecule in
> > Molefacture using File->New molecule->From selection (using the
> > selection "all"), and then save with File->Write PSF and PDB
> files. In
> > the PSF file, there are 0 angles and 0 dihedrals. The same
> happens
> > with the option Build->Topology & Parameters->Export to FFTK.
> > This was tested using vmd1.9.4a55 on Linux Debian 12.
> > How can I fix this, to create the PSF file with complete
> topology,
> > usable with FFTK?
> > With regards,
> > Paweł Kędzierski
> >
> > ----<h2o2.mol2 file contents----
> > @<TRIPOS>MOLECULE
> > *****
> >  4 3 0 0 0
> > SMALL
> > GASTEIGER
> >
> > @<TRIPOS>ATOM
> >       1 O           0.1046   -0.1116   -0.5641 O.3     1 UNL1
> > -0.2528
> >       2 O           0.5297   -0.9231    0.5641 O.3     1 UNL1
> > -0.2528
> >       3 H          -0.6326    0.3369   -0.1076 H       1 UNL1
> > 0.2528
> >       4 H          -0.0658   -1.6768    0.3903 H       1 UNL1
> > 0.2528
> > @<TRIPOS>BOND
> >      1     1     2    1
> >      2     1     3    1
> >      3     2     4    1
> > ----<cut above this line>-----
> >
> >
>
>
>
> --
> Diego Enry B. Gomes, PhD
> Department of Physics at Auburn University &
> NIH Center for Macromolecular Modeling and Visualization
> Leach Science Center - Ste. 3182 - Auburn, AL
> dgomes_at_auburn.edu