Dear all,
I'm trying to convert a pdb trajectory file into a XYZ version to making compatible with another tool (not that it is important, but the tool is the ASE).
I've tried to write the file using the following code and in that case, I don't get any information about the unit cell
u = mda.Universe('MFI-pos-1.pdb', 'MFI-pos-1.pdb', format = 'CHEMFILES', guess_bonds= True, vdwradii=({'Si':2.1 , 'Al':1.84}))
atoms = u.select_atoms('all')
with mda.Writer('MFI_test.xyz', atoms.n_atoms) as W:
for ts in u.trajectory:
W.write(atoms)
I also tried using the chemfiles format:
u = mda.Universe('MFI-pos-1.pdb', 'MFI-pos-1.pdb', format = 'CHEMFILES', guess_bonds= True, vdwradii=({'Si':2.1 , 'Al':1.84}))
atoms = u.select_atoms('all')
with mda.Writer('MFI_Al_int_int_2TMPO_1site_AIMD_423-pos-1_test_chemfiles.xyz', atoms.n_atoms, format = 'CHEMFILES') as W:
for ts in u.trajectory:
W.write(atoms)
But in that case, I get a lot of unnecessary information that creates a conflict with ASE.
606
Lattice="20.078 0 0 0 19.894 0 0 0 26.744"
O 7.244 1.154 9.662 SYSTEM 0
O 2.792 18.68 2.964 SYSTEM 0
O 12.824 11.157 3.736 SYSTEM 0
O 17.233 8.855 10.424 SYSTEM 0
O 12.831 18.688 3.736 SYSTEM 0
O 17.241 1.138 10.47 SYSTEM 0
O 7.223 8.713 9.599 SYSTEM 0
....
If I convert it into this it works perfectly.
606
Lattice="20.078 0 0 0 19.894 0 0 0 26.744"
O 7.244 1.154 9.662
O 2.792 18.68 2.964
O 12.824 11.157 3.736
O 17.233 8.855 10.424
O 12.831 18.688 3.736
O 17.241 1.138 10.47
O 7.223 8.713 9.599
....
With all that said is there a way to write a XYZ trajectory file with the unit cell parameters? Or do you suggest using another file version? The pdb seems to be a no go for ASE.
Regards,
Carlos