The traj module

This module contains some high-level utility functions that are directly written in Python and serve the purpose of streamlining the creation and use of trajectory objects.

LAMMPSTrajectory

Create and return a LAMMPS trajectory.

OxDNATrajectory

Create and return an oxDNA trajectory.

baggianalysis.traj.LAMMPSTrajectory(data_file=None, atom_style=None, type='Full', filters=[])

Create and return a LAMMPS trajectory.

The resulting trajectory needs to be explicitly initialised by the user with one of BaseTrajectory’s initialise_from_* methods.

Parameters
  • data_file (str) – The name of an optional data file that will be used to initialise the trajectory’s frames. This is useful if the LAMMPS dump files do not contain all the information (e.g. charges) or if you want frames to also store the particle connectivity (e.g. bonds, angles and dihedrals).

  • atom_tyle (str) – The atom style of the data file. Note that this parameter is required if data_file is not None.

  • type (str) – The type of trajectory, which should be either “Lazy” or “Full” (for LazyTrajectory and FullTrajectory, respectively)’.

  • filters (list) – A list of filters that should be added to the trajectory. Note that the order counts, since filters are applied on a first-come first-served basis.

Returns

A trajectory object. Note that the trajectory as returned by this function still requires initialisation through one of BaseTrajectory’s initialise_from_* methods.

Return type

LazyTrajectory or FullTrajectory

baggianalysis.traj.OxDNATrajectory(topology_file, type='Full', filters=[])

Create and return an oxDNA trajectory.

The resulting trajectory needs to be explicitly initialised by the user with one of BaseTrajectory’s initialise_from_* methods.

Parameters
  • topology_file (str) – The topology file associated to the oxDNA trajectory.

  • type (str) – The type of trajectory, which should be either “Lazy” or “Full” (for LazyTrajectory and FullTrajectory, respectively)’.

  • filters (list) – A list of filters that should be added to the trajectory. Note that the order counts, since filters are applied on a first-come first-served basis.

Returns

A trajectory object. Note that the trajectory as returned by this function still requires initialisation through one of BaseTrajectory’s initialise_from_* methods.

Return type

LazyTrajectory or FullTrajectory