From: Thomas Griffiths (
Date: Thu Sep 15 2016 - 20:56:49 CDT

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

When I try to include a pbc wrap from the pbc tools package the script
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
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
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
chains are in the same central image before I do an RMS alignment.

Thanks for any help, apologies for the longer email.


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

# Quit VMD when done with calculation incase I forget the -e

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