New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix #10564: include wells in plate run processing #1430
Conversation
Actually, I don't like this at all: I think that we might have to include the extra stuff (well reagent, etc.) on the paths in the |
This might be interesting to try. |
I've attached In testing, watch out for what should or shouldn't be left behind in the database. For instance, after deleting all the plates, is any of the plate stuff (reagents, whatever) wrongly left in a table? Or, after deleting just a run or two, did something else get screwed up? Also try out things like moving plates between groups to check for any regressions. |
Imported into private group...
After import I have:
Selected both screens and tried to move to a read-annotate group in Insight - failed. Blitz log has
Tried to delete the plate that is in 2 screens. Deleted OK in Insight.
At this stage DB looks like:
After deleting the only Run in the remaining Plate (OK in Insight) this doesn't delete any more wells but some wellsamples go:
Oooop, just realised I'm supposed to be deleting as NON-owner (all above was as owner). |
Actually, it seems that the final Run delete above didn't delete the Run. Tried deleting the Plate in Insight (OK) and now everything apart from the 2 screens are gone from the DB. |
Re-imported again (private group)...
And tried to delete 'run' 56 as "root". This worked (row disappeared from DB) and 4 images were deleted from DB, but now in web when I try to access the Plate from that 'run' (Plate 103) I get
But Insight looks OK, without 'run' Now deleted the other 'run' using "root" in web. Delete went OK. None of the 'runs' above remain in DB.
Insight has problems - E.g. on plate 103: |
Thanks, @will-moore.
|
I should add, hopefully the chgrp you tried should now work too, let me know. And, thanks very much for the psql and Blitz log extracts, they were most helpful. |
The chgrp proceeds without error in web when I choose to move both Screens, BUT the Plate that was in 2 Screens after import (see above) is only in 1 screen after chgrp.
|
After discussion with @jburel @mtbc we think that deleting an Acquisition/Run should delete all the linked WellSamples and their linked Images. If any Well becomes empty (no Well Samples) then it should be deleted too. |
@will-moore, we do expect one well to be left on plate 1 after all the runs are deleted because one of that plate's wells after initial import has "orphaned" samples. (On the plate with different wells, I think they all do.) Still, not enough wells are being deleted. @joshmoore, I added |
The loss of a plate under chgrp: could that simply be because the two screens aren't moved by the client in the same DoAll? If that's so, it's probably an entirely separate issue. |
@mtbc: have you tried moving the reagent link deletion earlier in the |
I had guessed that the |
Sorry, the screen spec would be irrelevant then, I was not following the thread apparently. One would certainly think that the Well would get rid of its own reagents (unless they belonged to someone else or similar). A possible bug but I don't have any other evidence for this is that the Well's SOFT is overriding the FORCE of reagent, which could cause this to happen. Likely unrelatedly, I was wondering why the Well entry to PlateAcquisition is so low down when it's so high up for Plate? |
I just put it low down because we have to get rid of the sample before we get rid of the well so it made sense to me to think of it like that: we delete the sample, then we delete the well only if it has no samples from other runs. |
With a And, if there were a <bean parent="delSpec" name="/WellReagentLink">
<constructor-arg>
<list>
<value>/WellReagentLink/Reagent;SOFT</value>
<value>/WellReagentLink</value>
</list>
</constructor-arg>
</bean> but I still come back to the basic problem that we do,
but never,
even though I have a I am wondering if I should give up on this one. Separately, I am wondering to what extent the model can be analyzed and rules like "if I have an X I may not actually also want to delete the related Y" could be used to generate a |
Try:
|
Oh! I hadn't realized that I could write |
(Sorry, where am I meant to be writing this? (-:) |
Instead of |
Hmm, now it's deleting the wells too successfully: even if they have orphaned samples they go if I delete the run. |
Unless it turns out to be some regression caused by this PR, I'd suggest that the disappearing duplicate plate is a separate DoAll client issue for which I could file an RFE. |
Code changes look good. I'll leave this for UI testing though. (Do any integration tests need updating?) |
The integration tests looked okay but we should wait for http://hudson.openmicroscopy.org.uk/view/2.%20Stable/job/OmeroJava-integration-stable/ to turn green. |
(I have a grander vision for integration tests for the longer term, though: to the last part of my comment #1430 (comment) I'd add that it'd be great if such tests could somehow, from the analysis of the model, generate sufficiently rich data to really test out that graph traversal: I'd guess that that line I added to |
The generation of small |
Deleted the Plate that is only in a single Screen - this removed half of the images & wellsamples (11/22) from the DB. All OK.
At this point, web viewing of the remaining Run fails as before:
because the WellWrapper._obj has some null WellSamples, so copyWellSample() returns a list of length 2, one item is None. [None, WellSample].
This is because the Wells loaded by
each have an additional [None] in their copyWellSample() list
|
After deleting the last Run, we are left with a single Well that has 3 WellSamples (no Runs). Insight displays this fine, but web fails as before: http://localhost:8000/webgateway/plate/1/0/
|
I think this PR is now working. Everything is deleted as expected, but we have some strange behaviour in web. |
Great! Filed http://trac.openmicroscopy.org.uk/ome/ticket/11492 about the chgrp lost-duplicate issue. |
|
@mtbc: do you intend for the tests to be added here/now? or are you planning on another PR for that? |
I'm hoping to push a decent test today. |
Had to rebase and force-push to use a recently merged superclass method. |
Did basic chgrp and plate acquisition deletes in a private group on howe (using user-1 and user-2). No errors in Insight and Web. Also http://hudson.openmicroscopy.org.uk/job/OmeroJava-integration-stable/122/testngreports/integration.delete/integration.delete.HierarchyDeleteTest/testDeletingMultipleRunsWithOrphanedSamples%20on%20instance%20null%28integration.delete.HierarchyDeleteTest%29/? is passing. The peculiar .ome file from the ticket has been used during testing. I've not been able to run into orphaned well samples after deleting a parent plate acquisition. Looks ok to merge. |
Thank you, @bpindelski. Will rebase after #1595 is merged. |
Thanks all. |
fix #10564: include wells in plate run processing
--rebased-to #1600 |
When processing a plate run, also process its wells.
Fixes https://trac.openmicroscopy.org.uk/ome/ticket/10564
To test, try deleting the last plate run of a plate that another user owns and that you have permission to delete. Then, try double-clicking on the plate in Insight and see if the data browser shows thumbnail weirdness.
Also, make sure that
AdminServiceTest
andHierarchyDeleteTest
are still both passing; in the latter,testDeletingMultipleRunsWithOrphanedSamples
verifies #1430 (comment).