fast_forward.ndx_parser module

fast_forward.ndx_parser.ndx_to_ag(atoms_or_universe, infile)[source]

Create MDAnalysis AtomGroups from a Universe and an index file.

Examples

u = mda.Universe(TPR, XTC)
with open('index.ndx') as infile:
    for group_name, atom_group in ndx_to_ag(u, infile):
        print(group_name, atom_group)
Parameters:
  • atoms_or_universe (Universe or AtomGroup) – The atoms to select from.

  • infile (str) – The open index file to read.

Yields:
  • group_name (str) – The name of the group as written in the index file.

  • atoms (AtomGroup) – An atom group containing the atoms for that group.