From: Maxim Belkin (mbelkin_at_ks.uiuc.edu)
Date: Fri Sep 26 2014 - 09:33:45 CDT

Aref, VMD does not support varying number of particles in a trajectory. You have to make it constant between the frames (pdb files in your case). Simply determine the maximum number of particles in your pdb files, then add dummy atoms to pdb files that have fewer atoms. Put these dummy atoms either FAR-FAR away, or to the position of the last atom in that particular pdb. However, since you intend to do analysis, make sure that these dummy atoms are not included in it. To do that, mark them somehow, for example, set their beta/occupancy or user field to something unusual to other atoms and check that field during the analysis.
It all can be done, but depends on the level of your familiarity with VMD.

Maxim

On Sep 26, 2014, at 2:55 AM, Aref Takiden <aref.takiden_at_mailbox.tu-berlin.de> wrote:

> Hello all,
>
> @Dennis: sorry for the email yesterday X_x
> However, it didn’t worked either, i.e I got only the half of the frames in vmd in spite of that in the collective-pdbs file I find all gathered pdbs.
> The Code I used is:
>
> import re
> import os
>
> path = "choose the directroy you want" + "/"
>
> if os.path.exists(path+"collection"):
> os.remove(path+"collection")
> else:
> pass
>
> files = []
> for f in os.listdir(path):
> files.append(f)
>
> read = []
> #counter for the pdb-files
> i=0
> for f in files:
> # read each file
> inf = open(path+f,"r")
> for l in inf:
> if re.match(r'^ATOM\s+|^TER\s+',l,re.M):
> read.append(l)
> inf.close()
>
> # write each read file into the output-file
> ouf = open(path+"collection","a")
> ouf.write("MODEL "+str(i)+"\n")
> for l in read:
> ouf.write(l)
> ouf.write("ENDMDL\n")
> ouf.close()
> i += 1
>
> @Maxim: animatepdbs.tcl didn’t work. It seems that the number of the atoms has to be constant in the pdbs. However, in my case the atoms number is not constant.
>
> ERROR) Error reading optional structure information from coordinate file 4.pdb
> ERROR) Will ignore structure information in this file.
> Info) Using plugin pdb for coordinates from file 4.pdb
> ERROR) Incorrect number of atoms (26049) in
> ERROR) coordinate file 4.pdb
>
> Best regards,
> Aref
>
>
>
> On 24 Sep 2014, at 19:23, Dennis N Bromley <dbromley_at_uw.edu> wrote:
>
>> Hi Aref,
>>
>> Yes, that is all there is to it. You need to give it a model number so it will be
>>
>> MODEL 1
>> ATOM
>> ATOM
>> ATOM
>> ENDMDL
>> MODEL 2
>> ATOM
>> ATOM
>> ATOM
>> ENDMDL
>> ...
>>
>>
>> i have done this probably six different times using different tyools and languages. Works fine every time. The model numbers need to be sequential, though, and i think they need to start at 1. I currently have pdb files with hundreds of pdbs in them and they load up just fine in vmd.
>>
>> -denny-
>>
>>
>>
>>
>>
>> On Tue, Sep 23, 2014 at 12:08 AM, Aref Takiden <aref.takiden_at_mailbox.tu-berlin.de> wrote:
>> Hallo Denny,
>>
>> do you mean that in the end file I have something like:
>> MODEL
>> the body of my 1.pdb
>> ENDMDL
>> MODEL
>> the body of my 2.pdb
>> ENDMDL
>> and so on??
>>
>> Aref
>>
>>
>>
>>
>>
>>
>>
>> On 22 Sep 2014, at 19:52, Dennis N Bromley <dbromley_at_uw.edu> wrote:
>>
>>> I just use simple bash scripts to concatenate my pdb files together using the MODEL and ENDMDL tags. Works well in VMD although the frame numbers are the model numbers, so you need to convert those to trajectory times yourself (which is trivial if you are sampling every 10 ps or something).
>>> hope this helps
>>> -denny-
>>>
>>> On Mon, Sep 22, 2014 at 5:55 AM, Aref Takiden <aref.takiden_at_mailbox.tu-berlin.de> wrote:
>>> Hi,
>>>
>>> I would like to merge several pdb-files into one dcd-like-file, in such away, that at the end, I could see for example the changes in the bond length of the different snapshots(pdb-files) as a graph in the label-window of vmd.
>>>
>>> I tried the script animatepdbs.tcl (link: http://www.ks.uiuc.edu/Research/vmd/script_library/scripts/animatepdbs/animatepdbs.tcl), but it loaded only the first file in spit of that it read the names of the other files. I tested that by adding the command “puts $filename” at the end of the for-loop.
>>> So in other words I had only one frame in my main window of vmd.
>>>
>>> I am thankful for any help.
>>>
>>> Best regards,
>>>
>>> --
>>> M. Sc. Aref Takiden
>>> Technical University of Berlin
>>> Institute of Chemistry
>>> AG Mroginski
>>> Straße des 17. Juni 135
>>> D-10623 Berlin
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>