[Chimera-users] importing xyz file

Conrad Huang conrad at cgl.ucsf.edu
Wed Jan 13 11:21:56 PST 2016


Attached is a Chimera script that you can open immediately after opening 
your XYZ file.  It connects consecutive "atoms" in the last opened 
model.  You can even use it on the command line like:

	chimera methane.xyz connectxyz.py

Obviously something bad may happen if there is already connectivity 
within the model.

Conrad

On 1/13/2016 9:58 AM, Elaine Meng wrote:
> Hello Michał,
> The XYZ format does not specify bonds directly.  Normally if the points are atoms with reasonable bond lengths, Chimera can guess where the bonds are based on the elements and coordinates.  If they are not atomic structures and the bonds are of arbitrary length, here are some possibilities of what you could do:
>
> (1) after reading in the XYZ file, add bonds manually yourself, for example, select two “atoms” (Ctrl-click, Shift-Ctrl-click) and then use command “bond sel”.  Repeat.  This could be tedious if you have a lot of bonds to add.  You could also use atom names instead of selecting, for example “bond @c1,c2”.  Although the XYZ file doesn’t contain atom names, “atoms” of the same “element” will be named in Chimera according to element with a sequential number appended (the first C is named C1, the second C is named C2, etc.).
> <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/xyz.html>
>
> - OR -
>
> (2) convert XYZ file into some other format that specifies bonds, for example a PDB file with CONECT lines.
> <http://www.wwpdb.org/documentation/file-format-content/format33/v3.3.html>
> This would also take some effort to script a process (which could involve other people’s programs, say Babel to convert to PDB but then you would still need to add your CONECT lines), but once you had that done, it could be applied to a large file or multiple files.
>
> I hope this helps,
> Elaine
> -----
> Elaine C. Meng, Ph.D.
> UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab
> Department of Pharmaceutical Chemistry
> University of California, San Francisco
>
> On Jan 13, 2016, at 6:28 AM, Michał Kadlof <m.kadlof at cent.uw.edu.pl> wrote:
>
>> Hello,
>> I would like to visualize in chimera objects (not exactly atoms) from my XYZ file. I can import them ans see as scattered balls but I would like to see them connected to each other in order that they are appear in file. The distances are much larger than usual inter atoms interactions. Is it possible?
>> --
>> best
>> Michał Kadlof
>
>
> _______________________________________________
> Chimera-users mailing list
> Chimera-users at cgl.ucsf.edu
> http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: connectxyz.py
Type: text/x-python
Size: 126 bytes
Desc: not available
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20160113/414b6d8c/attachment.py>


More information about the Chimera-users mailing list