synthesis_workflow.extra.insitu_validation¶
In-situ validation functions for synthesis in atlas.
Functions¶
|
Inner function to compute the max extent of dendrites. |
|
Compute the extents (max radial distance) of all morphologies. |
|
Plot histograms of extents of morphologies. |
|
For each layer, compute the fraction of crossing morphologies. |
|
Plot count of crossing of morphologies with layers. |
|
Estimate the depth from 'pos' to pia using layer annotation from atlas. |
|
Plot morphologies next to each other with points colored by layer. |
Module Contents¶
- _extent_function(row)¶
Inner function to compute the max extent of dendrites.
- compute_extents(sonata_path, morphology_path, ext='.h5', parallel_factory='multiprocessing')¶
Compute the extents (max radial distance) of all morphologies.
- Parameters:
- Returns:
dataframe from sonata with column ‘extent’ containing the computed values
- Return type:
- plot_extents(results_df, pdf_name='extents.pdf', bins=200)¶
Plot histograms of extents of morphologies.
- get_layer_morpho_counts(sonata_path, morphology_path, atlas_path, n_cells=100, section_type='basal_dendrite', region=None, hemisphere='right', ext='.h5', region_structure_path='region_structure.yaml')¶
For each layer, compute the fraction of crossing morphologies.
- Parameters:
sonata_path (str) – path to sonata file
morphology_path (str) – base path to morphologies
atlas_path (str) – path to atlas folder
n_cells (int) – number of morphologies to use to compute the fraction
section_type (str) – section type (attr of morphio.SectionType)
region (str) – is not None, must be the name of a region to filter morphologies
hemisphere (str) – left/right hemisphere
ext (str) – extension of morphology files
region_structure_path (str) – path to region_structure.yaml file
- Returns:
dafaframe with the counts, mtype and layers information
- Return type:
- plot_layer_morph_counts(counts_df, pdf_name='layer_count_comparison.pdf')¶
Plot count of crossing of morphologies with layers.
If ‘label’ column is present in counts_df, the barplots will split the data for comparison.
- For example:
df1 = get_layer_morpho_counts(…) df1[‘label’] = ‘dataset1’ df2 = get_layer_morpho_counts(…) df2[‘label’] = ‘dataset2’ plot_layer_morph_counts(pd.concat([df1, df2]))
- Parameters:
counts_df (pandas.DataFrame) – results of get_layer_morpho_counts,
pdf_name (str) – name of pdf to save
- get_depth(atlas, pos, layers, lower=0, upper=1000, precision=0.1)¶
Estimate the depth from ‘pos’ to pia using layer annotation from atlas.
- plot_layer_collage(sonata_path, morphology_path, atlas_path, n_cells=10, section_types=None, region=None, hemisphere='right', pdf_name='layer_collage.pdf', shift=200, dpi=200, ext='.h5', region_structure_path='region_structure.yaml')¶
Plot morphologies next to each other with points colored by layer.
- Parameters:
sonata_path (str) – path to sonata file
morphology_path (str) – base path to morphologies
atlas_path (str) – path to atlas folder
n_cells (int) – number of morphologies to use to compute the fraction
section_types (list) – list of section types (attr of morphio.SectionType), if None, basal_dendrite, apical_dendrite will be used
region (str) – is not None, must be the name of a region to filter morphologies
hemisphere (str) – left/right hemisphere
pdf_name (str) – name of pdf to save
shift (float) – x-shift between morphologies
dpi (int) – dpi to save rasterized pdf
ext (str) – extension of morphology files
region_structure_path (str) – path to region_structure.yaml file