importnumpyasnpfromsimulariumioimportTrajectoryConverter,TrajectoryData,MetaData,AgentData,ScatterPlotDataconverter=TrajectoryConverter(TrajectoryData(meta_data=MetaData(box_size=BOX_SIZE_NUMPY_ARRAY,trajectory_title="Model A with parameter set 1",),agent_data=AgentData(DATA_FOR_OBJECTS_MOVING_OVER_TIME),))converter.add_plot(ScatterPlotData(title="Something measured",xaxis_title="Time (s) or something else",yaxis_title="Some measurement (units)",xtrace=X_VALUES_NUMPY_ARRAY,ytraces={"Agent 1":Y_VALUES_NUMPY_ARRAY,},))converter.save("output_file_name")
If ReaDDy trajectories will be converted, the ReaDDy python package must be installed:
(add conda forge channel if it’s not already: condaconfig--addchannelsconda-forge)
condainstallreaddy
Stable Release:pipinstallsimulariumio
Development Head:pipinstallgit+ssh://git@github.com/simularium/simulariumio.git
Please note that to run the Jupyter notebook examples you should also install Jupyter, either with pipinstalljupyter, or by installing SimulariumIO with the tutorial requirements: pipinstallsimulariumio[tutorial]
Install time depends on the speed of the connection and whether optional dependencies are included, but generally takes 30 seconds to a few minutes (see benchmarks for more details).
importnumpyasnpfromsimulariumio.readdyimportReaddyConverter,ReaddyData# see ReaDDy Tutorial for parameter detailsinput_data=ReaddyData(meta_data=MetaData(box_size=BOX_SIZE,),timestep=TIMESTEP,path_to_readdy_h5=PATH_TO_H5_FILE,)ReaddyConverter(input_data).save("output_file_name")
importnumpyasnpfromsimulariumioimportTrajectoryConverter,TrajectoryData,MetaData,AgentData# see Custom Data Tutorial for parameter detailsinput_data=TrajectoryData(meta_data=MetaData(box_size=BOX_SIZE,),agent_data=AgentData(times=TIMES,n_agents=N_AGENTS,viz_types=VIZ_TYPES,unique_ids=UNIQUE_IDS,types=TYPE_IDS,positions=POSITIONS,radii=RADII,rotations=ROTATIONS,))TrajectoryConverter(input_data).save("output_file_name")
importnumpyasnpfromsimulariumioimportScatterPlotDataconverter=TrajectoryConverter(input_data)# see above to create# see Plots Tutorial for parameter detailsconverter.add_plot(ScatterPlotData(title="Something measured",xaxis_title="Time (s) or something else",yaxis_title="Some measurement (units)",xtrace=X_VALUES,ytraces={"Agent 1":Y_VALUES,},))converter.save("output_file_name")
If you’d like to render agents as meshes instead of spheres, add a DisplayData for each agent type you’d like to be rendered with the mesh, and specify an OBJ mesh file. Alternately, you can provide a Protein Databank (PDB) file to render atoms for a molecule.
See the example notebook for the converter you are using to see how to add display data for that converter.
Conversion time depends on hardware, the size of the input data, and which converter is used, but generally takes between less than a minute and five minutes (see benchmarks for more details).
Drag the file output from SimulariumIO from your file browser onto the window or choose Load model > From your device, and select your file from the file upload dialogue.
If your trajectory uses local geometry files, like .obj or .pdb files, load them at the same time as you load your .simularium file, either by dragging and dropping a collection of files, or by choosing multiple files in the upload dialogue.
Currently the Viewer does not support loading folders of files, so make sure you are loading a collection of single files that does not include a folder. We’re working to improve this.
Upload your Simularium file to one of the supported public cloud providers, including Dropbox, Google Drive, or Amazon S3, and get a publicly accessible link to the file.
Choose Load model > From a URL. In the dialog, provide the URL to your .simularium file and choose Load.
If your file uses geometry files, like .obj or .pdb files, make sure you’ve provided the full public URL to the files in DisplayData.
Once the file is loaded, you can copy the page URL and share this link with collaborators or post it on your website so that others can interactively view your results.