From: Mohsen Farshad (
Date: Sun Dec 27 2015 - 12:01:38 CST

Hi all,

In "Modeling Nanopores for Sequencing DNA" tutotial section 3-1-4- Generate
PSF file I could not run make-psf.tcl code. (error: can't read "all": no
such variable). I put the TCL code below, please let me know what is
problem with this code.

package require psfgen
topology top_all27_na.rtf
makingforeach chain [lsort -unique [$all get chain]] {
    set sel [atomselect top "chain $chain and name C1'"]
    set seg DNA$chain
    segment $seg {
    first 5TER
    last 3TER
    pdb dsdna_$chain.pdb
    foreach resid [$sel get resid] resname [$sel get resname] {
    if { $resname eq "THY" || $resname eq "CYT" } {
        patch DEO1 $seg:$resid
    } elseif { $resname eq "ADE" || $resname eq "GUA" } {
        patch DEO2 $seg:$resid
    coordpdb dsdna_$chain.pdb $seg
writepsf dsdna.psf
writepdb dsdna.pdb