VMD-L Mailing List
From: Aref Takiden (aref.takiden_at_mailbox.tu-berlin.de)
Date: Fri Sep 26 2014 - 02:55:30 CDT
- Next message: Axel Kohlmeyer: "Re: create bonds with uniform pairwise cut off radius for XYZ trajectories."
- Previous message: khannan krishna: "create bonds with uniform pairwise cut off radius for XYZ trajectories."
- Maybe in reply to: Maxim Belkin: "Re: merging several pdbs in one file"
- Next in thread: Maxim Belkin: "Re: merging several pdbs in one file"
- Reply: Maxim Belkin: "Re: merging several pdbs in one file"
- Reply: Dennis N Bromley: "Re: merging several pdbs in one file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
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
>>
>>
>>
>>
>>
>>
>>
>>
>
>
- Next message: Axel Kohlmeyer: "Re: create bonds with uniform pairwise cut off radius for XYZ trajectories."
- Previous message: khannan krishna: "create bonds with uniform pairwise cut off radius for XYZ trajectories."
- Maybe in reply to: Maxim Belkin: "Re: merging several pdbs in one file"
- Next in thread: Maxim Belkin: "Re: merging several pdbs in one file"
- Reply: Maxim Belkin: "Re: merging several pdbs in one file"
- Reply: Dennis N Bromley: "Re: merging several pdbs in one file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]