GUI Results¶
The analysis results can be saved in .h5, .mat or .npz.
Results description¶
The results file contain nested structures depending on the selected data to export.
Note
For the following examples suppose that only ICA and X2P analyses has been performed on the current database.
See also
Check out the available save options from the GUI in the demo section GUI Usage.
Information¶
This is included in every results file, useful to identify the ENCORE version used for the analysis and the date of the analysis.
1ENCORE:
2 info:
3 # Information about the analyzer and analysis date
4 ENCORE_version: 3.0.0 # str, showing ENCORE version used for the analysis
5 analyzer: ENCORE Single Database GUI # String to identify the specific analyzer used
6 date: 250826_143355 # str with the date, formatted DDMMYY_HHMMSS
Tip
The specific string used in ENCORE["info"]["analyzer"] may be used to identify the specific analysis pipeline used.
This could be used in a better handling of results files in subsequent analyses.
Note
Note the ENCORE key at the root of the file.
Input user data¶
This is the input data loaded by the user, useful to keep track of the data used for the analysis.
1ENCORE:
2 info:
3 # ...
4 input_data:
5 # Input data loaded in the GUI, only the loaded data is available
6 coordinates: [matrix] # Matrix with the coordinates
7 neuronal_activity: [matrix] # Binary activity matrix
8 stims: [matrix] # Binary matrix with stimulation
Minimal results used by ENCORE¶
This is the most important part of the results file. Contains the ensembles, neurons in ensembles and the activity of the ensembles for every algorithm used.
See also
This is also returned for by the Python API runners. Check out Python API Usage and also Analyzing databases in parallel using the Python API.
1ENCORE:
2 info:
3 # ...
4 results:
5 # These are the minimal results
6 ica:
7 ensembles_cant: int # Number of ensembles identified by this algorithm
8 neus_in_ens: [matrix] # 2D binary matrix shaped (neurons, ensembles)
9 # A number 1 indicates that neuron belong to that ensemble
10 timecourse: [matrix] # 2D binary matrix shaped (timepoints, ensembles)
11 # A number 1 indicates that ensemble active in that timepoint
12 x2p:
13 ensembles_cant: int
14 neus_in_ens: [matrix]
15 timecourse: [matrix]
Parameters¶
The parameters used for every analysis on this database.
See also
Check out the parameters structures used by every algorithm in the Algorithms configuration file and in Python API Usage.
1ENCORE:
2 info:
3 # ...
4 parameters:
5 # Parameters used by each algorithm
6 ica:
7 max_ensembles_cant: int
8 min_ensembles_cant: int
9 number_of_iterations: int
10 # ...
11 # Each ICA parameter ...
12 x2p:
13 ClusteringFixed: int
14 ClusteringRangeEnd: int
15 # ...
Full results of every analysis¶
These are variables used internally by every algorithm, may be useful for further analysis based on their procedures. Check out the names of the variables and the references for each algorithm.
1ENCORE:
2 info:
3 # ...
4 algorithms_results:
5 # This contains some internal variables used by the algorithms during the analysis
6 # each field here is the short name of the algorithms used.
7 # More documentation will be made available in future versions.
8 ica:
9 assembly_templates: [matrix] # 2D matrix
10 binary_assembly_templates: [matrix] # 2D matrix
11 # ...
12 x2p:
13 Count: int # integer
14 Activity: [matrix] # 2D matrix
Ensembles Compare Analysis¶
The results displayed in the “Ensembles Compare” tab of the GUI. These are similarity matrices over the members of each ensemble for every algorithm and also the similarity of ensembles activity with stimulation/behavior.
1ENCORE:
2 info:
3 # ...
4 ensembles_compare:
5 # This is the data visualized in the "Ensembles compare" tab of the GUI.
6 labels: [matrix] # 1D array with labels of the similarity matrices
7 neus_in_ens: # Matrix displayed in "Ensembles compare / Similarities in members"
8 Correlation: [matrix] # 2D square matrix
9 Cosine: [matrix]
10 Euclidean: [matrix]
11 Jaccard: [matrix]
12 timecourse: # Matrix displayed in "Ensembles compare / Similarities in timecourse"
13 Correlation: [matrix] # 2D square matrix
14 Cosine: [matrix]
15 Euclidean: [matrix]
16 Jaccard: [matrix]
Performance Comparison¶
This is the data visualized in the “Performance Comparison” tab. The variables saved here depends on the actual variables loaded by the user, for example stimulation and behavior.
1ENCORE:
2 info:
3 # ...
4 ensembles_performance:
5 # This is the data visualized in "Performance Comparison"
6 correlation_cells:
7 # From "Performance Comparison / Correlation between cells"
8 ica:
9 # One matrix per ensemble identified by ica
10 Ensemble 1: [matrix] # 2D matrix of correlations between neurons in the ensemble 1
11 Ensemble 2: [matrix] # 2D matrix of correlations between neurons in the ensemble 2
12 # ... for every ensemble
13 x2p:
14 # One matrix per ensemble identified by x2p
15 Ensemble 1: [matrix] # 2D matrix of correlations between neurons in the ensemble 1
16 # ... for every ensemble
17 correlation_ensembles_stimuli:
18 # From "Performance Comparison / Correlation with stimuli presentation"
19 # One correlation matrix per algorithm.
20 # This variable exists only if stimulation was provided
21 ica: [matrix] # 2D matrix with shape (stimuli, ensembles)
22 x2p: [matrix] # 2D matrix with shape (stimuli, ensembles)
23 crosscorr_ensembles_stimuli:
24 # From "Performance Comparison / Cross correlation ensembles and stimuli"
25 # One matrix per algorithm.
26 # This variable exists only if stimulation was provided
27 ica:
28 # One matrix per ensemble identified by ica
29 Ensemble 1: [matrix] # 2D matrix of correlations between neurons in the ensemble 1
30 # ... for every ensemble
31 x2p:
32 # One matrix per ensemble identified by x2p
33 Ensemble 1: [matrix] # 2D matrix of cross correlation ensembles with stimuli
34 # ... for every ensemble
35 correlation_ensembles_behavior:
36 # Same as for stimuli but with behavior, if provided
37 crosscorr_ensembles_behavior:
38 # Same as for stimuli but with behavior, if provided
Loading results files¶
There are several ways to work with the results files, depending on the format used.
The following example extracts the version of ENCORE used in the analysis, the number of ensembles identified by the ICA algorithm, the activity of the ensembles and the neurons binary activity.
Opening h5 files using python¶
1import numpy as np
2import h5py
3
4file_path = "ENCORE_250826_161754_.h5"
5
6with h5py.File(file_path, "r") as hdf_file:
7
8 # For the analyzer version
9 encore_info = hdf_file["ENCORE"]["info"]
10 # Read every element as a numpy array
11 encore_version_d = np.array(encore_info["ENCORE_version"]).flatten()
12 # Decode the text like this
13 encore_version = encore_version_d[0].decode("utf-8")
14
15 # For the ensembles results
16 results = hdf_file["ENCORE"]["results"]
17 ica_results = results["ica"]
18 ensembles_cant = int(np.array(ica_results["ensembles_cant"])) # Read it as number
19 ensembles_timecourse = np.array(ica_results["timecourse"])
20
21 # For the neuronal activity
22 input_data = hdf_file["ENCORE"]["input_data"]
23 neuronal_activity = np.array(input_data["neuronal_activity"])
24 coords = np.array(input_data["coordinates"])
25
26 # Just to verify that the data makes sense
27 # ENCORE version
28 assert encore_version == "3.0.0"
29 # Number of ensembles
30 assert ensembles_timecourse.shape[0] == ensembles_cant
31 # Number of neurons
32 assert neuronal_activity.shape[0] == coords.shape[0]
33 # Number of timepoints
34 assert neuronal_activity.shape[1] == ensembles_timecourse.shape[1]
See also
Check out the h5py documentation for a better understanding on how to use the format.