simularium / simulariumio

Python package that converts simulation outputs to the format consumed by the Simularium viewer website
Apache License 2.0
5 stars 3 forks source link

Help with MCell #161

Open corredD opened 11 months ago

corredD commented 11 months ago

Hi, thanks for the great library! I am trying to convert a MCell simulation to simularium. The documentation mention two input data, a json file and the folder holding the binary files of the simulation. I don't have any json file, only couples of .mdl so it would be great to adapt the tutorial depending on the input type available. I was still able to hack a json dictionary with the proper molecule list so I could run the converter. But it ran into an error at this line rotations = rotations.reshape(VALUES_PER_3D_POINT * n_mols) which should be replaced by rotations = rotations.reshape(n_mols, VALUES_PER_3D_POINT) After that I ran into some issues with the the length of the variable [result.times] (https://github.com/simularium/simulariumio/blob/d0452092fac539c0bbea7693744f8159a8140469/simulariumio/mcell/mcell_converter.py#L333). I added the following code to be able to continue :

            time_index = int(split_file_name[split_file_name.index("dat") - 1])
            if time_index > len(result.times):
                break
            if time_index > total_steps:
                total_steps = time_index
            result.times[time_index] = time_index * timestep

I could then convert my data, but after loading into the viewer, the data player doesn't appear and I cannot play the simulation. the files of the simulation were dumped every 5 frame, so they are named as follow : Scene.cellbin.000000.dat Scene.cellbin.000005.dat Scene.cellbin.000010.dat .... Scene.cellbin.062500.dat

Here is the simularium file I am suspecting it has something to do with the time_index but I am not sure how to proceed to fix the issue. Thanks a lot in advance