biocore / LabControl

lab manager for plate maps and sequence flows
BSD 3-Clause "New" or "Revised" License
2 stars 15 forks source link

Enforce correct order of plates in "Compress gDNA plates" interface #325

Closed AmandaBirmingham closed 6 years ago

AmandaBirmingham commented 6 years ago

If one goes to the plate list and clicks on the eye icon for a compressed gDNA plate, one is taken to the "Compress gDNA plates" interface, which displays the gDNA plates that were aggregated onto that compressed gDNA plate. The order in which the plates are displayed on the screen is the ONLY way for the user to find out, from the Labman GUI, which plates were placed where on the compressed plate. The order MUST BE as follows:

1) the top-left-most plate (original wells transferred into A1, C1, E1, G1, I1, K1, M1, O1, A3, C3, etc) 2) the top-right-most plate (original wells transferred into A2, C2, E2, G2, I2, K2, M2, O2, A4, C4, etc) 3) the bottom-left-most plate (original wells transferred into B1, D1, F1, H1, J1, L1, N1, P1, B3, D3, etc) 4) the bottom-right-most plate (original wells transferred into B2, D2, F2, H2, J2, L2, N2, P2, B4, D4, etc)

However, currently the interface displays the plates in random order that sometimes differs between page accesses for the same plate, as shown by these two screenshots of the interface for the same test plate, taken 3 minutes apart:

screen shot 2018-08-14 at 5 37 37 pm screen shot 2018-08-14 at 5 40 20 pm
AmandaBirmingham commented 6 years ago

Further detail from debugging: The back-end is returning the plates in the correct order (which is the order specified by the user when they did the original compression, and can be completely arbitrary), as shown in this code:

https://github.com/jdereus/labman/blob/e2f837073dff972445212364cc217dd8f4659109/labman/db/process.py#L750-L774

However, the front end receives this information and then does an additional query to get more info about the plates:

https://github.com/jdereus/labman/blob/e2f837073dff972445212364cc217dd8f4659109/labman/gui/templates/compression.html#L14-L18

https://github.com/jdereus/labman/blob/e2f837073dff972445212364cc217dd8f4659109/labman/gui/templates/compression.html#L68-L79

I believe that the get done in addPlate is asynchronous, and so any plate can end up returning its result first, and this is why the order in which the plates are added to the interface is not necessarily correct.