Data IO API
Data loading
CePNEMAnalysis.load_CePNEM_output — Functionload_CePNEM_output(
datasets::Vector{String}, fit_ranges::Dict, path_output, path_h5, n_params,
n_particles, n_samples, is_mcmc; load_posterior::Bool=true
)Loads CePNEM output data.
Arguments:
datasets::Vector{String}: Datasets to loadfit_ranges: Dictionary of fit ranges for each datasetpath_output: Path to Gen output. Data must be stored inpath_output/dataset/rng1torng2/h5/neuron.h5path_h5: Path to H5 file for the dataset, which must be stored indataset-data.h5in this directory.n_params: Number of parameters in the Gen modeln_particles: Number of particles in the Gen fitn_samples: Number of samples from the posterior given by the Gen fitis_mcmc: Whether fits are done via MCMC (as opposed to SMC)load_posterior(optional, defaulttrue): Whether to load the posterior samples. Iffalse, only the fit ranges and traces are loaded.
CePNEMAnalysis.add_to_analysis_dict! — Functionadd_to_analysis_dict!(analysis_dict::Dict, new_dict::Dict, key::String)Adds a dictionary of new results to an existing analysis dictionary.
Arguments:
analysis_dict::Dict: Dictionary of CePNEM analysis resultsnew_dict::Dict: Dictionary of new results to addkey::String: Key inanalysis_dictto add new results to
CePNEMAnalysis.neuropal_data_to_dict — Functionneuropal_data_to_dict(
fit_results::Dict, analysis_dict::Dict,
list_class::Vector, list_match_dict::Vector, datasets_neuropal::Vector{String}
)Computes match and encoding-change match dictionaries for NeuroPAL data.
Arguments:
fit_results::Dict}: Dictionary of CePNEM fit results.analysis_dict::Dict: Dictionary of CePNEM analysis results.list_class::Vector{Any}: List of classes to match.list_match_dict::Vector{Any}: List of dictionaries of matches for each class.datasets_neuropal::Vector{String}: List of datasets to match.
Export datasets to WormWideWeb-compatible format
CePNEMAnalysis.export_to_json — Functionexport_to_json(
fit_results::Dict, analysis_dict::Dict, relative_encoding_strength::Dict,
datasets::Vector{String}, path_output::String, path_h5::String
)Exports CePNEM analysis results to JSON file for use on the website.
Arguments:
fit_results::Dict: Dictionary of CePNEM fit results.analysis_dict::Dict: Dictionary of CePNEM analysis results.relative_encoding_strength::Dict: Dictionary of relative encoding strength values for each neuron.datasets::Vector{String}: List of datasets to export.dataset_categorization::Dict: Dictionary of dataset categories (eg:stim) and the datasets that belong to them.path_output::String: Name of JSON directory to export to.path_h5::String: Path to HDF5 directory containing raw data.