David, thank you for your reply.
I like writing a python script to do this. And
I just got the code what I want from
http://www.rubor.de/bioinf/tips_python.html#chempy.
Model building becomes so easy when using chempy. But I can't get the
manual about chempy. So pity!
And Here is the partial code:
1 #!/usr/bin/python
2 import __main__
3 __main__.pymol_argv = ['pymol','-qc']
4
5 import sys
6 import pymol
7 from scipy import *
8 from chempy.models import Indexed
9 from chempy import Atom
10 from pymol import cmd
11
12 pymol.finish_launching()
............
47 ATOM=L*array(ATOM)
48 model = Indexed()
49 for i in ATOM:
50 at=Atom()
51 at.name = "C"
52 at.coord = list(i)
53 at.symbol = "C"
54 model.atom.append(at)
55 cmd.load_model(model,"CNT")
56 cmd.label("CNT","name")
57 cmd.save("Test.pdb")
On Wed, Mar 10, 2010 at 10:20 AM, David Hall <[email protected]> wrote:
> What are you using to create the xyz file (and why can that software
> not write a pdb)? The command you have below is pretty simple. An
> alternative is also the xyzpdb program that comes as part of tinker.
> ( eg: xyzpdb graphite.xyz charmm22.prm gives you graphite.pdb )
>
> -David
>
> On Tue, Mar 9, 2010 at 7:46 PM, Cun Zhang <[email protected]> wrote:
>> Hi,pymolers:
>> I want to create a pdb file for the structure of graphite. But my
>> method is a bit complex.
>> I create the xyz file,then call pymol to translate it into pdb format
>> with the command:
>> os.system('pymol -cd "load graphite.xyz;save graphite.pdb"')
>>
>> Is there any easy way to create pdb file with the information of
>> atoms' coordinates in pymol?
>>
>> Thank you!
>>
>>
>> Cun Zhang
>> Ph.D.Candidate
>> LNM, Institude of Mechanics
>> Chinese Academy of Sciences
>> Beijing 100190, China
>> Tel:86-10-82544204
>>
>> ------------------------------------------------------------------------------
>> Download Intel® Parallel Studio Eval
>> Try the new software tools for yourself. Speed compiling, find bugs
>> proactively, and fine-tune applications for parallel performance.
>> See why Intel Parallel Studio got high marks during beta.
>> http://p.sf.net/sfu/intel-sw-dev
>> _______________________________________________
>> PyMOL-users mailing list ([email protected])
>> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
>> Archives: http://www.mail-archive.com/[email protected]
>>
>
--
Blog: http://blog.4message.net
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
PyMOL-users mailing list ([email protected])
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/[email protected]