Skip to content

Python API

copick exposes an object-oriented Python API for cryoET datasets, plus functional helpers and the companion copick-utils and copick-torch libraries. Jump in with the cards below, or browse the full reference in the sidebar.

  • Base Classes


    The abstract data-entity and metadata models that define the copick object hierarchy.

    Browse base classes

  • Implementations


    Concrete backends: overlay, filesystem, CZ cryoET Data Portal, and mlcroissant.

    Browse implementations

  • Functional API


    Top-level helpers for opening projects and adding, getting, and syncing data.

    Browse functional API

  • copick-utils


    Converters, processing, logical operations, and I/O helpers built on copick.

    Browse copick-utils

  • copick-torch


    PyTorch datasets, augmentations, samplers, and filters for ML on cryoET data.

    Browse copick-torch

Abstract Data Entities

The copick API allows object-oriented access to cryoET data entities. Each data entity has a corresponding metadata model defined in pydantic. There is a set of abstract base classes that define the common interface for all data entities and the associated metadata models. The data entities are organized in a hierarchy that reflects the on-disk data model of copick and the structure of a typical cryoET dataset.

The abstract data entities are defined in the copick.models module and given in the table below.

Data Entity Class Metadata Class
Project Root CopickRoot CopickConfig
... Copick Object CopickObject PickableObject
... Run CopickRun CopickRunMeta
...... Picks CopickPicks CopickPicksFile
...... Mesh CopickMesh CopickMeshMeta
...... Segmentation CopickSegmentation CopickSegmentationMeta
...... Voxel Spacing CopickVoxelSpacing CopickVoxelSpacingMeta
......... Tomogram CopickTomogram CopickTomogramMeta
......... Features CopickFeatures CopickFeaturesMeta

Implementations

There are concrete implementations of the abstract data entities that are used to access data in a copick dataset.

  • Overlay: An extenstion to the abstract copick API implementation that adds methods to seamlessly overlay data from different sources.
  • Filesystem: A concrete implementation that reads and writes data to any storage supported by fsspec.