tasks.clone¶
Optional phase 4: Clones.
Attributes¶
Classes¶
Collect annotated dataset to work with on this phase. |
|
Collect annotations to work with on this phase. |
|
Create clones of morphologies. |
|
Make a morpology release of clones. |
Functions¶
|
Returns a dict of 'Category' -> list of names. |
Module Contents¶
- tasks.clone.logger¶
- tasks.clone.Category¶
- tasks.clone.NEURONDB_XML¶
- class tasks.clone.CollectRepaired(*args, **kwargs)¶
Bases:
data_validation_framework.task.ElementValidationTaskCollect annotated dataset to work with on this phase.
- morph_path_col¶
- class tasks.clone.CollectAnnotations(*args, **kwargs)¶
Bases:
data_validation_framework.task.ElementValidationTaskCollect annotations to work with on this phase.
- tasks.clone.get_candidates_from_neurondb(neurondb)¶
Returns a dict of ‘Category’ -> list of names.
- class tasks.clone.CloneMorphologies(*args, **kwargs)¶
Bases:
data_validation_framework.task.SetValidationTaskCreate clones of morphologies.
This task is divided in 4 steps:
- Graft axons
Graft the axons from some morphologies to other morphologies based on the neurondb and the
cross_mtypesparameter.At the end of the phase, discard morphologies who have the
<use_axon>or<use_dendrites>flags set to False.
- Scale the morphologies
This phase produces new version of each morphology by scaling them along the Y axis with the scaling factors given in the y_scales parameter.
- Transform neuronDB according to the exclusion and substitution rules
The rules are applied with the following logic:
First the ‘exclusions’ are applied
Then the ‘substitutions’
Finally the ‘mtype_copy_to_layer’, so that the later applies to the former.
- Create jittered versions of each morphologies and their corresponding annotations.
Two kinds of jitter are applied:
rotational jitter: the section bifurcation angles are jittered with an std of 10 degrees
section length jitter: each section is scaled individually with an an std of 20% (ie. each section is stretched or compressed by around 20%)
Procedure:
For each
Category[mtype, layer], determine the number of clones to be generated for this category. It depends on the total number of morphs in the circuit and the proportion of the category comparatively to other categories present in the circuit. This information is stored in builder_recipe.Each morphology file can be used by multiple
category[mtype, layer]. The number of clones to be generated for a given morphology file is the sum of the number of required clones for each category it belongs to.Produce the clones and adds an entry in self.output_db for each of them.
If a placement_rules file is provided, also create an annotation file for each clones, else this step is skipped.
Note
when a
category[mtype, layer]appears in neurondb but not inbuilder_recipe, we can not compute the number of clones required by this category, so its number is set to 0.when a
category[mtype, layer]appears in the builder_recipe but not in neurondb, it means there is no morphologies available for this category. So the category is skipped, but that can lead to problems later on in the pipeline.different sub-mtypes are considered as different mtypes: they will have distinct clones.
This task produces one directory for each step with:
the morphology files.
the neuronDB.xml and neuronDB.dat files.
an annotations folder with one annotation for each new morphology.
- cross_mtypes¶
The list of mtypes to be grafted.
- Type:
- Default value:
[‘L2_IPC’, ‘L4_UPC’, ‘L4_SSC’, ‘L5_UPC’, ‘L6_UPC’, ‘L6_BPC’, ‘L6_HPC’, ‘L3_TPC:B’, ‘L5_TPC:A’, ‘L5_TPC:B’, ‘L5_TPC:C’, ‘L6_TPC:A’, ‘L6_TPC:C’]
- placement_rules_path¶
Path to the XML file describing the placement rules.
- Type:
- Default value:
placement_rules.xml
- transform_rules_path¶
Path to the XML file containing the transform rules.
- Type:
- Default value:
transform_rules.xml
- clone_multiplier¶
The multiplication factor to the number of generated clones.
- Type:
- Permitted values:
float in (0, inf)
- Default value:
1
- std_angle¶
The std of the angles used to generate the clones.
- Type:
- Permitted values:
float in (0, inf)
- Default value:
10.0
- std_scale¶
The std of the scales used to generate the clones.
- Type:
- Permitted values:
float in (0, inf)
- Default value:
0.2
- parallel_factory_type¶
The type of parallel factory used for computation.
- Type:
- Choices:
{serial, multiprocessing, dask, ipyparallel, dask_dataframe}
- Default value:
multiprocessing
- morph_path_col¶