somacore provides the Python-language API specification and base utilities for the SOMA (Scalable Open Multi-omics Array) system. It defines abstract base classes and protocols for core SOMA objects like Experiment, Measurement, DataFrame, and Arrays. As of version 1.0.29, it focuses on defining the SOMA data model for interoperability. The library is actively maintained with frequent updates, often aligning with updates to the broader SOMA specification.
pip install somacoreVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates importing core `somacore` types and enumerations. It highlights that `somacore` provides abstract definitions and protocols for the SOMA data model, which are not directly instantiable. Instead, concrete implementations (like `tiledbsoma`) are required to create and manipulate SOMA objects. The example shows how to access the library version and inspect available enumeration values.
Update your code to conform to the SOMA API v1.0 specification. Consult `somacore` 1.x documentation and migration guides for your chosen SOMA implementation (e.g., `tiledbsoma`) to adapt to the new API.
To work with actual SOMA objects and data, you must install and use a specific SOMA implementation library (e.g., `tiledbsoma`), which provides concrete classes that adhere to the `somacore` protocols and handles data persistence.
Use concrete SOMA object classes provided by an implementation library (e.g., `tiledbsoma.SOMACollection`) when creating or interacting with SOMA data structures. `somacore` types should primarily be used for type hinting.
Import and use concrete SOMA object classes provided by an implementation library, such as `tiledbsoma.SOMACollection` or `tiledbsoma.SOMADataFrame`, which adhere to the `somacore` protocols.
`somacore` provides abstract definitions. For concrete SOMA objects like `Experiment` or `DataFrame` that you can instantiate and populate, you need to import them from a specific SOMA implementation library (e.g., `from tiledbsoma import Experiment`).
Concrete SOMA objects like `Experiment` are typically provided by SOMA implementation libraries (e.g., `tiledbsoma`) and imported from their top-level package, not from `somacore` or its submodules. Check the documentation of your chosen SOMA implementation.