adelhpour / SBMLNetwork

SBMLNetwork is a library designed to enable software developers and systems biologists to interact with the graphical representation of SBML (Systems Biology Markup Language) models.
MIT License
0 stars 2 forks source link

Reaction Coordinates #60

Closed sanast22 closed 2 months ago

sanast22 commented 2 months ago

Is there a way to set the coordinates of an entire reaction? I'm using the setX() and setY() methods, and don't encounter any errors when passing a reaction ID and new coordinates to those methods. However, when I check the coordinates of the reaction, it always returns (0,0) for x and y. I'd like to move an entire reaction to a certain location in the network -- is this possible with the current methods, or do you have any suggestions? Thanks!

adelhpour commented 2 months ago

There is no such an option to move the entire reaction. My suggestion would be moving all the Species connected to a reaction and then the layout gets updated accordingly. Returning (0,0) for reaction coordinates must be a bug. I'll check to see what the reason for it is.

sanast22 commented 2 months ago

Is there a way to determine which species are connected to a reaction, if I just have the reaction name?

adelhpour commented 2 months ago

My suggestion would be iterating over the 'getNumSpeciesReferenceGlyphs' function and calling 'getSpeciesReferenceSpeciesId' function, which returns the id of the species connected to each speciesreference. This way you can collect the id of all the species in a reaction. Note that you need to set reaction_glyph_index = 0 and species_reference_glyph_index to the index of the iterator once you are calling 'getSpeciesReferenceSpeciesId' function.

sanast22 commented 2 months ago

Done, thanks! :)