entities.OXDNA

entities.OXDNA(
    universe,
    name='NewOXDNAObject',
    world_scale=0.01,
    create_object=True,
)

A class to handle oxDNA trajectory data.

Parameters

Name Type Description Default
universe MDAnalysis.Universe The MDAnalysis Universe object containing the trajectory data required
world_scale float Scaling factor for the world coordinates, by default 0.01 0.01

Attributes

Name Type Description
_entity_type EntityType Type of the molecular entity
_att_names tuple Names of the attributes to track

Methods

Name Description
add_style Add a visual style to the trajectory.
create_object Create and initialize Blender object for trajectory.
get_view Get the 3D bounding box of a selection within the trajectory
reset_playback Set the playback settings to their default values

add_style

entities.OXDNA.add_style(
    style='spheres',
    color='common',
    selection=None,
    material=None,
    name=None,
)

Add a visual style to the trajectory.

Parameters

Name Type Description Default
style bpy.types.GeometryNodeTree | str The style to apply to the trajectory. Can be a GeometryNodeTree or a string identifying a predefined style (e.g., “spheres”, “sticks”, “ball_stick”). Default is “spheres”. 'spheres'
color str | None The coloring scheme to apply. Can be “common” (element-based coloring), “chain”, “residue”, or other supported schemes. If None, no coloring is applied. Default is “common”. 'common'
selection str | AtomGroup | None Apply the style only to atoms matching this selection. Can be: - A string referring to an existing boolean attribute on the trajectory - A AtomGroup object defining a selection criteria - None to apply to all atoms (default) None
material bpy.types.Material | str | None The material to apply to the styled atoms. Can be a Blender Material object, a string with a material name, or None to use default materials. Default is None. None
name str | None The label for this style None

Returns

Name Type Description
Trajectory Returns self for method chaining.

Raises

Name Type Description
ValueError If an unsupported style string is passed

Notes

If a selection is provided, it will be evaluated and stored as a new named attribute on the trajectory with an automatically generated name (sel_N).

create_object

entities.OXDNA.create_object(name='NewUniverseObject')

Create and initialize Blender object for trajectory.

Creates mesh, computes attributes, sets up modifiers, registers with MolecularNodes.

Parameters

Name Type Description Default
name str Name for the Blender object "NewUniverseObject"

Returns

Name Type Description
bpy.types.Object Created Blender object

get_view

entities.OXDNA.get_view(selection=None, frame=None)

Get the 3D bounding box of a selection within the trajectory

Parameters

Name Type Description Default
selection str | AtomGroup A selection phrase or AtomGroup When not specified, the whole entity is considered None
frame int | None Frame number of trajectory to use for calculating bounds. When not specified, current trajectory frame is used None

reset_playback

entities.OXDNA.reset_playback()

Set the playback settings to their default values