From: Ashar Malik (
Date: Fri Apr 16 2021 - 05:31:31 CDT

Hi Francesco,

The error

vecsub: two vectors don't have the same size

is because the two compared entities $x and $y don't have the same number
of entries being compared.
For instance if you do (from

vecsub {10 9.8 7} {0.1 0 -0.1}

you will get

9.9 9.8 7.1

but if you do

vecsub {10 9.8 7} {}

>From what I recall, it will return the above error [vecsub: two vectors
don't have the same size].

Having said that a wild guess to what is causing your issue might be an
unbalanced selection.

Here is an example from my work where I encountered this error and how I
fixed it.

I was faced with this when I had a protein A and a modified version of
protein A - with the modification being just a slight change in
conformation. I wanted to compute the backbone deviation between the normal
and modified forms and I selected the backbone using the selection

"protein and name CA"

in one protein it selected all amino acids (as expected)

in the other protein the above selection picked all amino acids except one
residue (somewhere in the middle of the chain).

>From my two selections I was returning a list of residues and comparing
each lists's CAs with the other list's - since there was a one to one
correspondence between the lists.

There was one for loop, as the expected length of both the lists was the
same, and at the last iteration because one list was shorter compared to
the other I got the above error.

replacing the above selection

"protein and name CA"


"all and name CA"

as I only had 1-protein chain in my loaded molecule fixed the problem.

If possible you can look at your 30A cut and the selection it produces and
why exactly are you using vecsub and what is vecsub operating on and then
check where those are coming from - you should be able to identify the
cause of the error.

Hope the above example is of some help.
Sorry I couldn't give you an exact answer - but someone else might :)


On Fri, Apr 16, 2021 at 5:51 PM Francesco Pietra <>

> Hi all
> I am faced by the following error while executing autopsf with a
> nucleotide-protein system at the Guess/Spl;it Chains level (a 30A sphere
> cut around the small-molecule ligand)
> VMD 1.9.4a51
> vecsub: two vectors don't have the same size
> vecsub: two vectors don't have the same size
> while executing
> "vecsub $x $y"
> (procedure "vecdist" line 2)
> invoked from within
> "vecdist $Ccoords $Ncoords"
> (procedure "split_protein_and_water_pdb" line 250)
> invoked from within
> "split_protein_and_water_pdb "${basename}-temp.pdb""
> (procedure "::autopsf::aftersels_gui" line 55)
> invoked from within
> "::autopsf::aftersels_gui"
> invoked from within
> " invoke"
> ("uplevel" body line 1)
> invoked from within
> "uplevel #0 [list $w invoke]"
> (procedure "tk::ButtonUp" line 22)
> invoked from within
> "tk::ButtonUp"
> (command bound to event)
> I added the parameters for the ligand (which, for the ligand alone worked
> well, also for MD), and
> top_all36_cgenff.rtf
> top_all36_lipid.rtf
> top_all36_na.rtf
> top_all36_prot.rtf
> toppar_water_ions.str
> Then, with "Everything" selected I clicked on Guess and split chains,
> getting the above error.
> I found no errors in the pdb file with VMD Jmol CHIMERA. Histidine was
> assigned charmm names. Ligand pdb was in accordance with its psf/pdb. The
> only other hetero was MG.
> Thanks for any suggestion on what else I could check.
> francesco pietra
> I had a similar error in the past for another nucleotide-protein ensemble,
> but only for a sphere of 60A, while 30A - which went on without errors -
> was enough. I did not pursue that error further.