# Hydrogen bond analysis with cpptraj 
# Load topology and trajectory
parm ../complex_o.top 
trajin ../md_o.crd
# All solute-solute and solute-solvent hydrogen bonds + water bridges.
hbond All out All.hbvtime.dat solventdonor :WAT solventacceptor :WAT@O \
  avgout All.UU.avg.dat solvout All.UV.avg.dat bridgeout All.bridge.avg.dat
# Backbone hydrogen bonds only. Save time series data.
hbond Backbone :83-85,132,135,162,163,179-185,203-211,215-218@C,O,N,H avgout BB.avg.dat series uuseries bbhbond.gnu
# Create file containing only number of solute-solute and solute-solvent
# hydrogen bonds, and number of solute-solvent-solute bridges.
create nhbvtime.agr All[UU] Backbone[UU] All[UV] All[Bridge]
# Calculate RMSD to first frame.
rms BBrmsd :83-85,132,135,162,163,179-185,203-211,215-218@C,CA,N out BBrmsd.agr
# Run to actually find hydrogen bonds and generate data.
run
# Perform lifetime analysis on backbone hydrogen bonds
lifetime Backbone[solutehb] out backbone.lifetime.dat
runanalysis
