[ase-users] From CIF files to XYZ

Ask Hjorth Larsen asklarsen at gmail.com
Mon Dec 11 11:25:27 CET 2017


Hi,

The molecules are divided over the cell boundary.  This is a bit ugly,
but not wrong because it is just a displacement in a periodic cell.
If you repeat the cell, molecules will indeed appear 'correctly'
connected over the boundaries.  Unless there is some convention of the
cif specification about the origin of the structure, the conversion
appears to be correct in this case.  You can displace by (probably)
half the cell and re-wrap the positions to obtain a structure that is
valid without a repeated cell, but then that's a physically different
structure (molecule) than in the cif file (bulk).

Best regards
Ask

2017-12-11 10:58 GMT+01:00 Landi, Alessandro via ase-users
<ase-users at listserv.fysik.dtu.dk>:
> Hello.
>
>
> With "reconnected" I mean that the coordinates are consistent with entire
> molecules and not with fragments at distances greater than bond length.
>
>
> It's not a matter of ordering in the list of atoms, simply all the atoms
> constituting each molecule should be at a distance equal to bond length in
> the xyz file.
>
>
> If you try to open the two xyz files with a visualization software like
> Molden or VMD, you will see that, while "realstructure.xyz" shows two
> "connected" molecules, "pentacene.xyz" has isolated fragments which needs to
> be "reconnected", i.e. to be shifted to a distance equal to bond length, in
> order to reconstruct 2 molecules of pentacene.
>
>
> I hope to have made a clearer description of my problem.
>
>
> Best regards,
>
> Alessandro
>
>
>
> ________________________________
> Da: ase-users-bounces at listserv.fysik.dtu.dk
> <ase-users-bounces at listserv.fysik.dtu.dk> per conto di Eric Hermes via
> ase-users <ase-users at listserv.fysik.dtu.dk>
> Inviato: venerdì 8 dicembre 2017 19:08:01
> A: ase-users at listserv.fysik.dtu.dk
>
> Oggetto: Re: [ase-users] From CIF files to XYZ
>
> On Fri, 2017-12-08 at 18:48 +0000, Landi, Alessandro via ase-users
> wrote:
>> Hello.
>>
>> Obviously, I typed it wrong.
>>
>> Here the right command lines I use:
>>
>> atoms_ase=ase.io.read('filename.cif')
>> ase.io.write('filename.xyz', atoms_ase)
>>
>> Anyway, I have the problem that the xyz file is wrong as I explained
>> in my first e-mail: the molecules need to be reconnected (see files
>> attached).
>
> I don't understand what you mean by "reconnected". Neither xyz file
> that you uploaded contains any information regarding connectivity, and
> ASE doesn't have any conception of connectivity anyway (aside from a
> distance-based metric used in the ASE GUI to draw sticks between nearby
> atoms). The atom ordering produced by ASE is more consistent than the
> "realstructure.xyz" file as compared to the original cif ordering. It
> might be that whatever program you are using with the xyz files expects
> connected atoms to be contiguous; to the best of my knowledge this is
> not typical. If you want to ensure this ordering within ASE, you will
> need to manually rearrange the Atoms object.
>
> Eric
>
>>
>> "pentacene.cif" is the cif file that I give as input to ASE;
>> "pentacene.xyz" is the xyz file written by ASE;
>> "realstructure.xyz" is the structure of the reconnected molecules
>> (obtained using CCDC Mercury)
>>
>> Any suggestions?
>>
>> Best regards,
>> Alessandro
>>
>> Da: Oscar Xavier Guerrero <oscarxavier.ox at gmail.com>
>> Inviato: venerdì 8 dicembre 2017 18:36:10
>> A: Landi, Alessandro
>> Cc: ase-users at listserv.fysik.dtu.dk
>> Oggetto: Re: [ase-users] From CIF files to XYZ
>>
>> Hello,
>>
>> When you read the structure an Atoms object is created. You need to
>> store that object on a variable and then you can write that one. As
>> so:
>>
>> First read the data:
>> from ase.io import read, write
>> atoms = read('filename.cif')
>> Then write:
>> write('filename.xyz', atoms)
>> or you can use:
>> atoms.write('filename.xyz')
>>
>>
>>
>>
>> 2017-12-08 12:19 GMT+00:00 Landi, Alessandro via ase-users <ase-users
>> @listserv.fysik.dtu.dk>:
>> > Hello everyone.
>> >
>> > I am using ASE to read some CIF files and (among other things) to
>> > convert the structure in xyz format.
>> >
>> > However using the following commands:
>> >
>> > ase.io.read('filename.cif', atoms_ase)
>> > ase.io.write('filename.xyz', atoms_ase)
>> >
>> > I obtain a wrong structure, since the molecules need to be
>> > reconnected. This happens for all the molecules I have tested
>> > (about 20).
>> >
>> > Could you please explain me what I am doing wrong?
>> >
>> > If could be of any help, I attached an example:
>> > "pentacene.cif" is the cif file that I give as input to ASE;
>> > "pentacene.xyz" is the xyz file written by ASE;
>> > "realstructure.xyz" is the structure of the reconnected molecules
>> > (obtained using CCDC Mercury)
>> >
>> > Best regards,
>> > Alessandro
>> >
>> >
>> > _______________________________________________
>> > ase-users mailing list
>> > ase-users at listserv.fysik.dtu.dk
>> > https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
>> >
>>
>> _______________________________________________
>> ase-users mailing list
>> ase-users at listserv.fysik.dtu.dk
>> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
>
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
>
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users



More information about the ase-users mailing list