From: John Stone (johns_at_ks.uiuc.edu)
Date: Thu Nov 11 2004 - 10:39:11 CST

Hi,
  There are some inconsistencies in the script you provided.
Why are you doing atom selectionsin the foreach loop?
You're not using the results from the atom selection for anything?
$sel1, $sel2, $sel3 aren't used anywhere?

The "writepdb" feature is a function of an atom selection, so you'd
need to use something like $sel1 writepdb foo.pdb or something like that.

If you want a list of integers from an atom selection, you'd do
  $sel1 list

It isn't clear to me what you're actually trying to get out of all
of this, are you trying to get a PDB file, or just a text file containing
a list of integers?

  John Stone
  vmd_at_ks.uiuc.edu

On Tue, Nov 09, 2004 at 12:52:51PM +0100, pl wrote:
> Hi all,
> I want to use the writepdb function to save a list of selected
> atoms. To my understanding writepdb needs a list of integers and
> my list is text. This list was created using the 'measure hbond'
> command like this:
>
> set hblist [measure hbonds $cutoff $angle $DNA $WAT]
> set atom1 {}
> set atom2 {}
> set atom3 {}
> foreach atom1 [lindex $hblist 0] atom2 [lindex $hblist 1] atom3 [lindex
> $hblist 2] {
> set sel1 [atomselect top "index $atom1"]
> set sel2 [atomselect top "index $atom2"]
> set sel3 [atomselect top "index $atom3"]
> lappend pdblist $atom1
> lappend pdblist $atom2
> lappend pdblist $atom3
> }
>
> Now I want to throw this pdblist into a file using writepdb:
>
> $pdblist writepdb my_file.pdb
>
> As I said, this does not work as $pdblist cantains text and not
> a list of integer.
> How do I turn my list into integers. This is a dumb tcl question, boy
> how I hate this language....
>
> Bye
>

-- 
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