navis.interfaces.r.nblast_allbyall¶
- navis.interfaces.r.nblast_allbyall(x, normalized=True, k=5, resample=None, n_cores=0, use_alpha=False)[source]¶
All-by-all NBLAST using R’s
nat.nblast::nblast_allbyall
.NBLAST is optimized for data in microns. Original nat function can be found here.
- Parameters:
x (NeuronList | nat.neurons) – (Tree)Neurons to blast. While not strictly necessary, data should be in microns.
k (int, optional) – Number of nearest neighbors to use for dotprops generation. Only relevant if input data is not already
Dotprops
.resample (int | bool, optional) – Resampling during dotprops generation. A good value is
1
which means if data is in microns (which it should!) it will be resampled to 1 tangent vector per micron. Only relevant if input data is not alreadyDotprops
.normalized (bool, optional) – If True, matrix is normalized using z-score.
n_cores (int, optional) – Number of cores to use for nblasting. Default is
os.cpu_count() - 2
.use_alpha (bool, optional) – Emphasizes neurons’ straight parts (backbone) over parts that have lots of branches.
- Returns:
DataFrame containing the results.
- Return type:
pandas.DataFrame
Examples
>>> import navis >>> from navis.interfaces import r >>> nl = navis.example_neurons() >>> # Blast against each other (note the division to get to microns) >>> scores = r.nblast_allbyall(nl / 1000)