bluepyemodel.efeatures_extraction.targets_configuration¶
TargetsConfiguration
Classes
|
The goal of this class is to configure the targets and files metadata that will be used during efeature extraction |
- class TargetsConfiguration(files=None, targets=None, protocols_rheobase=None, available_traces=None, available_efeatures=None, auto_targets=None, additional_fitness_efeatures=None, additional_fitness_protocols=None, protocols_mapping=None)¶
Bases:
objectThe goal of this class is to configure the targets and files metadata that will be used during efeature extraction
Init
- Parameters:
File names with their metadata in the format:
[file1_metadata, file2_metadata, ...] file1_metadata = { cell_name=XXX, filename=XXX, resource_id=XXX, etype=XXX, species=XXX, brain_region=XXX, ecodes={}, other_metadata={}, }
targets (list) –
define the efeatures to extract as well as which protocols and current amplitude they should be extracted for. Of the form:
[{ "efeature_name": "AP_amplitude_1", "efeature": "AP_amplitude", "protocol": "IDRest", "amplitude": 150., "tolerance": 10., "weight": 1.0, # optional "efel_settings": { 'stim_start': 200., 'stim_end': 500., 'Threshold': -10. } }]
protocols_rheobase (list) – names of the protocols that will be used to compute the rheobase of the cells. E.g: [‘IDthresh’].
available_efeatures (llist of strings)
auto_targets (list) –
if targets is not given, auto_targets define the efeatures to extract as well as which protocols and current amplitude they should be extracted for, given a list of possible protocols and amplitudes. min_recordings_per_amplitude, preferred_number_protocols and tolerance are optional. Of the form:
[{ "protocols": ["IDRest", "IV"], "amplitudes": [150, 250], "efeatures": ["AP_amplitude", "mean_frequency"], "min_recordings_per_amplitude": 10, "preferred_number_protocols": 1, "tolerance": 10., }]
additional_fitness_efeatures (list of dicts) –
efeatures to add to the output of the extraction, i.e. to the FitnessCalculatorConfiguration (FCC). These efeatures will not be extracted from the targets, but will be used during optimisation and / or validation. They should have the same format as the efeatures of the FCC, e.g.
[ { "efel_feature_name": "Spikecount", "protocol_name": "IDrest_130", "recording_name": "soma.v", "mean": 6.026, "original_std": 4.016, "efeature_name": "Spikecount", "efel_settings": { "strict_stiminterval": true, "Threshold": -30.0, "interp_step": 0.025, "stim_start": 700.0, "stim_end": 2700.0 } } ]
additional_fitness_protocols (list of dicts) –
- protocols to add to
the output of the extraction, i.e. to the FitnessCalculatorConfiguration (FCC). These protocols will not be used during extraction, but will be used during optimisation and / or validation. They should have the same format as the protocols of the FCC, e.g.
[ { "name": "IDrest_130", "stimuli": [ { "delay": 663.3473451327434, "amp": 0.3491827776582547, "thresh_perc": 130.56103157894464, "duration": 2053.050884955752, "totduration": 3000.0, "holding_current": -0.13307330411636328 } ], "recordings_from_config": [ { "type": "CompRecording", "name": "IDrest_130.soma.v", "location": "soma", "variable": "v" } ], "validation": false, "protocol_type": "ThresholdBasedProtocol", "stochasticity": false } ]
- protocols_mapping (dict, optional): maps original protocol
identifiers to renamed versions for standardization. Defaults to None if not provided.
Example:
{ "IDRest_150": 'Step_150_hyp', "IDRest_200": 'Step_200_hyp', "IDRest_250": 'Step_250_hyp', "IV_-120": 'IV_-120_hyp', }
- property auto_targets_BPE¶
In BPE2 input format
- check_presence_RMP_Rin_efeatures(name_rmp_protocol, name_Rin_protocol)¶
Check that the protocols supposed to be used for RMP and Rin are present in the target and that they have the correct efeatures. If some features are missing, add them.
- property files_metadata_BPE¶
In BPE2 input format
- property is_configuration_valid¶
Checks that the configuration has targets, traces and that the targets can be found in the traces. This check can only be performed if the ecodes present in each files are known.
- property protocols_rheobase_BPE¶
Returns None if empty
- property targets_BPE¶
In BPE2 input format