AllenInstitute / ophys_nway_matching

Other
4 stars 0 forks source link

Feature/input assembly utility #62

Closed djkapner closed 3 years ago

djkapner commented 3 years ago

An external collaborator was having trouble assembling an input json correctly for a list of experiments. this PR:

Added the ability to query by session_id, which will only work for sessions/experiments that are 1-to-1 mappable (i.e. not mesoscope).

$ python -m nway.onprem_utils.assembly --experiment_ids 1023909329,1024382348,1025646202,1024072693 --output_json tmp.json
INFO:OnPremInputAssembly:loaded 19 ROIs for experiment 1023909329
INFO:OnPremInputAssembly:loaded 20 ROIs for experiment 1024382348
INFO:OnPremInputAssembly:loaded 23 ROIs for experiment 1025646202
INFO:OnPremInputAssembly:loaded 21 ROIs for experiment 1024072693
INFO:OnPremInputAssembly:Wrote tmp.json

$ python -m nway.onprem_utils.assembly --session_ids 1023831246,1024020218,1024303593,1024443480 --output_json tmp.json
INFO:OnPremInputAssembly:loaded 19 ROIs for experiment 1023909329
INFO:OnPremInputAssembly:loaded 21 ROIs for experiment 1024072693
INFO:OnPremInputAssembly:loaded 20 ROIs for experiment 1024382348
INFO:OnPremInputAssembly:loaded 25 ROIs for experiment 1024538071
INFO:OnPremInputAssembly:Wrote tmp.json
djkapner commented 3 years ago

@jeromelecoq @mhm34 Have a look at this README for instructions on how to use this branch for your use case.

I'll get some feedback from you on the utility of it here, and some developer input also before merging to main. It may contnue to change until the merge.

codecov-io commented 3 years ago

Codecov Report

Merging #62 (5f2a925) into main (1df9361) will decrease coverage by 5.31%. The diff coverage is 63.48%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #62      +/-   ##
==========================================
- Coverage   97.59%   92.28%   -5.32%     
==========================================
  Files           9       11       +2     
  Lines        1041     1167     +126     
==========================================
+ Hits         1016     1077      +61     
- Misses         25       90      +65     
Impacted Files Coverage Δ
src/nway/__init__.py 100.00% <ø> (ø)
src/nway/image_processing_utils.py 100.00% <ø> (ø)
src/nway/meta_registration.py 100.00% <ø> (ø)
src/nway/nway_matching.py 96.90% <ø> (ø)
src/nway/onprem_utils/assembly.py 0.00% <0.00%> (ø)
src/nway/pairwise_matching.py 92.99% <ø> (ø)
src/nway/transforms.py 100.00% <ø> (ø)
src/nway/utils.py 100.00% <ø> (ø)
src/nway/onprem_utils/query_utils.py 67.39% <67.39%> (ø)
src/nway/diagnostics.py 100.00% <100.00%> (ø)
... and 3 more
djkapner commented 3 years ago

Working, as verified by Jerome running it himself and sending results on to Mitch.