我目前正在GROMACS 4.6.5中进行并行级联模拟,并使用bash脚本输入命令:
#!/bin/bash
pdb2gmx -f step_04_01.pdb -o step_04_01.gro -water none -ff amber99sb -ignh
grompp -f minim.mdp -c step_04_01.gro -p topol.top -o em.tpr
mdrun -v -deffnm em
grompp -f nvt.mdp -c em.gro -p topol.top -o nvt.tpr
mdrun -v -deffnm nvt
grompp -f md.mdp -c nvt.gro -t nvt.cpt -p topol.top -o step_04_01.tpr
mdrun -v -deffnm step_04_01
trjconv -s step_04_01.tpr -f step_04_01.xtc -pbc mol -o step_04_01_pbc.xtc
g_rms -s itasser_2znh.tpr -f step_04_01_pbc.xtc -o step_04_01_rmsd.xvgtrjconv和g_rms等命令需要用户交互来选择选项。例如,在运行trjconv时,您将得到以下信息:
Select group for output
Group 0 ( System) has 6241 elements
Group 1 ( Protein) has 6241 elements
Group 2 ( Protein-H) has 3126 elements
Group 3 ( C-alpha) has 394 elements
Group 4 ( Backbone) has 1182 elements
Group 5 ( MainChain) has 1577 elements
Group 6 ( MainChain+Cb) has 1949 elements
Group 7 ( MainChain+H) has 1956 elements
Group 8 ( SideChain) has 4285 elements
Group 9 ( SideChain-H) has 1549 elements
Select a group:用户需要输入例如。0进入终端选择Group 0。我试过使用expect和send,例如:
trjconv -s step_04_01.tpr -f step_04_01.xtc -pbc mol -o step_04_01_pbc.xtc
expect "Select group: "
send "0"然而,这是行不通的。我也尝试过使用-flag,比如在Script中,但是它说它不是一个公认的输入。
我的expect \ send格式正确吗?在GROMACS还有别的方法吗?
发布于 2017-08-25 16:23:55
我不知道gromacs,但我认为它们只是要求您使用bash语法:
yourcomand ... <<EOF
1st answer to a question
2nd answer to a question
EOF所以你可能
trjconv -s step_04_01.tpr -f step_04_01.xtc -pbc mol -o step_04_01_pbc.xtc <<EOF
0
EOF发布于 2021-04-06 01:58:36
您可以使用
echo 0 | trjconv -s step_04_01.tpr -f step_04_01.xtc -pbc mol -o step_04_01_pbc.xtc如果您需要多个输入,只需使用
echo 4 4 | g_rms -s itasser_2znh.tpr -f step_04_01_pbc.xtc -o step_04_01_rmsd.xvghttps://stackoverflow.com/questions/45885541
复制相似问题