modtnkxyz is a BASH script written to translate a XYZ file into TINKER XYZ file (from now txyz) by using a txyz template. In particular, motnkxyz has been written thinking to a well precise situation: generate a new txyz from a txyz that has been reoriented in the space using VMD or any other software that save in xyz coordinates.
The idea is to load the original txyz in a graphical software to be manipulated and saved as xyz. The xyz structure is then converted in txyz by modtnkxyz using the original txyz file as template. In building the new TINKER structure, the template is used to retrieve all the information but the coordinates, which, instead, are taken from the xyz file.

Important note: to sucessfully generate the txyz file, the manipulation should not change the original structure, i.e. bonds cannot be deleted or created, nor atoms, fragments or molecules should be added or deleted.


A bash shell


Use this script is quite straigthforward. You need the xyz structure of the manipulated system and its txyz template.
Convert the xyz into txyz with the following command:

modtnkxyz <file1> <file2> output_file

Where file1 and file2 can be either xyz and txyz or txyz and xyz files, respectively; the output file must be passed to the script as last parameter.


Despite the use of the script is quite straightforward, some controls have been implement to manage most of the possible source of errors. When an error occurs, the script will fail prompting to the user the appropriate error message. The most common sources of error are:

  1. The user has not passed to the script all the parameters (xyz, txyz and output files);
  2. One input file (or both) is not found;
  3. xyz and txyz files have not the same number of lines;
  4. xyz and/or txyz have not valid xyz/txyz format.


You are free to use, modify and redistribute modtnkxyz as far as you keep them free as in beer.
As free(as in beer)ware software, modtnkxyz comes with _ABSOLUTE_ _NO_ (as in NOTHING, NADA, NICTHS, NIENTE, RIEN) WARRANTY. The author is _NOT_ responsible if those software will erase your hard disks, empty your bank account, stole your car, seduce your wife, shave your dog or make any kind of mess and damages, including loss of data or worst. By using polybuild and its libraries, you _ACCEPT_ these terms.


You can download modtnkxyz here

Rate this page:

rating: 0+x

Add a New Comment
or Sign in as Wikidot user
(will not be published)
- +
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License