Skip to content

New reader for G4X datasets (Singular Genomics) #281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ dependencies = [
"readfcs",
"tifffile>=2023.8.12",
"ome-types",
"glymur",
]

[project.optional-dependencies]
Expand Down
2 changes: 2 additions & 0 deletions src/spatialdata_io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from spatialdata_io.readers.cosmx import cosmx
from spatialdata_io.readers.curio import curio
from spatialdata_io.readers.dbit import dbit
from spatialdata_io.readers.g4x import g4x
from spatialdata_io.readers.generic import generic, geojson, image
from spatialdata_io.readers.macsima import macsima
from spatialdata_io.readers.mcmicro import mcmicro
Expand All @@ -25,6 +26,7 @@
"cosmx",
"curio",
"dbit",
"g4x",
"macsima",
"mcmicro",
"merscope",
Expand Down
34 changes: 34 additions & 0 deletions src/spatialdata_io/_constants/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,3 +399,37 @@ class VisiumHDKeys(ModeEnum):
MICROSCOPE_COLROW_TO_SPOT_COLROW = ("microscope_colrow_to_spot_colrow",)
SPOT_COLROW_TO_MICROSCOPE_COLROW = ("spot_colrow_to_microscope_colrow",)
FILE_FORMAT = "file_format"


class G4XKeys(ModeEnum):
"""Keys for G4X formatted dataset."""

# H&E
HE_DIR = "h_and_e"
HE_PATTERN = "*.jp2"

# Nuclei
NUCLEI_BOUNDARIES_KEY = "nuclei"
CELL_BOUNDARIES_KEY = "nuclei_exp"
SEGMENTATION_DIR = "segmentation"
SEGMENTATION_PATTERN = "segmentation_mask.npz"
OFFSET = "-0.5"

# Protein
PROTEIN_KEY = "protein"
PROTEIN_DIR = "protein"
PROTEIN_PATTERN = "*.jp2"

# Transcripts
TRANSCRIPTS_KEY = "transcripts"
TRANSCRIPTS_DIR = "rna"
TRANSCRIPTS_PATTERN = "*transcript_table.csv.gz"
TRANSCRIPTS_COORD_X = "x_pixel_coordinate"
TRANSCRIPTS_COORD_Y = "y_pixel_coordinate"
TRANSCRIPTS_FEATURE_KEY = "gene_name"
TRANSCRIPTS_SWAP_XY = False

# Tables
TABLES_DIR = "single_cell_data"
TABLE_PATTERN = "feature_matrix.h5"
TABLE_KEY = "table"
Loading
Loading