Skip to content

Adding auxiliary information to trajectory #785

@richardjgowers

Description

@richardjgowers

Original started on discussion board

It would be nice if we could add arbitrary data to run alongside a trajectory, so..

u = mda.Universe('this', 'that')
u.trajectory.add_auxiliary('some.file')

for ts in u.trajectory:
    print ts.stuff_from_file

I think the best route might be adding in the hooks after a Timestep has been read, so

def _read_next_timestep(self):
    ts = self._read_timestep()
    for aux in self._auxiliaries:
        aux.read_next(ts)
    return ts

So each aux object is like a mini Reader object, which augments a trajectory Reader.

In the longer term, it would be cool if u.trajectory.add_auxiliary(PullForce('pull.xvg')), then made AtomGroup.pullforce a viable attribute, this should be possible with the new dynamic classes + transplant system.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions