Skip to content

Conversation

@MatthewMallory
Copy link
Owner

@MatthewMallory MatthewMallory commented May 19, 2025

This was intended to be a small edit to the resample function, but didnt realize I committed changes to projection matrix as well. Details below:
change how proj mat can be run (locally and hpc)
when hpc is used, create an aggregate function that groups the individual cells proj mat files into a full cell x target matrix
change how proj mat is extracted for efficiency, uses a morphology dataframe
Now use count_method to support 1) node counting (which results in an axon length proj mat), 2) tip node counting (which results in # of tip nodes proj mat) and 3) branch node counting (which results in # branch nodes proj mat)

The resampling fix was for a unique case. When the grandchild node of the soma was irreducible, that node would appear twice in the resampled morphology.

e.g. resampling these nodes:
test_nodes = [
{'id': 1, 'type': 1, 'x': 0, 'y': 0, 'z': 0, 'r': 1.0, 'parent': -1}, # Soma
{'id': 2, 'type': 3, 'x': 1, 'y': 0, 'z': 0, 'r': 0.5, 'parent': 1}, # Branch point
{'id': 3, 'type': 3, 'x': 2, 'y': 1, 'z': 0, 'r': 0.5, 'parent': 2}, # Leaf
{'id': 4, 'type': 3, 'x': 2, 'y': -1, 'z': 0, 'r': 0.5, 'parent': 2}, # Leaf
]

would yield:

[{'id': 1, 'type': 1, 'x': 0, 'y': 0, 'z': 0, 'radius': 1.0, 'parent': -1},
{'id': 2, 'type': 3, 'x': 1, 'y': 0, 'z': 0, 'radius': 0.5, 'parent': 1},
{'id': 3, 'type': 3, 'x': 1, 'y': 0, 'z': 0, 'radius': 0.5, 'parent': 2}, # duplicate node as 2
{'id': 4, 'type': 3, 'x': 2, 'y': -1, 'z': 0, 'radius': 0.5, 'parent': 3},
{'id': 5, 'type': 3, 'x': 2, 'y': 1, 'z': 0, 'radius': 0.5, 'parent': 3}]

Which is not...wrong per say, but best to be fixed.

@github-actions
Copy link

Please set a versioning label of either major, minor, or patch to the pull request.

@MatthewMallory MatthewMallory merged commit 786b5cd into main May 19, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants