From: Leonardo Trabuco (ltrabuco_at_ks.uiuc.edu)
Date: Mon Jul 23 2007 - 10:28:01 CDT

Dear Hori:

On Mon, Jul 23, 2007 at 04:50:10AM -0700, hori koshii wrote:
> Just wonder if there is any option for saltbr package that may allow the printout of total number of saltbridges throughout the trajectory (#saltbr vs. frame). I tried but the log file only prints out the "total" numbers for the whole trajectory, instead of numbers in each frame. I just wonder if there is any extra options beside the one found on this page (http://www.ks.uiuc.edu/Research/vmd/plugins/saltbr/)
> or can anyone suggest a easy way to do so?

There is no such extra option. Assuming you don't wanna change the code,
one way to do it is to write a small script that loops over all frames
and runs saltbr on each of them (option -frames now). You would generate
a log file for each frame and then get the number of salt bridges from
each config file with grep or something like that.

So your script would look like (not tested):

set nframes [molinfo top get numframes]
for {set i 0} {$i < $numframes} {incr i} {
  animate goto $i
  saltbr -sel <atomselection> -frames now -log saltbr-frame$i.log -writefiles no
}

Then you have the information you need in the log files, you just have
to get it. If you are using bash under Linux, you could do that with:

for i in `\ls -Fv saltbr-*.log`; do grep "^Found " $i|awk '{print $2}'; done > saltbr-per-frame.log

But that's just one way to do it...

Cheers,
Leo

-- 
Leonardo Trabuco, Ph.D. student
Theoretical and Computational Biophysics Group
University of Illinois at Urbana-Champaign