SyMBac icon indicating copy to clipboard operation
SyMBac copied to clipboard

Position Shift on Symbac 2

Open kmpape opened this issue 2 years ago • 2 comments

Hello Georgeos,

I am about to push something, but before that I have a question:

https://github.com/georgeoshardo/SyMBac/blob/7b8244370f976a79d84f8b31dd53a2c49bba8df2/SyMBac/cell.py#L133 https://github.com/georgeoshardo/SyMBac/blob/7b8244370f976a79d84f8b31dd53a2c49bba8df2/SyMBac/cell.py#L134

Are you sure about the signs above? In my opinion, if the mother is kept at the top, new_x should have something subtracted and new_y something added. The other way around for the daughter.

Thanks!

kmpape avatar Jan 19 '24 18:01 kmpape

Sorry, my bad. I think that it should be

x_mother = self.position[0] - self.division_sign * self.length/2 *  np.cos(self.angle - np.pi/2)  
y_mother = self.position[1] + self.division_sign * self.length/2 *  np.sin(self.angle - np.pi/2)

assuming that self.angle starts at the horizontal axis.

I have now simplified some stuff on my end and will make a pull request some time next week. I added division_sign above so one can specify whether the mother should be on top or bottom. It only matters for something related to IDs, which will be contained in the pull request.

kmpape avatar Jan 19 '24 19:01 kmpape

Hi Idris, I think this can be a change which is made for the convenience of mother machine simulations, sure. Great that it's adjustable. The simulation is still stable yes? If we have a robust lineage tracking system then this will also help.

georgeoshardo avatar Jan 19 '24 19:01 georgeoshardo

Hi @kmpape

I finally fully realised why you want you want to do this while implementing some stuff to export lineages from the simulation as directed graphs, and maintaining constant mask ID during the simulation. Having the mother stay at the top keeps its mask constant, with each daughter gaining a new mask label. This will be in a commit today.

georgeoshardo avatar May 31 '24 09:05 georgeoshardo

Fixed in https://github.com/georgeoshardo/SyMBac/commit/a976458a4e3db5c293a2a6815803b705e7b42a9d!

georgeoshardo avatar May 31 '24 22:05 georgeoshardo

Thank you very much for this.

kmpape avatar Jul 15 '24 11:07 kmpape