VMD-L Mailing List
From: John Stone (johns_at_ks.uiuc.edu)
Date: Thu Mar 23 2006 - 08:57:52 CST
- Next message: Chandra Ramananjara: "TCL scripting within NAMD Configuration File"
- Previous message: andrea spitaleri: "find neighbour ligand-protein"
- In reply to: andrea spitaleri: "find neighbour ligand-protein"
- Next in thread: John Stone: "Re: Analysis"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Hi,
I'd suggest changing the script so that you add each result to a list.
You can then use 'lsort -unique' to eliminate duplicates:
http://www.tcl.tk/man/tcl8.4/TclCmd/lsort.htm
John Stone
vmd_at_ks.uiuc.edu
On Thu, Mar 23, 2006 at 03:53:40PM +0100, andrea spitaleri wrote:
> Hi all,
> this is a script that I use for finding aa in contact with my ligand
> below a cutoff. It runs fine. However what I get is a list of resid and
> resname for each atom in contact with the ligand. In few words I get:
> 15,gly
> 15,gly
> 15,gly
> ... and so on.
> I would like to print out only once 15,gly (only the aa in contact and
> not the atoms)
> Any trick?
>
> thanks
>
> Regards
>
> andrea
>
> proc findneigh {cutoff} {
> set out [open neigh.out w]
> set nid [molinfo num]
> for {set i 0} {$i < $nid} {incr i} {
> puts "Reading molid $i ..."
> set clu [expr $i+1]
> puts $out "Cluster $clu ..."
> set nframes [molinfo $i get numframes]
> for {set j 0} {$j < $nframes } {incr j} {
> puts "\tReading frame $j ..."
> puts $out "Reading frame $j ..."
> set t [atomselect $i "(protein within $cutoff of segid B)"
> frame $j]
> foreach resid [$t get resid] resname [$t get resname] {
> puts $out $resid,$resname
> # puts $resid,$resname
> }
> }
> }
> close $out
> }
>
>
>
> --
> -------------------------------
> Andrea Spitaleri
> Dulbecco Telethon Institute
> c/o DIBIT Scientific Institute
> Biomolecular NMR, 1B4
> Via Olgettina 58
> 20132 Milano (Italy)
> -------------------------------
-- NIH Resource for Macromolecular Modeling and Bioinformatics Beckman Institute for Advanced Science and Technology University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801 Email: johns_at_ks.uiuc.edu Phone: 217-244-3349 WWW: http://www.ks.uiuc.edu/~johns/ Fax: 217-244-6078
- Next message: Chandra Ramananjara: "TCL scripting within NAMD Configuration File"
- Previous message: andrea spitaleri: "find neighbour ligand-protein"
- In reply to: andrea spitaleri: "find neighbour ligand-protein"
- Next in thread: John Stone: "Re: Analysis"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]