simulariumio.smoldyn package¶
Submodules¶
simulariumio.smoldyn.smoldyn_converter module¶
- class simulariumio.smoldyn.smoldyn_converter.SmoldynConverter(input_data: SmoldynData, progress_callback: Callable[[float], None] | None = None, callback_interval: float = 10)[source]¶
Bases:
TrajectoryConverter
This object reads simulation trajectory outputs from Smoldyn (http://www.smoldyn.org) and plot data and writes them in the JSON format used by the Simularium viewer
- Parameters:
- input_dataSmoldynData
An object containing info for reading Smoldyn simulation trajectory outputs and plot data
- progress_callbackCallable [[float], None] (optional)
Callback function that accepts 1 float argument and returns None which will be called at a given progress interval, determined by callback_interval requested, providing the current percent progress Default: None
- callback_intervalfloat (optional)
If a progress_callback was provided, the period between updates to be sent to the callback, in seconds Default: 10
simulariumio.smoldyn.smoldyn_data module¶
- class simulariumio.smoldyn.smoldyn_data.SmoldynData(smoldyn_file: InputFileData, meta_data: MetaData | None = None, display_data: Dict[str, DisplayData] | None = None, time_units: UnitData | None = None, spatial_units: UnitData | None = None, plots: List[Dict[str, Any]] | None = None, center: bool = True)[source]¶
Bases:
object
This object holds simulation trajectory outputs from Smoldyn (http://www.smoldyn.org) and plot data
- Parameters:
- smoldyn_file: InputFileData
A InputFileData object containing the string path or string contents of the Smoldyn output txt file. Generate by adding to your config.txt file:
output_files output.txt `cmd n 1 executiontime output.txt cmd n 1 listmols output.txt
- meta_dataMetaData (optional)
An object containing metadata for the trajectory including box size, scale factor, and camera defaults
- display_data: Dict[str, DisplayData] (optional)
The particle type name from Smoldyn data mapped to display names and rendering info for that type, Default: for names, use Smoldyn name,
for radius, use 1.0, for rendering, use default representations and colors
- time_units: UnitData (optional)
multiplier and unit name for time values Default: 1.0 second
- spatial_units: UnitData (optional)
multiplier and unit name for spatial values (including positions, radii, and box size) Default: 1.0 meter
- plotsList[Dict[str, Any]] (optional)
An object containing plot data already in Simularium format
- centerbool (optional)
If true, the spatial values of the data are centered around the origin (0, 0, 0) during conversion Default: True
- center: bool¶
- display_data: Dict[str, DisplayData]¶
- classmethod from_dict(smoldyn_info: Dict[str, Any])[source]¶
Create SmoldynData from a simularium JSON dict
- Parameters:
- smoldyn_info: Dict[str, Any]
JSON dict containing values key value pairs representing the data to be turned into a SmoldynData object. JSON representation will be as defined in ui-templates/smoldyn_data.json
- plots: List[Dict[str, Any]]¶
- smoldyn_file: InputFileData¶