vitroid/GenIce

Is it possible to avoid printing extra comment lines at the end of .gro file?

Closed this issue · 2 comments

Currently genice2 prints two extra lines at the end of .gro outputs. For example:
genice2 --water tip4p --rep 1 1 1 1h > test.gro
the content of test.gro is:

Generated by GenIce https://github.com/vitroid/GenIce 
64
    1ICE     OW    1   0.127   0.183   0.337
    1ICE    HW1    2   0.175   0.149   0.261
    1ICE    HW2    3   0.175   0.149   0.413
    1ICE     MW    4   0.139   0.175   0.337
    2ICE     OW    5   0.528   0.447   0.106
    2ICE    HW1    6   0.570   0.481   0.185
    2ICE    HW2    7   0.438   0.482   0.109
    2ICE     MW    8   0.522   0.456   0.117
    3ICE     OW    9   0.659   0.539   0.331
    3ICE    HW1   10   0.656   0.634   0.334
    3ICE    HW2   11   0.613   0.510   0.410
    3ICE     MW   12   0.652   0.547   0.341
    4ICE     OW   13   0.528   0.449   0.556
    4ICE    HW1   14   0.438   0.484   0.560
    4ICE    HW2   15   0.570   0.483   0.636
    4ICE     MW   16   0.522   0.458   0.567
    5ICE     OW   17   0.256   0.091   0.563
    5ICE    HW1   18   0.261  -0.004   0.562
    5ICE    HW2   19   0.348   0.119   0.562
    5ICE     MW   20   0.268   0.083   0.563
    6ICE     OW   21   0.271   0.551   0.561
    6ICE    HW1   22   0.223   0.518   0.636
    6ICE    HW2   23   0.223   0.517   0.485
    6ICE     MW   24   0.259   0.542   0.561
    7ICE     OW   25   0.520   0.171   0.116
    7ICE    HW1   26   0.522   0.267   0.113
    7ICE    HW2   27   0.565   0.143   0.037
    7ICE     MW   28   0.526   0.180   0.106
    8ICE     OW   29   0.520   0.173   0.567
    8ICE    HW1   30   0.565   0.144   0.488
    8ICE    HW2   31   0.523   0.269   0.563
    8ICE     MW   32   0.526   0.182   0.556
    9ICE     OW   33   0.140   0.461   0.786
    9ICE    HW1   34   0.137   0.365   0.787
    9ICE    HW2   35   0.049   0.489   0.786
    9ICE     MW   36   0.128   0.452   0.786
   10ICE     OW   37   0.140   0.459   0.336
   10ICE    HW1   38   0.049   0.487   0.336
   10ICE    HW2   39   0.137   0.364   0.336
   10ICE     MW   40   0.128   0.451   0.336
   11ICE     OW   41   0.271   0.549   0.110
   11ICE    HW1   42   0.223   0.516   0.186
   11ICE    HW2   43   0.223   0.516   0.034
   11ICE     MW   44   0.259   0.540   0.110
   12ICE     OW   45   0.256   0.089   0.112
   12ICE    HW1   46   0.261  -0.006   0.111
   12ICE    HW2   47   0.348   0.118   0.112
   12ICE     MW   48   0.268   0.081   0.112
   13ICE     OW   49   0.649   0.079   0.342
   13ICE    HW1   50   0.738   0.114   0.339
   13ICE    HW2   51   0.607   0.113   0.263
   13ICE     MW   52   0.655   0.088   0.331
   14ICE     OW   53   0.649   0.081   0.792
   14ICE    HW1   54   0.607   0.115   0.713
   14ICE    HW2   55   0.738   0.116   0.789
   14ICE     MW   56   0.655   0.090   0.782
   15ICE     OW   57   0.659   0.541   0.781
   15ICE    HW1   58   0.655   0.636   0.785
   15ICE    HW2   59   0.613   0.512   0.860
   15ICE     MW   60   0.652   0.549   0.792
   16ICE     OW   61   0.127   0.185   0.787
   16ICE    HW1   62   0.174   0.150   0.863
   16ICE    HW2   63   0.175   0.151   0.712
   16ICE     MW   64   0.139   0.176   0.787
    0.78228388 0.73535726 0.90365185
#
#Command line: c:\users\username\appdata\local\programs\python\python38\scripts\genice2 --water tip4p --rep 1 1 1 1h

The two extra lines at the end breaks some tools, such as trjconv coming from Gromacs itself:

> gmx -quiet trjconv -f .\test.gro
Note that major changes are planned in future for trjconv, to improve usability and utility.
Will write xtc: Compressed trajectory (portable xdr format): xtc
Reading frames from gro file 'Generated by GenIce https://github.com/vitroid/GenIce ', 64 atoms.
Reading frame       0 time    0.000   Reading frames from gro file 'Generated by GenIce https://github.com/vitroid/GenIce ', 64 atoms.
Reading frame       0 time    0.000
Precision of .\test.gro is 0.001 (nm)
Using output precision of 0.001 (nm)
 ->  frame      0 time    0.000
-------------------------------------------------------
Program:     gmx trjconv, version 2020.6-MODIFIED
Source file: src\gromacs\fileio\groio.cpp (line 67)

Fatal error:
gro file does not have the number of atoms on the second line

For more information and tips for troubleshooting, please check the GROMACS
website at http://www.gromacs.org/Documentation/Errors
-------------------------------------------------------

Deleting the two extra lines fix the issue.
Of course I can always delete them manually, but that is a bit annoying :(

Thank you for your opinion! You are right.
I modified not to output the comment at the bottom of .gro file and deployed as the newest version 2.1.7.1.
Could you please re-install it with pip command?

Thanks for the fix! Can confirm it resolves the issue.