From: Karl Lundquist (klundquist_at_gatech.edu)
Date: Mon May 19 2014 - 11:15:28 CDT

Hi John,

Thank you for the response. I am running Linux. I was able to solve the
problem, but I'm still not exactly sure why it was happening. When I was
having the issue, I was sourcing the script from the Tk console of VMD. I
think you were right that it was an issue with closing the file properly,
since the file was no longer truncated after I closed VMD. When I ran the
script directly from the terminal using the "vmd -dispdev text -e
script.tcl" command, the problem went away.

Thanks again for your insight,
Karl

On Fri, May 16, 2014 at 11:15 AM, John Stone <johns_at_ks.uiuc.edu> wrote:

> What operating system are you running? This sounds like something
> that might occur on MS Windows when files are opened as text rather than
> binary, for example. It does seem like you're closing the file properly
> which
> would be the usual cause of truncation, so this leaves OS-specific causes
> as my best guess at the moment.
>
> Cheers,
> John Stone
> vmd_at_ks.uiuc.edu
>
> On Thu, May 15, 2014 at 03:13:58PM -0400, Karl Lundquist wrote:
> > Hi all,A
> > I am attempting to make an index file to use with catdcd to wrote only
> > certain atoms to my dcd files. Below is a copy of my script:A
> > package require psfgen
> >
> > set infile ../2014-5-01-run/ionizedkcl
> > set seltext "(resname AHEP AGLC AKDO AGAL or (chain L and name N P
> O11 O12
> > O13 O14 C11 C12 HN1 HN2 HN3 H11A H11B H12A H12B))"
> > set newpsf headsonly
> >
> > readpsf $infile.psf
> > coordpdb $infile.pdb
> >
> > mol load psf $infile.psf pdb $infile.pdb
> >
> > set all [atomselect top "all"]
> >
> > set sel1 [atomselect top $seltext]
> >
> > set selnot [atomselect top "not $seltext"]
> >
> > set indices [$sel1 get index]
> >
> > set file [open findexfile.ind w]
> >
> > foreach var $indices {
> > A A A puts $file $var
> > }
> >
> > flush $file
> > close $file
> >
> > foreach segid [$selnot get segid] resid [$selnot get resid] atomname
> > [$selnot get name]
> > {
> > A A A delatom $segid $resid $atomname
> > }
> >
> > writepsf $newpsf.psf
> >
> > exit
> >
> > The problem I'm having is that not all of the indices are printed to
> > findexfile.ind. It gets cut off after the first 6000 or so entries.
> > However, when I put these commands line by line into the VMD
> tkconsole,
> > the command "puts $indices" prints them all without any issue. Anyone
> have
> > any insight as to why this might be happening?
> >
> > Thanks,
> > Karl
>
> --
> 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/
>