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
TheDataset 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
ADataset 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 ofMeasurementobjects, 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 individualMeasurement 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 beNonefor 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:Adding Initial Conditions
Once you have a dataset structure, you can add initial conditions that represent different experimental scenarios or simulation starting points: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: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: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: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:From JAX Arrays
For computational workflows that work directly with numerical arrays, Catalax can import from JAX arrays with proper structure:Data Export and Sharing
Exporting to Croissant Format
The Croissant format provides a standardized way to package and share datasets with rich metadata:Converting to DataFrames
For analysis in other tools or export to spreadsheet formats, you can convert datasets to pandas DataFrames:Converting to JAX Arrays
For computational workflows, you can extract data as JAX arrays with proper structure:Data Validation and Quality Control
Checking Data Consistency
Catalax provides methods to validate data integrity and identify potential issues:Data Padding and Standardization
When working with measurements that have different lengths or missing data, you can standardize the dataset structure: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:Controlling Augmentation Parameters
The augmentation process can be fine-tuned to match the characteristics of your experimental system:Data Splitting and Cross-Validation
Train-Test Splits
For machine learning and model validation workflows, you can split datasets into training and testing portions:Leave-One-Out Cross-Validation
For thorough model validation, especially with limited data, you can use leave-one-out cross-validation: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.
