From: pl (
Date: Tue Nov 09 2004 - 05:52:51 CST

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