From: John Stone (johns_at_ks.uiuc.edu)
Date: Thu Feb 06 2020 - 11:40:21 CST

Hi,
  Okay, now we have the script, but you haven't actually asked a
well-formed question. Please provide as much other information that you
can so that someone could use it to help you.

I assume you're having some trouble and that you're getting an
atom selection error. You haven't told us what steps you have done,
where the script came from, what kind of machine you're
running on, and so on.

At the very minimum we need to see what command(s) you ran.
You can see that the script uses the parameters "sel1" and "sel2"
to create its atom selections. If you provide invalid inputs for
sel1 or sel2, you will definitely get an error when using that script.

Best regards,
  John Stone
  vmd_at_ks.uiuc.edu

On Thu, Feb 06, 2020 at 06:31:06PM +0100, Viviane Corrêa wrote:
> Now the attachment...
> Em qui., 6 de fev. de 2020 Ã s 18:21, John Stone <[1]johns_at_ks.uiuc.edu>
> escreveu:
>
> Hi,
> Â There was no attachment on your posting.
> If the attachment is too big, the mailing list software will remove it
> to prevent it from creating trouble for recipients with small
> mailbox storage limits.
>
> Best regards,
> Â John Stone
> Â [2]vmd_at_ks.uiuc.edu
>
> On Thu, Feb 06, 2020 at 06:13:25PM +0100, Viviane CorrÄ*a wrote:
> > Hi,
> >
> > I'm trying to analyze the frequency of contacts between the protein
> and a
> > small molecule (residue 216). I'm using the attached script
> contactFreq.tcl
>
> --
> NIH Center for Macromolecular Modeling and Bioinformatics
> Beckman Institute for Advanced Science and Technology
> University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
> [3]http://www.ks.uiuc.edu/~johns/Â Â Â Â Â Â Phone: 217-244-3349
> [4]http://www.ks.uiuc.edu/Research/vmd/Â Â Â
>
> --
> Viviane Corrêa Santos, MSc
> Protein Computational Biology Group
> Departamento de BioquÃmica e Imunologia - ICB - UFMG
> [5]www.biocomp.icb.ufmg.br
>
> References
>
> Visible links
> 1. mailto:johns_at_ks.uiuc.edu
> 2. mailto:vmd_at_ks.uiuc.edu
> 3. http://www.ks.uiuc.edu/~johns/
> 4. http://www.ks.uiuc.edu/Research/vmd/
> 5. http://www.biocomp.icb.ufmg.br/biocomp/?page_id=232

> proc contactFreq { {sel1} {sel2} {percent 0} {outFile stdout} {mol top} } {
> if { $outFile != "stdout" } {
> set outFile [open $outFile w]
> }
> puts $outFile "[clock format [clock scan now]] Search started."
>
> set allAtoms {}
> set allCount {}
> set numberOfFrames [molinfo $mol get numframes]
> for { set i 0 } { $i < $numberOfFrames } { incr i } {
> molinfo $mol set frame $i
>
> set frameCount {}
> set frameAtoms [atomselect $mol "$sel1 and noh and within 4 of ($sel2 and noh)"]
> foreach {segid} [$frameAtoms get segid] {resname} [$frameAtoms get resname] {resid} [$frameAtoms get resid] {name} [$frameAtoms get name] {
> set atom [list $resid $resname $segid]
> if {[lsearch $frameCount $atom] != -1} continue
> 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) }]
> if { $fraction >= $percent } {
> puts $outFile [format "%s-%s-%s \t\t %.2f%%" [lindex $data 3] [lindex $data 2] [lindex $data 1] $fraction]
> }
> #set beta according to the fraction, this is optional
> set atom [atomselect $mol "segid [lindex $data 3] and resname [lindex $data 2] and resid [lindex $data 1]"]
> $atom set beta $fraction
> $atom delete
> }
>
> if { $outFile != "stdout" } {
> close $outFile
> }
>
> }
>

-- 
NIH Center for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
http://www.ks.uiuc.edu/~johns/           Phone: 217-244-3349
http://www.ks.uiuc.edu/Research/vmd/