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

WIP: query related regions (e.g. homologies) #448

Merged
merged 6 commits into from
Oct 12, 2023
Merged

Conversation

xgui3783
Copy link
Member

@xgui3783 xgui3783 commented Aug 31, 2023

n.b. needs brainscapes configuration branch feat_ebrainsRef https://jugit.fz-juelich.de/t.dickscheid/brainscapes-configurations/-/tree/feat_ebrainsRef PR (https://jugit.fz-juelich.de/t.dickscheid/brainscapes-configurations/-/merge_requests/115)

sample code (n.b. needs feat_ebrainsRef branch of configuration):

import siibra
from concurrent.futures import ThreadPoolExecutor
from  itertools import repeat

wax_parc = "waxholm v3"
wax_reg = "cornu ammonis 1"

def foo():
    with siibra.QUIET:
        
        reg = siibra.get_region("2.9", "PGa")
        for ass in reg.related_regions:
            print(ass)

        print("now for mebrains")
        reg = siibra.get_region("monkey", "PG")
        for ass in reg.related_regions:
            print(ass)


        print(f"how about {wax_parc}? {wax_reg}")
        reg = siibra.get_region(wax_parc, wax_reg)
        with ThreadPoolExecutor() as ex:
            features = ex.map(
                siibra.features.get,
                [ass.assigned_structure for ass in reg.related_regions],
                repeat("ebrains")
            )

        print([f.name for fts in features for f in fts])
        
        for ass in reg.related_regions:
            print(ass)

foo()

expected output:

[siibra:WARNING] config.SIIBRA_USE_CONFIGURATION defined, use configuration at /home/xgui3783/dev/projects/brainscapes-configurations/
[siibra:INFO] Using custom configuration from LocalFileRepository at /home/xgui3783/dev/projects/brainscapes-configurations/
[siibra:INFO] Version: 0.4a62
[siibra:WARNING] This is a development release. Use at your own risk.
[siibra:INFO] Please file bugs and issues at https://github.com/FZJ-INM1-BDA/siibra-python.
'Area PGa (IPL)' is another version of 'Area PGa (IPL)'
'Area PGa (IPL)' is another version of 'Area PGa (IPL)'
'Area PGa (IPL)' is another version of 'Area PGa (IPL)'
'Area PGa (IPL)' is another version of 'Area PGa (IPL)'
'Area PGa (IPL)' is another version of 'Area PGa (IPL)'
'Area PGa (IPL)' is homologous to 'PG'
now for mebrains
'PG' is homologous to 'Area PGa (IPL)'
'PG' is homologous to 'Area PGa (IPL) left'
'PG' is homologous to 'Area PGa (IPL) right'
'PG' is homologous to 'Area PGa (IPL)'
'PG' is homologous to 'Area PGa (IPL) left'
'PG' is homologous to 'Area PGa (IPL) right'
'PG' is homologous to 'Area PGa (IPL)'
'PG' is homologous to 'Area PGa (IPL) right'
'PG' is homologous to 'Area PGa (IPL) left'
how about waxholm v3? cornu ammonis 1
['Ebrains Dataset: Multi-area recordings from visual and somatosensory cortices, perirhinal cortex and hippocampal CA1 (v1)', 'Ebrains Dataset: 3D reconstructions of pyramidal cells in rat hippocampal CA1 region (v1)', 'Ebrains Dataset: Density measurements of different receptors for CA, stratum moleculare (Hippocampus) [rat]', 'Ebrains Dataset: Density measurements of different receptors for CA, stratum cellulare (Hippocampus) [rat]', 'Ebrains Dataset: Density measurements of different receptors for CA1 (Hippocampus) [rat]', 'Ebrains Dataset: Wistar rat hippocampus CA1 pyramidal cell morphologies – Extension with additional reconstructions', 'Ebrains Dataset: Wistar rat hippocampus CA1 pyramidal cell morphologies']
'cornu ammonis 1' is another version of 'cornu ammonis 1'

edit 2023-10-11: updated example

@codecov-commenter
Copy link

codecov-commenter commented Oct 11, 2023

Codecov Report

Merging #448 (56b0b2e) into main (5a0e6b3) will increase coverage by 1.23%.
Report is 159 commits behind head on main.
The diff coverage is 38.06%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@            Coverage Diff             @@
##             main     #448      +/-   ##
==========================================
+ Coverage   36.81%   38.05%   +1.23%     
==========================================
  Files          61       62       +1     
  Lines        5421     5776     +355     
==========================================
+ Hits         1996     2198     +202     
- Misses       3425     3578     +153     
Files Coverage Δ
siibra/configuration/configuration.py 42.35% <ø> (ø)
siibra/core/atlas.py 85.71% <ø> (+1.23%) ⬆️
siibra/features/connectivity/__init__.py 83.33% <100.00%> (ø)
...ibra/features/connectivity/tracing_connectivity.py 75.00% <100.00%> (ø)
siibra/features/tabular/layerwise_cell_density.py 37.20% <ø> (+0.25%) ⬆️
...a/features/tabular/regional_timeseries_activity.py 24.73% <ø> (-3.67%) ⬇️
siibra/locations/boundingbox.py 19.88% <ø> (ø)
siibra/commons.py 39.78% <50.00%> (-0.22%) ⬇️
...a/features/connectivity/functional_connectivity.py 55.55% <0.00%> (ø)
siibra/livequeries/ebrains.py 25.35% <0.00%> (+0.35%) ⬆️
... and 24 more

... and 5 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@AhmetNSimsek AhmetNSimsek marked this pull request as ready for review October 11, 2023 13:13
Copy link
Collaborator

@AhmetNSimsek AhmetNSimsek left a comment

Choose a reason for hiding this comment

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

LGTM
Only could you revert changes in factory regarding build functions and make a separate branch out of that?

@AhmetNSimsek AhmetNSimsek marked this pull request as draft October 11, 2023 13:20
maint: revert factory decorator
maint: minor refactor
@xgui3783 xgui3783 marked this pull request as ready for review October 12, 2023 12:53
@AhmetNSimsek AhmetNSimsek merged commit 8a49e8d into main Oct 12, 2023
9 of 18 checks passed
@xgui3783 xgui3783 deleted the expmt_relatedRegQry branch October 12, 2023 17:57
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