Skip to content

Commit

Permalink
fixed an issue importing XYZ coordinates that was affecting some user…
Browse files Browse the repository at this point in the history
…s. Thanks to Daoud El Kadiri for reporting and locating the error (and helping with debugging)!
  • Loading branch information
jewettaij committed Jul 1, 2021
1 parent c432d78 commit 7e52978
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![GitHub](https://img.shields.io/github/license/jewettaij/moltemplate)](./LICENSE.md)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/moltemplate)](https://pypistats.org/packages/moltemplate)
[![PyPI - Version](https://img.shields.io/pypi/v/moltemplate)](https://pypi.org/project/moltemplate/)
[![Website](https://img.shields.io/website?down_color=orange&down_message=moltemplate.org%20offline&up_color=green&up_message=online&url=https%3A%2F%2Fmoltemplate.org)](http://moltemplate.org)
[![Website](https://img.shields.io/website?down_color=orange&down_message=moltemplate.org%20offline&up_color=green&up_message=online&url=https%3A%2F%2Fmoltemplate.org)](https://moltemplate.org)
[![GitHub repo size](https://img.shields.io/github/repo-size/jewettaij/moltemplate)]()


Expand All @@ -12,10 +12,10 @@ Moltemplate

## Description

[Moltemplate](http://moltemplate.org)
[Moltemplate](https://moltemplate.org)
is a *general* cross-platform text-based molecule builder for
[**LAMMPS**](https://lammps.sandia.gov) and *(the TCL version of)*
[**ESPResSo**](http://moltemplate.org/espresso/).
[**ESPResSo**](https://moltemplate.org/espresso/).
Moltemplate was intended for building custom coarse-grained molecular models,
but it can be used to prepare realistic all-atom simulations as well.
It currently supports the
Expand Down Expand Up @@ -44,7 +44,7 @@ Moltemplate is inter-operable with
[**Open Babel**](https://open-babel.readthedocs.io/en/latest/FileFormats/The_LAMMPS_data_format.html),
[**EMC**](http://montecarlo.sourceforge.net/),
[**CellPACK**](http://www.cellpack.org),
[**LigParGen**](http://moltemplate.org/doc/moltemplate_talk_2019-8-15.pdf#page=190),
[**LigParGen**](https://moltemplate.org/doc/moltemplate_talk_2019-8-15.pdf#page=190),
[**Vipster**](https://sgsaenger.github.io/vipster),
[**struc2lammpsdf**](https://nanohub.org/resources/struc2lammpsdf),
and any other program that reads or generates LAMMPS data (.lmpdat) files.
Expand All @@ -62,23 +62,23 @@ The best way to learn how to use moltemplate is to find an example
which is similar to the system that you wish to simulate and modify it.
This repository includes approximately 50 [examples](./examples).
Some of the moltemplate examples are also demonstrated (with pictures)
[here](http://moltemplate.org/visual_examples.html).
[here](https://moltemplate.org/visual_examples.html).

All moltemplate users should probably read chapter 4 of the
[reference manual](./doc/moltemplate_manual.pdf)
*(It's only a few pages long. The first 3 chapters are optional.)*
In addition, there are also several
[talks/tutorials](http://moltemplate.org/doc/talks.html)
[talks/tutorials](https://moltemplate.org/doc/talks.html)
online.


### Limitations for preparing all-atom simulations

Moltemplate [does *not* choose atom types automatically ("atom typing")](http://moltemplate.org/force_field_recommendations.html),
Moltemplate [does *not* choose atom types automatically ("atom typing")](https://moltemplate.org/force_field_recommendations.html),
and currently cannot be used to build all-atom proteins from scratch.
3rd-party tools may be needed to calculate atomic partial charges accurately.
Some suggestions for selecting the appropriate atom types for your molecules
are provided [here](http://moltemplate.org/force_field_recommendations.html).
are provided [here](https://moltemplate.org/force_field_recommendations.html).
*(Users who are unsure how to choose atom types are
encouraged to use
the [ATB](https://atb.uq.edu.au) database,
Expand Down
6 changes: 3 additions & 3 deletions moltemplate/genpoly_modify_lt.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ def ParseArgs(self, argv):
if i+3+3*natoms >= len(argv):
raise InputError(
'Error: The ' + argv[i] + ' flag should be followed by at least '+str(3+3*natoms)+
'arguments .\n')
' arguments .\n')
natoms = int(argv[i+1])
if i+3+3*natoms >= len(argv):
raise InputError(
Expand Down Expand Up @@ -557,8 +557,8 @@ def ParseArgs(self, argv):
natoms = 1
if i+5+2*natoms >= len(argv):
raise InputError(
'Error: The ' + argv[i] + ' flag should be followed by at least'+str(5+2*natoms)+
'arguments .\n')
'Error: The ' + argv[i] + ' flag should be followed by at least '+str(5+2*natoms)+
' arguments .\n')
natoms = int(argv[i+1])
if i+5+2*natoms >= len(argv):
raise InputError(
Expand Down
6 changes: 3 additions & 3 deletions moltemplate/scripts/moltemplate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# Copyright (c) 2013

G_PROGRAM_NAME="moltemplate.sh"
G_VERSION="2.19.11"
G_DATE="2021-6-21"
G_VERSION="2.19.12"
G_DATE="2021-6-29"

echo "${G_PROGRAM_NAME} v${G_VERSION} ${G_DATE}" >&2
echo "" >&2
Expand Down Expand Up @@ -569,7 +569,7 @@ while [ "$i" -lt "$ARGC" ]; do
# a string is numeric.
#http://rosettacode.org/wiki/Determine_if_a_string_is_numeric#AWK

awk 'function isnum(x){return(x==x+0)} BEGIN{targetframe=1;framecount=0} {if (isnum($0)) {framecount++} else{if (framecount==targetframe){ if (NF>0) { if ((NF==3) && isnum($1)) {print $1" "$2" "$3} else if ((NF>3) && (NR>2) && isnum($2)) {print $2" "$3" "$4} }}}}' < "$XYZ_FILE" > "$tmp_atom_coords"
awk '{if (NR>2) {if (NF==4) {print $2" "$3" "$4} else {if (NF==3) {print $1" "$2" "$3}}}}' < "$XYZ_FILE" > "$tmp_atom_coords"

elif [ "$A" = "-pdb" ]; then
if [ "$i" -eq "$ARGC" ]; then
Expand Down

0 comments on commit 7e52978

Please sign in to comment.