Sometimes you want to remove specific atoms/molecules of the already runned IRC to perform, for instance, a pyfrag on the same geometries but without specific atoms/molecules for deeper analysis.
For example, in my research I want to remove the benzene molecule of each frame to perform a pyfrag with the LA-sub complex in the same geometry they will adopt when benzene is present. Yuman already wrote a script:
for file, atomnumbers in files:
with open(file) as origamv:
lines = origamv.readlines()
with open(os.path.split(file)[0] + '/molecule.xyz', 'w+') as out:
for i, line in enumerate(lines):
if line.startswith('Geometry'):
current_atom_index = 0
continue
current_atom_index += 1
if current_atom_index in atomnumbers:
continue
else:
out.write(line)
where in files = you can specify the path to the amv file, and the atomnumbers that need to be removed from each frame.
the new xyz-file wll be saved as molecule.xyz
It recognizes each block/frame by identifies that it starts with 'Geometry'
Sometimes you want to remove specific atoms/molecules of the already runned IRC to perform, for instance, a pyfrag on the same geometries but without specific atoms/molecules for deeper analysis.
For example, in my research I want to remove the benzene molecule of each frame to perform a pyfrag with the LA-sub complex in the same geometry they will adopt when benzene is present. Yuman already wrote a script:
import os
files = [ ('/Users/Tori/Dropbox/Work/Research/Friedel-Crafts/Data Alkylation/Manuscript effect Bulk/Me/IRCfor_MeCl-AlCl3.ams.amv', [5, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]), ]
for file, atomnumbers in files: with open(file) as origamv: lines = origamv.readlines()