From: Thomas Griffiths (tmg994_at_uowmail.edu.au)
Date: Fri Sep 16 2016 - 23:28:34 CDT

Dear All,

I've done some more tinkering and I've fixed the problem myself. I've
included the solution below in case it's useful to anyone who comes across
this issue too.

I found that the pbc wrap command contains an animate command to rewind
back to the frame you started on. If you comment out the line containing
the animate command in pbcwrap.tcl in your VMD installation the problem is
fixed.

I.e. in Contents/vmd/plugins/noarch/tcl/pbctools2.8/pbcwrap.tcl put a '#'
in front of 'animate'

    # Rewind to original frame
    if { $verbose } then { vmdcon -info "Rewinding to frame $frame_before."
}
   # animate goto $frame_before
    }

This of course removes the rewind functionality from your version of
pbctools. This is also a problem if you're using VMD on a machine where you
don't have permissions to modify any files associated with VMD. To fix both
of these issues I've implemented a -bigdcd flag into a local version of
pbctools which is loaded instead of the distributed version. You can find
the custom version at https://github.com/tmgriffiths/pbctools. The -bigdcd
flag for pbc wrap is identical to -now, but skips pbc wrap's internal
animate command.

To use your own customised version of a package you'll need to place a
version of the package somewhere on your system that you can access (I use
$HOME/bin/vmd) and add the following line to your .vmdrc file:

   set auto_path [linsert $auto_path 0 [file join
$env(HOME)/path/to/your/version]]

This command places $HOME/path/to/your/version at the beginning of
$auto_path ensuring your version of pbctools (or any other package) will be
found first and take preference over the distributed version.

I've also made a pull request on the pbctools development site (
https://github.com/frobnitzem/pbctools/pull/4
<https://github.com/frobnitzem/pbctools/pull/4)>) that incorporates all my
changes. Hopefully they can be incorporated into the new version ready for
distribution with VMD 1.9.3.

Cheers,

Tom.

On 16 September 2016 at 11:56, Thomas Griffiths <tmg994_at_uowmail.edu.au>
wrote:

> Dear VMD users,
>
> I'm having issues combining pbc wrap with bigdcd. I have a script that
> I've
> been using to do time-course data of some molecular dynamics simulations
> that
> uses bigdcd to read in the trajectories. I do the fairly standard thing of
> defining a procedure (see script below) then calling it with bigdcd.
>
> bigdcd myproc dcd inputfile.dcd
> bigdcd_wait
>
> When I try to include a pbc wrap from the pbc tools package the script
> fails
> and get the following error.
>
> bigdcd aborting at frame 2
> measure fit: no atom selection
>
> I've done some testing and only the pbc wrap seems to be causing the
> issue.
> neither the pbc get or pbc set cause the issue and if the pbc wrap command
> is
> commented out the script works fine. What seems to be happening is the RMS
> align and bigdcd are moving onto the next frame happens before pbc wrap is
> finished. When I include a bunch of puts after each step the become out of
> order in the output of the script. I've put the output below along with a
> minimal working example that produces the error.
>
> I've tried fixing what appears to be the script outrunning itself by
> including
> some delay with a wait command, an after command and then defining another
> mywait proc, none of which worked.
>
> Up to now I've been able to get away without a PBC wrap but now i'm
> analysing a
> multimeric system and have to include a PBC wrap in there to make sure all
> the
> chains are in the same central image before I do an RMS alignment.
>
> Thanks for any help, apologies for the longer email.
>
> Tom.
>
> Minimal script
> --------------
> source bigdcd.tcl
> package require pbctools
>
> # Variables
> set refcoor [mol new ../../setup/1NP9_41_1_ionised.pdb]
> set allRef [atomselect $refcoor "nucleic and not hydrogen"]
> set mol [mol new ../../setup/1NP9_41_1_ionised.psf]
>
> proc mywait { waitTime } {
> set startWaitTime [clock seconds]
> while {[expr [clock seconds] - $startWaitTime < $waitTime]} {
> }
> }
>
> proc myrmsd { frame } {
> global all allRef allSel mol i startTime
>
> set allSel [atomselect $mol "nucleic and not hydrogen"]
> set all [atomselect $mol all]
>
> puts "frame: $frame"
>
> set cell [pbc get -molid $mol -now]
> puts "pbc get worked. frame at pbc get: $frame"
>
> pbc set $cell -molid $mol -now
> puts "pbc set worked. frame at pbc set: $frame"
>
> # Removing (commenting out will do) the pbc wrap fixes the issue.
> # But it is then not pbc wrapped obviously.
> pbc wrap -molid $mol -center com -centersel "nucleic and chain A"
> -compound residue -all
> puts "frame at pbc wrap: $frame"
>
> # These methods didn't work...
> # after 1000
> # mywait
>
> # Align to all the DNA first
> $all move [measure fit $allSel $allRef]
>
> # Measure RMSD of nucleotides
> puts "$frame [measure rmsd $allSel $allRef]"
> puts "frame at alignment: $frame"
> puts ""
> }
>
> # first and last dcd files
> set startTime 1
> set endTime 1
> set i 1
>
> for { set i $startTime } { $i <= $endTime } { incr i } {
> bigdcd myrmsd dcd ../../files/${i}_1NP9_41_1_a.dcd
> bigdcd_wait
> }
>
> # Quit VMD when done with calculation incase I forget the -e
> quit
>
>
> Output
> ------
> trimmed...
> dcdplugin) detected standard 32-bit DCD file of native endianness
> dcdplugin) CHARMM format DCD file (also NAMD 2.1 and later)
> Info) Using plugin dcd for coordinates from file
> ../../files/1_1NP9_41_1_a.dcd
> frame: 1
> pbc get worked. frame at pbc get: 1
> pbc set worked. frame at pbc set: 1
> Info) 100.0% complete (frame 0)
> frame: 2
> pbc get worked. frame at pbc get: 2
> pbc set worked. frame at pbc set: 2
> Info) 100.0% complete (frame 0)
> frame at pbc wrap: 2
> 2 0.51823681592941284
> frame at alignment: 2
>
> frame at pbc wrap: 1
> bigdcd aborting at frame 2
> measure fit: no atom selection
> bigdcd_done
> after#0
> Info) VMD for MACOSXX86, version 1.9.2 (December 29, 2014)
> Info) Exiting normally.
>
>
> System details
> --------------
> VMD 1.9.2
> pbctools -- version 2.8
> bigdcd.tcl -- version 2.0
>
>
> --
>
>
>
>
>
> *Thomas GriffithsPhD CandidateSchool of Chemistry | Faculty of Science
> Medicine & HealthUniversity of Wollongong NSW 2522 Australia*
>
>

-- 
*Thomas GriffithsPhD CandidateSchool of Chemistry | Faculty of Science
Medicine & HealthUniversity of Wollongong NSW 2522 AustraliaAcademic Senate
– Postgraduate MemberScience Medicine & Health – Postgraduate
RepresentativeT +612 4221 3559 | M +614 1527 1006uow.edu.au
<http://www.uow.edu.au/science/chem/>*
University of Wollongong CRICOS: 00102E
NOTICE: This email is intended for the addressee named and may contain
confidential information. If you are not the intended recipient, please
delete it and notify the sender. Please consider the environment before
printing this email.