From: L. Michel Espinoza-Fonseca (mef_at_ddt.biochem.umn.edu)
Date: Fri Jan 11 2008 - 05:57:10 CST

Hi all,

I'm trying to compute contacts between two proteins from a trajectory.
To achieve that, I'm using the following simple script:

set outfile [open output.txt w]
set nf [molinfo top get numframes]
set P2 [atomselect top "segname P2 and resid 28"]
set P1 [atomselect top "segname P1 and resid 63"]
for {set i 0} {$i<$nf} {incr i} {
$P2 frame $i
$P1 frame $i
$P2 update
$P1 update
set contact [llength [lindex [measure contacts 4.7 $P2 $P1] 0]]
puts $outfile "Frame $i, $contact"
}
close $outfile

When I use the script, everything works well. However, The output
gives me something like this:

Frame 0, 58
Frame 1, 80
Frame 2, 62
Frame 3, 43
Frame 4, 59
Frame 5, 80
Frame 6, 57
Frame 7, 94
Frame 8, 65
Frame 9, 137
Frame 10, 104
...

So I was wondering if you guys know a way to get a true/false output
instead, so I can get something like this:

Frame 0, 1
Frame 1, 1
Frame 2, 1
Frame 3, 1
Frame 4, 1
Frame 5, 0
Frame 6, 0
Frame 7, 1
Frame 8, 0
Frame 9, 1
Frame 10, 1
...

All comments will be appreciated.

Cheers,
Michel