From: Giacomo Fiorin (giacomo.fiorin_at_gmail.com)
Date: Mon Oct 26 2020 - 15:49:35 CDT

Hello Ritu, I am not familiar with the script in question. I'm CC'ing the
VMD mailing list below to see if anybody has an idea.

Giacomo

On Mon, Oct 26, 2020 at 4:44 PM Ritu Arora <ritu.arora_at_mail.concordia.ca>
wrote:

> Hi Giacomo,
>
> Can I please ask you a small query related to the contactFreq.tcl script?
> How the following highlighted portions of the script is working:
>
> lappend frameCount $atom
> set loc [lsearch $allAtoms $atom]
> if { $loc == -1 } {
> lappend allAtoms $atom
> lappend allCount 1
> } else {
> lset allCount $loc [expr { [lindex $allCount $loc] + 1 } ]
> }
> }
> $frameAtoms delete
> }
>
> puts $outFile "[clock format [clock scan now]] Search finished."
>
> puts $outFile "Find interactions:"
> puts $outFile "Residue \t\tfraction"
> #print count after sorting
> set outData {}
> foreach { a } $allAtoms { c } $allCount {
> lappend outData [concat $c $a]
> }
> foreach { data } [lsort -integer -index 1 $outData] {
> set c [lindex $data 0]
> set fraction [expr { 100*$c/($numberOfFrames+0.0) }]
>
> Sorry for my ignorance, but I fail to decode the script, how does the
> script count sustained contacts? The script counts the number of atoms of a
> selection within 4.5 of another selection. So, if there are more than one
> atom of a residue in a frame, it keeps on adding those atoms..not sure?
>
> I look forward to your reply.
>
> Thank you.
> Best,
> Ritu
>