Project

General

Profile

posre.sh

Joe Jordan, 11/09/2018 12:19 PM

 
1
#!/bin/bash
2

    
3
gmx='/tmp/current/bin/gmx'
4

    
5
pdb='chainTer.pdb'
6
itpA='topol_Protein_chain_A.itp'
7
itpB='topol_Protein_chain_B.itp'
8

    
9
$gmx pdb2gmx -f $pdb -ff 'amber03' -water 'tip3p' -o vacuum.gro -p vacuum.top
10
$gmx editconf -f vacuum.gro -o box.gro -c -bt cubic 
11
cp vacuum.top solvate.top
12
$gmx solvate -cp box.gro -o solvate.gro -p solvate.top
13
touch ion.mdp
14
$gmx grompp -f ion.mdp -c solvate.gro -r solvate.gro -o solvate.tpr -p solvate.top
15
cp solvate.top ions.top
16
$gmx select   -s solvate.tpr -on solvent.ndx -select 'group "SOL"'
17
$gmx genion -s solvate.tpr -conc 0.1 -o ions.gro -p ions.top -n solvent.ndx
18

    
19
#works
20
protein_ca_sel='chain A and name CA'
21
current='ca-A'
22
$gmx select   -s $pdb -on $current.ndx -select "$protein_ca_sel"
23
$gmx genrestr -f $pdb -n  $current.ndx -o posre_$current.itp
24
echo -e "; Include Position restraint file
25
#ifdef POSRES_CA
26
#include \"posre_$current.itp\"
27
#endif\n" >> $itpA
28
$gmx grompp -f ca.mdp -c ions.gro -p ions.top -o ca-A.tpr -r ions.gro
29
$gmx mdrun -s ca-A.tpr -deffnm ca-A
30

    
31
#fails
32
protein_ca_sel='chain B and name CA'
33
current='ca-B'
34
$gmx select   -s $pdb -on $current.ndx -select "$protein_ca_sel"
35
$gmx genrestr -f $pdb -n  $current.ndx -o posre_$current.itp
36
echo -e "; Include Position restraint file
37
#ifdef POSRES_CA
38
#include \"posre_$current.itp\"
39
#endif\n" >> $itpB
40
$gmx grompp -f ca.mdp -c ions.gro -p ions.top -o ca-B.tpr -r ions.gro
41
$gmx mdrun -s ca-B.tpr -deffnm ca-B
42