Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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_methodto 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.