Data IO API

Data loading

CePNEMAnalysis.load_CePNEM_output — Function
load_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 load
  • fit_ranges: Dictionary of fit ranges for each dataset
  • path_output: Path to Gen output. Data must be stored in path_output/dataset/rng1torng2/h5/neuron.h5
  • path_h5: Path to H5 file for the dataset, which must be stored in dataset-data.h5 in this directory.
  • n_params: Number of parameters in the Gen model
  • n_particles: Number of particles in the Gen fit
  • n_samples: Number of samples from the posterior given by the Gen fit
  • is_mcmc: Whether fits are done via MCMC (as opposed to SMC)
  • load_posterior (optional, default true): Whether to load the posterior samples. If false, only the fit ranges and traces are loaded.
CePNEMAnalysis.add_to_analysis_dict! — Function
add_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 results
  • new_dict::Dict: Dictionary of new results to add
  • key::String: Key in analysis_dict to add new results to
CePNEMAnalysis.neuropal_data_to_dict — Function
neuropal_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 — Function
export_to_json(
    fit_results::Dict, analysis_dict::Dict, relative_encoding_strength::Dict, 
    datasets::Vector{String}, path_output::String, path_h5::String, list_uid_neuropal::Vector{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.
  • path_output::String: Name of JSON file to export to.
  • path_h5::String: Path to HDF5 directory containing raw data.
  • list_uid_neuropal::Vector{String}: List of all NeuroPAL datasets, in the order they are computed in list_match_dict.
  • list_match_dict: List of dictionaries of NeuroPAL data.