Skip to main content
Data management in Catalax revolves around the Dataset class, which provides a unified interface for handling experimental measurements, simulation results, and synthetic data. This guide covers the essential workflows for creating, importing, manipulating, and exporting datasets in various formats commonly used in biochemical research.

Understanding Dataset Structure

The Dataset class serves as the central data container in Catalax, designed to handle the complexities of biochemical data while providing a clean, consistent interface. Understanding its structure is essential for effectively working with experimental and computational data.

Core Components

A Dataset contains several key components that work together to organize and manage your data:
  • states: A list of state names that defines what states, such as molecules, proteins or process variables, are tracked in this dataset. This serves as the schema that ensures consistency across all measurements.
  • measurements: A list of Measurement objects, where each measurement represents one experimental condition, simulation run, or data point in your study.
  • name, description: Metadata fields that help organize and document your datasets for reproducibility, sharing, and long-term data management.
  • id: A unique identifier that distinguishes this dataset from others, automatically generated to ensure uniqueness.
  • type: Classification of the dataset (measurement, simulation, or prediction) that helps organize different types of data in your research workflow.

Measurement Structure

Each individual Measurement within a dataset contains the detailed information for one experimental condition or simulation run:
  • initial_conditions: A dictionary mapping state names to their initial concentrations, which serves as the starting point for simulation or represents the experimental setup conditions.
  • time: An array of time points at which measurements were taken. This can be None for datasets that only contain initial conditions (such as when setting up simulations).
  • data: A dictionary that maps each state name to its complete concentration time series, providing the full temporal evolution of the system under the given conditions.
  • id: A unique identifier for the individual measurement, allowing precise referencing and data retrieval.

Creating Datasets

From Models

The most common way to create a new dataset is from an existing model, which automatically sets up the correct states structure:
This approach ensures that your dataset is properly configured with the correct states names and maintains consistency between your model definition and data structure.

Adding Initial Conditions

Once you have a dataset structure, you can add initial conditions that represent different experimental scenarios or simulation starting points:
Each call to add_initial() creates a new Measurement object with the specified initial conditions. This flexible approach allows you to build datasets that represent complex experimental designs with multiple conditions and replicates.

Adding Complete Measurements

For more complex scenarios, you can create complete measurements with time-series data and add them to your dataset:
This approach is useful when you have experimental data that you want to incorporate into your analysis pipeline or when you need fine control over the measurement structure.

Importing Data from External Sources

Catalax supports multiple data formats commonly used in biochemical research, making it easy to import experimental data from various sources and analysis platforms.

From EnzymeML Documents

EnzymeML is a standardized format for enzyme kinetics data that provides rich metadata and structured experimental information:
The EnzymeML import automatically extracts states information, experimental conditions, and time-series data while preserving important metadata about the experimental setup and measurement protocols.

From Pandas DataFrames

Many researchers work with data in pandas DataFrames, either from spreadsheet exports or data analysis pipelines. Catalax can import from this format using a structured approach:
This import method provides flexibility for working with data that has been processed in other analysis environments while ensuring proper structure and validation.

From Croissant Archives

Croissant is a standardized format for dataset sharing that includes both data and rich metadata. This format is particularly useful for sharing datasets between research groups:
Croissant archives preserve not only the data but also important metadata about experimental conditions, measurement protocols, and data provenance.

From JAX Arrays

For computational workflows that work directly with numerical arrays, Catalax can import from JAX arrays with proper structure:
This approach is particularly useful when working with simulation results or when interfacing with other computational tools that operate on array data.

Data Export and Sharing

Exporting to Croissant Format

The Croissant format provides a standardized way to package and share datasets with rich metadata:
This creates a standardized archive that includes both your data and important metadata, making it easy to share with collaborators and ensuring reproducibility.

Converting to DataFrames

For analysis in other tools or export to spreadsheet formats, you can convert datasets to pandas DataFrames:
This format is useful for sharing data with researchers who use different analysis platforms or for creating supplementary materials for publications.

Converting to JAX Arrays

For computational workflows, you can extract data as JAX arrays with proper structure:
This provides direct access to the numerical data in a format suitable for mathematical operations and machine learning workflows.

Data Validation and Quality Control

Checking Data Consistency

Catalax provides methods to validate data integrity and identify potential issues:
These methods help ensure data quality and identify any structural issues that might affect analysis.

Data Padding and Standardization

When working with measurements that have different lengths or missing data, you can standardize the dataset structure:
The padding operation ensures that all measurements have the same array lengths by filling missing values with NaN, which is essential for batch processing and vectorized operations.

Data Augmentation and Enhancement

Creating Synthetic Variations

Data augmentation is a powerful technique for increasing dataset size and diversity by creating controlled variations of existing measurements:
This technique is particularly valuable when preparing datasets for machine learning applications or when you need to test the robustness of analysis methods.

Controlling Augmentation Parameters

The augmentation process can be fine-tuned to match the characteristics of your experimental system:
Multiplicative noise is often more realistic for concentration measurements, as measurement errors typically scale with the magnitude of the signal.

Data Splitting and Cross-Validation

Train-Test Splits

For machine learning and model validation workflows, you can split datasets into training and testing portions:
This random splitting ensures that your training and testing sets are representative of the overall dataset distribution.

Leave-One-Out Cross-Validation

For thorough model validation, especially with limited data, you can use leave-one-out cross-validation:
This approach provides comprehensive validation by testing the model’s ability to predict each measurement when trained on all others.
This leave_one_out() helper is a dataset-splitting utility: it yields train/test folds for you to refit and evaluate yourself. If you have already fit a model with HMC and want a one-shot predictive score (without refitting), use the PSIS-LOO diagnostic on the results object instead — results.loo(dataset). See Leave-One-Out Cross-Validation (PSIS-LOO) for details.

Advanced Data Operations

Working with Observable States

In many experiments, not all states in your model are directly observable. Catalax provides methods to work specifically with measured states:
This functionality is essential when working with complex models where some states are intermediates or unmeasured components.

Creating Configuration Objects

You can extract simulation configurations directly from datasets that contain time-series data:
This feature is particularly useful when you want to simulate models using the same temporal parameters as your experimental measurements.

Batch Processing Utilities

For large datasets, Catalax provides utilities to determine appropriate vectorization strategies:
These utilities help ensure efficient computation when working with large datasets in vectorized operations.

Integration with Analysis Workflows

Model Evaluation

Datasets provide direct interfaces for evaluating model performance:
The metrics calculation automatically handles the comparison between model predictions and experimental data, providing comprehensive statistics for model evaluation.

Visualization and Plotting

Datasets include sophisticated plotting capabilities that handle multiple measurements and model comparisons:
The plotting system automatically handles multiple measurements, creates appropriate subplot layouts, and provides clean visualizations for publication and presentation.