Gmx command with additional input with csh

GROMACS version: 2021.3
GROMACS modification: No
Here post your question

Hello, recently I have started using csh when I run gromacs.
I feel it is very convenient cause I can do all simulation with one command.
But I don’t know how to set selection with csh.

For example, when I run the following csh file I have to type ‘10 0’ manually.


#!/bin/csh

gmx energy -f step4.0_minimization.edr -o step4.0_potential.xvg
10 0

end


Select the terms you want from the following list by
selecting either (part of) the name or the number or a combination.
End your selection with an empty line or a zero.

1 Bond 2 U-B 3 Proper-Dih. 4 Improper-Dih.
5 CMAP-Dih. 6 LJ-14 7 Coulomb-14 8 LJ-(SR)
9 Coulomb-(SR) 10 Coul.-recip. 11 Position-Rest. 12 Dih.-Rest.
13 Potential 14 Pressure 15 Constr.-rmsd 16 Vir-XX
17 Vir-XY 18 Vir-XZ 19 Vir-YX 20 Vir-YY
21 Vir-YZ 22 Vir-ZX 23 Vir-ZY 24 Vir-ZZ
25 Pres-XX 26 Pres-XY 27 Pres-XZ 28 Pres-YX
29 Pres-YY 30 Pres-YZ 31 Pres-ZX 32 Pres-ZY
33 Pres-ZZ 34 #Surf*SurfTen 35 T-rest


I have tried ‘>10 0’ instead, but it doesn’t work.
Is there any way to set selection in one gmx command line?

Any suggestion would be greatly appreciated.
Thanks!

Try this:
echo 10 0 | gmx energy -f step4.0_minimization.edr -o step4.0_potential.xvg

Oh that’s the way!!! Thanks a lot jalemkul!!!

I also have tried two selection, and it works too.
echo 4 4 | gmx trjconv -s step4.1_equilibration.tpr -f step4.1_equilibration.xtc -o step4.1_protein_water.xtc -pbc nojump -ur compact -center -dt 10


Reading file step4.1_equilibration.tpr, VERSION 2021.3-dev-20210818-11266ae-dirty-unknown (single precision)
Select group for centering
Group 0 ( System) has 90396 elements
Group 1 ( Protein) has 7850 elements
Group 2 ( Protein-H) has 3952 elements
Group 3 ( C-alpha) has 499 elements
Group 4 ( Backbone) has 1497 elements
Group 5 ( MainChain) has 1994 elements
Group 6 ( MainChain+Cb) has 2471 elements
Group 7 ( MainChain+H) has 2469 elements
Group 8 ( SideChain) has 5381 elements
Group 9 ( SideChain-H) has 1958 elements
Group 10 ( Prot-Masses) has 7850 elements
Group 11 ( non-Protein) has 82546 elements
Group 12 ( Other) has 82546 elements
Group 13 ( BGLCNA) has 54 elements
Group 14 ( AMAN) has 22 elements
Group 15 ( SOD) has 82 elements
Group 16 ( CLA) has 77 elements
Group 17 ( TIP3) has 82311 elements
Select a group: Selected 4: ‘Backbone’
Select group for output
Group 0 ( System) has 90396 elements
Group 1 ( Protein) has 7850 elements
Group 2 ( Protein-H) has 3952 elements
Group 3 ( C-alpha) has 499 elements
Group 4 ( Backbone) has 1497 elements
Group 5 ( MainChain) has 1994 elements
Group 6 ( MainChain+Cb) has 2471 elements
Group 7 ( MainChain+H) has 2469 elements
Group 8 ( SideChain) has 5381 elements
Group 9 ( SideChain-H) has 1958 elements
Group 10 ( Prot-Masses) has 7850 elements
Group 11 ( non-Protein) has 82546 elements
Group 12 ( Other) has 82546 elements
Group 13 ( BGLCNA) has 54 elements
Group 14 ( AMAN) has 22 elements
Group 15 ( SOD) has 82 elements
Group 16 ( CLA) has 77 elements
Group 17 ( TIP3) has 82311 elements
Select a group: Selected 4: ‘Backbone’
Reading frame 0 time 0.000
Precision of step4.1_equilibration.xtc is 0.001 (nm)
Using output precision of 0.001 (nm)
Last frame 1 time 5.000

I saw this was only post that mentions CMAP-Dih. as an energy term. I have two energy terms which I am not seeing very often in this forum or on Google. They are:

2  Connect-Bonds
6  CMAP-Dih.

My system is a two chain protein and I am using OPLS-AA forcefield. When I run the complex with the ligand I see 2 Angle replaces 2 Connect-Bonds but then I see another energy term for 6 Periodic-Improper-Dih.

What are Connect-Bonds and also what is difference between Improper-Dih. and Periodic-Improper-Dih.

Ok I see ACPYPE generates forcefield with periodic function type 9. Makes sense I see it in ligand and complex but not protein. See unsure of the Connect-Bonds vs. shouldn’t I typically see Angle here?

[ dihedrals ] ; propers
; for gromacs 4.5 or higher, using funct 9
;    i      j      k      l   func   phase     kd      pn
     1      4      3      6      9   180.00  15.16700   2 ;     O1-    C2-    C1-    C4
     1      4      3      8      9   180.00  15.16700   2 ;     O1-    C2-    C1-    C6