morphology_workflows.curation

Curation functions.

Module Contents

Functions

collect(row, data_dir[, morph_path_col])

Collect morphologies.

extract_marker(row, data_dir)

Extract marker data from morphology files.

plot_markers(row, data_dir[, with_plotly])

Plot markers on morphologies.

sanitize(row, data_dir[, ensure_roots_at_soma])

Sanitize morphologies.

fix_root_section(morph[, min_length])

Ensures that each neurite has a root section with non-zero length.

check_neurites(row, data_dir[, axon_n_section_min, ...])

Check which neurites are present, add soma if missing and mock_soma_type is not None.

fix_soma_radius(morph)

Fix the radius of a spherical soma.

fix_neurites_in_soma(row, data_dir)

Fix neurites whose points are located inside the soma.

recenter(row, data_dir)

Recenter morphologies to place soma at [0, 0, 0].

orient(row, data_dir[, pia_direction])

Orient a morphology such that the original pia_direcion is along y.

align(row, data_dir[, method, neurite_type, ...])

Align a morphology.

z_range(neuron[, min_range])

Checker for z-range.

detect_errors(row, data_dir[, min_range, ...])

Detect errors in morphologies.

make_error_report(df, data_dir[, error_report_path])

Make the error report as a df and save to .csv.

resample(row, data_dir[, linear_density])

Resample morphologies with fixed linear density.

plot_morphology(row, data_dir[, with_plotly, ...])

Plot a morphology.

morphology_workflows.curation.collect(row, data_dir, morph_path_col='morph_path')

Collect morphologies.

morphology_workflows.curation.extract_marker(row, data_dir)

Extract marker data from morphology files.

morphology_workflows.curation.plot_markers(row, data_dir, with_plotly=True)

Plot markers on morphologies.

morphology_workflows.curation.sanitize(row, data_dir, ensure_roots_at_soma=True)

Sanitize morphologies.

With ensure_roots_at_soma we disconnect neurites not at the soma and connect at the soma. This may happen for dendrite bearing axons morphologies in .swc format. Weirdness may happen, for example upon converting to .asc, the axon will become a basal.

morphology_workflows.curation.fix_root_section(morph, min_length=_ZERO_LENGTH)

Ensures that each neurite has a root section with non-zero length.

morphology_workflows.curation.check_neurites(row, data_dir, axon_n_section_min=5, mock_soma_type='spherical', ensure_stub_axon=False, ensure_single_axon=True, ensure_axon_at_soma=True, remove_dummy_neurites=True, min_length_first_section=_ZERO_LENGTH)

Check which neurites are present, add soma if missing and mock_soma_type is not None.

morphology_workflows.curation.fix_soma_radius(morph)

Fix the radius of a spherical soma.

If all points of a neurite are located inside the soma, the radius is reduced such that at least the last point of each neurite is located outside the soma.

morphology_workflows.curation.fix_neurites_in_soma(row, data_dir)

Fix neurites whose points are located inside the soma.

Method:
  • The radius of the soma is adapted to reduce the number of points inside the soma.

  • The remaining points inside the soma are removed.

morphology_workflows.curation.recenter(row, data_dir)

Recenter morphologies to place soma at [0, 0, 0].

morphology_workflows.curation.orient(row, data_dir, pia_direction='y')

Orient a morphology such that the original pia_direcion is along y.

morphology_workflows.curation.align(row, data_dir, method='whole', neurite_type='apical', direction=None, custom_orientation_json_path=None)

Align a morphology.

morphology_workflows.curation.z_range(neuron, min_range=50)

Checker for z-range.

morphology_workflows.curation.detect_errors(row, data_dir, min_range=50, overlapping_point_tolerance=None, disabled_checker_labels=None, strict_checker_labels=None, column_names=None, plot=True)

Detect errors in morphologies.

TODO: bypass dangling if only one axon/neurite

morphology_workflows.curation.make_error_report(df, data_dir, error_report_path='error_report.csv')

Make the error report as a df and save to .csv.

morphology_workflows.curation.resample(row, data_dir, linear_density=1.0)

Resample morphologies with fixed linear density.

morphology_workflows.curation.plot_morphology(row, data_dir, with_plotly=True, realistic_diameters=True)

Plot a morphology.