dynsight.trajectory.Trj¶
- class dynsight.trajectory.Trj(universe, trajslice=None)[source]¶
Contains a trajectory.
- Parameters:
universe (Universe)
trajslice (slice | None)
- universe¶
a MDAnalysis.Universe containing the trajectory.
- Type:
MDAnalysis.core.universe.Universe
Warning
This class is under development. The name and type of the “universe” attribute may change in the future.
Methods
Save an .xyz file with the labels for each atom.
Save an .xyz file with the insights values for each atom.
Compute coordination number on the trajectory.
Returns the coordinates as an array.
Compute LENS on the trajectory.
Compute the magnitude of the orientational order parameter.
Compute the radial distribution function g(r).
Returns a Trj with a subset of frames.
Compute SOAP on the trajectory.
Compute SOAP and then timeSOAP on the trajectory.
Compute the average velocity alignment.
Initialize Trj object from MDAnalysis.Universe.
Initialize Trj object from .gro and .xtc files.
Initialize Trj object from .xyz file.
Returns a Trj with a different frames' slice.
Attributes
trajslicen_atomsn_frames- dump_colored_trj(labels, file_path)[source]¶
Save an .xyz file with the labels for each atom.
The output file has columns: atom_type, x, y, z, label.
- Parameters:
labels (NDArray[np.int64])
file_path (Path)
- Return type:
None
- dump_xyz_with_insight(insight_list, file_path)[source]¶
Save an .xyz file with the insights values for each atom.
The output file has columns: atom_type, x, y, z, ins_1, ins_2, …
- get_coord_number(r_cut, centers='all', selection='all', respect_pbc=True, neigcounts=None, n_jobs=1)[source]¶
Compute coordination number on the trajectory.
- Returns:
- neighcounts: a list[list[AtomGroup]], it can be used to
speed up subsequent descriptors’ computations.
- An Insight containing the number of neighbors. It has the
following meta: name, r_cut, centers, selection.
- Return type:
- Parameters:
- get_coordinates(selection)[source]¶
Returns the coordinates as an array.
The array has shape (n_frames, n_atoms, n_coordinates).
- Parameters:
selection (str)
- Return type:
NDArray[np.float64]
- get_lens(r_cut, delay=1, centers='all', selection='all', respect_pbc=True, n_jobs=1)[source]¶
Compute LENS on the trajectory.
- get_orientational_op(r_cut, order=6, centers='all', selection='all', respect_pbc=True, neigcounts=None, n_jobs=1)[source]¶
Compute the magnitude of the orientational order parameter.
- Returns:
- neighcounts: a list[list[AtomGroup]], it can be used to
speed up subsequent descriptors’ computations.
- An Insight containing the orientational order parameter.
It has the following meta: name, r_cut, order, centers, selection.
- Return type:
- Parameters:
- get_rdf(distances_range, s1='all', s2='all', exclusion_block=None, nbins=200, norm='rdf')[source]¶
Compute the radial distribution function g(r).
See https://docs.mdanalysis.org/1.1.1/documentation_pages/analysis/rdf.html.
- get_slice(start, stop, step)[source]¶
Returns a Trj with a subset of frames.
Warning
This function could fill up the memory in case of large trajectories and it’s deprecated. Use Trj.with_slice() instead.
- get_soap(r_cut, n_max, l_max, selection='all', centers='all', respect_pbc=True, n_jobs=1)[source]¶
Compute SOAP on the trajectory.
The returned Insight contains the following meta: name, r_cut, n_max, l_max, respect_pbc, selection, centers.
- get_timesoap(r_cut=None, n_max=None, l_max=None, soap_insight=None, selection='all', centers='all', respect_pbc=True, n_jobs=1, delay=1)[source]¶
Compute SOAP and then timeSOAP on the trajectory.
The returned Insights (soap and timesoap) contain the following meta: name, r_cut, n_max, l_max, respect_pbc, selection, centers. Regarding the timeSOAP Insight, the delay used is also included.
- get_velocity_alignment(r_cut, centers='all', selection='all', respect_pbc=True, neigcounts=None, n_jobs=1)[source]¶
Compute the average velocity alignment.
- Returns:
- neighcounts: a list[list[AtomGroup]], it can be used to
speed up subsequent descriptors’ computations.
- An Insight containing the average velocities alignment.
It has the following meta: name, r_cut, centers, selection.
- Return type:
- Parameters:
- classmethod init_from_universe(universe)[source]¶
Initialize Trj object from MDAnalysis.Universe.
- Parameters:
universe (Universe)
- Return type:
- classmethod init_from_xtc(traj_file, topo_file)[source]¶
Initialize Trj object from .gro and .xtc files.
- Parameters:
traj_file (Path)
topo_file (Path)
- Return type: