Skip to content
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

Add SACA framework Op and SACA use case #156

Merged
merged 32 commits into from
May 2, 2024
Merged

Conversation

elevans
Copy link
Member

@elevans elevans commented Apr 29, 2024

This PR adds the SACA framework (3 Ops: z-score heat map, p-value heatmap, sig mask) and the use case that goes with it.

gselzer and others added 18 commits April 29, 2024 15:26
This commit adds Shulei and Ellen's SACA code from
imagej/imagej-ops coloc-multithread-saca branch
from commit b12ce2904945f7cf14db105e86f917d113279b63. This is
right before Ellen commited a WIP first attempt to multithread SACA.
While it works there are notes indicating that the output is still slow
and does not conform to Shulei's output from the original R package.
Given this, I felt it best to start the SciJava Ops port from the
last known working state and then make progress towards resolving
the Op performance and output results in the SciJava Ops framework.
This commit converts the imagej op copied from
the saca branch to a SciJava op. This Op works, however
it is not multithreaded and it produces NaN results at the
edge of the heatmap.
Shulei's original SACA code also sets NaN's to 0.
To multithread the singleiteration function, we need
to use the chunked LoopBuilder. This results in about
a ~40% reducing in processing time.
The SACA framework has three components:

- Z score heatmap
- SigPixel matrix
- pValue matrix

The Z score heatmap is the result of weighted kendall tau
operation. The SigPixel (significant pixel) and pValue results
are derived from the heatmap Z score. Thus to use the SigPixel
and pValue matrix outputs the user needs to first create
the Z score heatmap.
The goal here is to let Adaptation make this op
a Function.
This commit is a rebase of the saca branch with main.
For some reason the simplify/RAIFocusersTest.java file
was kept and not removed during the rebase. This commit
removes it and updates the OpRegressionTest count.
The loop builder introduces a non-reproducible
randomness to the SACA algorithm. Unfortnately,
we need stop using the multithreaded version of the
loop builder to resolve this.
This commit adds a test for the SACA framework.
It tests all three Ops in the "coloc.saca" namespace.
A slice is taken of both input test data and processed
using SACA. 10 positions are sampled on all three SACA
outputs.
@elevans elevans requested review from ctrueden, hinerm and gselzer April 29, 2024 20:28
Copy link
Member

@gselzer gselzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elevans by and large this looks great! Thank you for porting this - just a couple small changes, none of which I'd expect to take any real work.

The one strange thing here is that there are edits to RAIFocusers.java and related templates which are probably unnecessary. Can we see if this PR still works without those changes? Same goes for the edits to SciJava Ops Engine changes - I think I put comments on each

@elevans
Copy link
Member Author

elevans commented Apr 29, 2024

@gselzer Absolutely! So the RAIFocusers commit came from a rebase that had merge conflicts. I probably messed this up. So if this works without these changes, Great!!

@hinerm
Copy link
Member

hinerm commented Apr 30, 2024

I don't see anything that needs revision beyond what Gabe said. Thanks @elevans!

@elevans
Copy link
Member Author

elevans commented Apr 30, 2024

Thanks! Almost done!

elevans added 3 commits May 1, 2024 08:15
I accidently left these RAIFocusers in from
a rebase.
This commit removes some code changes that I think
I applied from a rebase from one experimental branch
to the SACA one. I checked the log history in main and
couldn't find the code changes there. Regardless, they are not
needed. This commit should now align with the current ops
engine in main.
@elevans elevans force-pushed the scijava-ops-image/saca branch 2 times, most recently from 96713b3 to 63780ff Compare May 1, 2024 15:38
@elevans
Copy link
Member Author

elevans commented May 1, 2024

@gselzer Thanks for the awesome review. I think I've replied to everything and addressed all comments. Its ready for another look!

Copy link
Member

@gselzer gselzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elevans thank you so much for addressing my prior review! More Ops = a better framework!

...unfortunately, I'd suggest a couple more things 😅

@elevans elevans force-pushed the scijava-ops-image/saca branch 2 times, most recently from 15c858b to 9f4a1b4 Compare May 2, 2024 16:06
elevans added 11 commits May 2, 2024 11:10
This commit converts the PNorm.java helper class
into an Op in the `stats` namespace. This commit also
adds a test for this new Op.
This commit converts the QNorm.java helper class
for SACA into an Op. This commit also includes a test
for this new Op.
This commit refactors the coloc.saca namespace tests
This commit refactors the SACA test to use a setup helper
method create the resources needed for the tests just once.
@elevans elevans force-pushed the scijava-ops-image/saca branch from 9f4a1b4 to 33cd59e Compare May 2, 2024 16:10
@elevans
Copy link
Member Author

elevans commented May 2, 2024

@gselzer This PR is ready for its second round of review. Thanks for all the help!

@gselzer gselzer merged commit 7c2fe15 into main May 2, 2024
2 checks passed
@gselzer gselzer deleted the scijava-ops-image/saca branch May 2, 2024 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants