Creating data file using charmm2lammps

hello friends . i have a problem about creating data file using charmm2lammps. because i realized that the input file and data file are empty . Does anyone know why this happens?
in addition i use bellow command to create data and input file . is this correct for windows environment?
perl all27_prot_lipid water-ion_autopsf

Thank you for your guidance

Detailed instructions for how to use are given in the README file in the tools/ch2lmp folder of the LAMMPS source distribution. Please note that most LAMMPS features were developed and tested on Unix/Linux machines and thus there is always a risk for platform specific issues, when running on Windows. For the main LAMMPS source code, we have tried to systematically address this and create abstractions, but for all contributed tools, especially older ones, there could still be platform issues.

As an alternative you could try to use to build your input (instead of VMD + as it can output LAMMPS compatible files directly IIRC.

1 Like

hi. thank you so much :pray: :pray:

ill share my experience with some lammps veterans have stated here or somewhere else that this perl script is outdated.

it didnt work for me by using charmm-gui pdb reader on PDB 2CV5 and then something about masses equal to -1 in recent versions of charmm36 force field. you have to go back to the 2016 version of force field parameters (toppar_c36_jul16_mass_orig.tgz) instead of latest (toppar_c36_jul22.tgz) for it to work:

instead use Solution Builder on, or another input generator (membrane, ligand, …) appropriate for your application. charmmgui has a checkbox in step 3 to generate LAMMPS input files with CHARMM36m force field:


cmap generated by charm-gui didnt work for me:

ERROR on proc 0: Incorrect format in cmap grid potential file! 2304/3456 values (src/potential_file_reader.cpp:148)
Last command: fix cmap all cmap charmmff.cmap

so i manually deleted cmap directives and parameters from, step4.0_minimization.inp, step4.1_equilibration.inp, step5_production.inp. my simulation is lacking accuracy because of the missing protein cmap parameters but at least it runs.

i posted a bug report on the charm-gui forum but never got an answer. too bad charmmgui is not open source because i would go in and fix cmap issue myself.

2cv5-solution.pdf (7.3 MB)

Please provide those generated files and we can have a look and see if there is an easy fix.
Same for the issue in

There is a CHARMM 36 compatible file cmap file in the potentials folder of the LAMMPS distribution.

It is more a bug in the LAMMPS fix cmap code than in charmm-gui and thus it is not surprising that you get ignored by the CHARMM folks. The names of the authors of fix cmap are in the source file. You may have more luck with contacting those.

warning 280MB tgz archive…

there might be an easy workaround, see below and to be continued post in [LAMMPS Development].

i strongly disagree with wasting any effort to update, specially since there’s already a modern viable alternative with charmmgui and the very advanced features of input generator for various applications (solutions, membranes, ligands, …)

i can tell you it’s not an easy quick fix, i already put in ~1/2 day trying to update script which is based a very old charmm force field parameter single file format circa 2016. now charmm36(m) force field parameters are multiple “streaming” text formats to account for a greatly expanded parameter set for almost any atom / molecule system possible.

another limitation of is it cannot do protein-dna complexes, only protein-only or dna-only simulations because you would need to combine charmm36 protein and dna parameters files. can only read one or the other at a time.

for these reasons, i humbly recommend users switch to charmmgui generated lammps input files, instead of taking charmmgui charmm files and converting them using

i also already tried that a while ago when i found the file lammps/potentials/charmm36.cmap but in that case i got the error:

ERROR: Incorrect format of CMAP section: too many items: ’ 1 1 15 17 19 32 34 # C-C N-NH1 CA-CT1 C-C N-NH1’ (src/MOLECULE/fix_cmap.cpp:974)
Last command: read_data fix cmap crossterm CMAP

ok well that’s great news if that’s something fixable from the lammps cmap src instead. ill have a look at it. I love open source because if i have a problem i don’t have to call technical support or wait for a proprietary company to release a new version, i can just read the source code myself and resolve the problem immediately.

since this is now off-topic for [LAMMPS Beginners], to be continued in a separate post in [LAMMPS Development].

I just changed the sub-category. No need to start a new discussion.

sorry you have to change category again, this should be [LAMMPS General Discussion] for reach the intended audience of other users having same problem later.

i dont have a src code patch so it’s not meant for [LAMMPS Development] yet.

VERSION: Large-scale Atomic/Molecular Massively Parallel Simulator - 21 Nov 2023

there are two remaining issues with the charmmgui generated lammps input files, so use the following two workarounds.

ERROR (1): charmmgui generated charmmff.cmap file has incomplete cmap parameters only for amino acids included in input data (~32kb), but fix_cmap.cpp expects the full list of parameters always (~51kb).

cd 2cv5-solution/lammps; lmp -in step4.0_minimization.inp

ERROR on proc 0: Incorrect format in cmap grid potential file! 2304/3456 values (src/potential_file_reader.cpp:148)
Last command: fix cmap all cmap charmmff.cmap

WORKAROUND (1): switch to lammps cmap file from potentials directory:

mv charmmff.cmap charmmff-charmmgui.cmap
cp $LAMMPS_POTENTIALS/charmm36.cmap charmmff-lampps.cmap
cp charmmff-lampps.cmap charmmff.cmap

ERROR (2): potential_file_reader.cpp called from fix_cmap.cpp doesn’t handle # comments at end of lines of input data file.

lmp -in step4.0_minimization.inp

ERROR: Incorrect format of CMAP section: too many items: ’ 1 1 18 20 22 28 30 # C-C N-NH1 CA-CT1 C-C N-NH1’ (src/MOLECULE/fix_cmap.cpp:974)
Last command: read_data fix cmap crossterm CMAP

WORKAROUND (2): strip comments out from using sed:

sed -i.bak 's/#.*$//'

now “lmp -in step4.0_minimization.inp” runs without error messages, however…


now the one thing that still makes me nervous… is CMAP code using the right parameters for the right amino acids. how could i test that ?

Thanks. For digging through the parsing issue the problem set size does not matter, but generally such large input decks are very impractical for debugging. It is strongly recommended (also for your own sake, if you are doing some debugging of your own) to set up a small trial system and also strip the input from all commands and details that are not relevant.

This is not a viable for everyone. So it is not a wasted effort, but rest assured, I won’t spend much time on it.

It is based on much older CHARMM parameter sets (I think CHAMM19), but some small updates have been added by different people over time. is not the only tool that is incompatible with the “stream” approach and thus requires people to merge those files.

That is a very different error and does not step from reading the CMAP file but from reading the data file. There is an easy fix for that.

I have looked already into it and I don’t think that is something that is easily corrected by somebody that does not have a lot of experience with LAMMPS since this requires some changes to the flow of control.

Well, you should be able to do the same, but I think the LAMMPS Development category is just fine. How to implement the necessary changes is not something that most people will want to hear about. Those looking for solutions will find those anyway, since all of these are sub-categories of the LAMMPS category.

Just switching the file is not sufficient, also the crossterm types need to be updated to match the expected terms.

This is not caused by the PotentialFileReader class since this is not due to reading the CMAP file, but rather the data file. As already remarked this is an easy fix.

It probably doesn’t. See my comment from above.

I’ve just looked into this, and I think your assessment is wrong. The atom type number that used to follow the MASS keyword is not used by at all.

sorry that was my complete original simulation based on pdb 2CV5 with all protein and dna segments in the nucleosome complex.

i just created a MWE using just one protein and one dna segment. im not including all the auxiliary files generated by charmmgui, just the lammps input folder. this is about as small as i can get it unless i try to find another much simpler pdb entry of a protein-dna complex.

i attached on github PR 4022, it doesnt work here zip (~12mb) or tgz (~14mb) maybe because it’s over size limit.

sorry it took a very long time, charmmgui is very slow, i applied twice to get license and download link for academiccharm software so i can run on my own local machine or university cluster instead of a shared public webserver. unfortunately, both my applications have been ignored.

TESTED AND PASSED PR 4022 on full 2cv5-solution simulation and 2cv5-mwe

lmp -h

Large-scale Atomic/Molecular Massively Parallel Simulator - 21 Nov 2023 - Development
Git info (cmap-fixes-for-charmm-gui / patch_21Nov2023-368-g1ab406ee1a-modified)
OS: Darwin 22.3.0 arm64
Compiler: Clang C++ Apple LLVM 14.0.3 (clang-1403. with OpenMP not enabled
C++ standard: C++11
MPI v3.1: Open MPI v5.0.0, package: Open MPI [email protected] Distribution, ident: 5.0.0, repo rev: v5.0.0, Oct 26, 2023