spatialdata_io.cosmx

Contents

spatialdata_io.cosmx#

spatialdata_io.cosmx(path, dataset_id=None, transcripts=True, imread_kwargs=mappingproxy({}), image_models_kwargs=mappingproxy({}))#

Read Cosmx Nanostring data.

This function reads the following files:

  • <dataset_id>_`'exprMat_file.csv'`: Counts matrix.

  • <dataset_id>_`'metadata_file.csv'`: Metadata file.

  • <dataset_id>_`'fov_positions_file.csv'`: Field of view file.

  • 'CellComposite': Directory containing the images.

  • 'CellLabels': Directory containing the labels.

Parameters:
  • path (str | Path) – Path to the root directory containing Nanostring files.

  • dataset_id (Optional[str] (default: None)) – Name of the dataset.

  • transcripts (bool (default: True)) – Whether to also read in transcripts information.

  • imread_kwargs (Mapping[str, Any] (default: mappingproxy({}))) – Keyword arguments passed to dask_image.imread.imread().

  • image_models_kwargs (Mapping[str, Any] (default: mappingproxy({}))) – Keyword arguments passed to spatialdata.models.Image2DModel.

Return type:

SpatialData

Returns:

: spatialdata.SpatialData