Datasets:
Sricharan Reddy Varra
commited on
Commit
·
56f4643
1
Parent(s):
2b603f5
added other spatial configs
Browse files- ark_example.py +23 -3
ark_example.py
CHANGED
|
@@ -33,6 +33,7 @@ TMA24_R9C1 -> fov10
|
|
| 33 |
|
| 34 |
"""
|
| 35 |
|
|
|
|
| 36 |
import datasets
|
| 37 |
import pathlib
|
| 38 |
|
|
@@ -57,8 +58,6 @@ _LICENSE = "https://github.com/angelolab/ark-analysis/blob/main/LICENSE"
|
|
| 57 |
|
| 58 |
# The HuggingFace Datasets library doesn't host the datasets but only points to the original files.
|
| 59 |
# This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
|
| 60 |
-
# _URL_REPO = "https://huggingface.co/datasets/angelolab/ark_example"
|
| 61 |
-
|
| 62 |
|
| 63 |
_URL_DATA = {
|
| 64 |
"image_data": "./data/image_data.zip",
|
|
@@ -99,6 +98,16 @@ _URL_DATASET_CONFIGS = {
|
|
| 99 |
"image_data": _URL_DATA["image_data"],
|
| 100 |
"cell_table": _URL_DATA["cell_table"],
|
| 101 |
"spatial_lda": _URL_DATA["spatial_lda"],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
}
|
| 103 |
}
|
| 104 |
|
|
@@ -154,7 +163,16 @@ class ArkExample(datasets.GeneratorBasedBuilder):
|
|
| 154 |
version=VERSION,
|
| 155 |
description="This configuration contains data used by the Spatial LDA - Training and Inference Notebook."
|
| 156 |
),
|
| 157 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
]
|
| 159 |
|
| 160 |
def _info(self):
|
|
@@ -167,6 +185,8 @@ class ArkExample(datasets.GeneratorBasedBuilder):
|
|
| 167 |
"fiber_segmentation",
|
| 168 |
"LDA_preprocessing",
|
| 169 |
"LDA_training_inference",
|
|
|
|
|
|
|
| 170 |
]:
|
| 171 |
features = datasets.Features(
|
| 172 |
{f: datasets.Value("string") for f in _URL_DATASET_CONFIGS[self.config.name].keys()}
|
|
|
|
| 33 |
|
| 34 |
"""
|
| 35 |
|
| 36 |
+
from ensurepip import version
|
| 37 |
import datasets
|
| 38 |
import pathlib
|
| 39 |
|
|
|
|
| 58 |
|
| 59 |
# The HuggingFace Datasets library doesn't host the datasets but only points to the original files.
|
| 60 |
# This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
|
|
|
|
|
|
|
| 61 |
|
| 62 |
_URL_DATA = {
|
| 63 |
"image_data": "./data/image_data.zip",
|
|
|
|
| 98 |
"image_data": _URL_DATA["image_data"],
|
| 99 |
"cell_table": _URL_DATA["cell_table"],
|
| 100 |
"spatial_lda": _URL_DATA["spatial_lda"],
|
| 101 |
+
},
|
| 102 |
+
"neighborhood_analysis": {
|
| 103 |
+
"image_data": _URL_DATA["image_data"],
|
| 104 |
+
"cell_table": _URL_DATA["cell_table"],
|
| 105 |
+
"deepcell_output": _URL_DATA["deepcell_output"],
|
| 106 |
+
},
|
| 107 |
+
"pairwise_spatial_enrichment": {
|
| 108 |
+
"image_data": _URL_DATA["image_data"],
|
| 109 |
+
"cell_table": _URL_DATA["cell_table"],
|
| 110 |
+
"deepcell_output": _URL_DATA["deepcell_output"],
|
| 111 |
}
|
| 112 |
}
|
| 113 |
|
|
|
|
| 163 |
version=VERSION,
|
| 164 |
description="This configuration contains data used by the Spatial LDA - Training and Inference Notebook."
|
| 165 |
),
|
| 166 |
+
datasets.BuilderConfig(
|
| 167 |
+
name="neighborhood_analysis",
|
| 168 |
+
version=VERSION,
|
| 169 |
+
description="This configuration contains data used by the Neighborhood Analysis Notebook."
|
| 170 |
+
),
|
| 171 |
+
datasets.BuilderConfig(
|
| 172 |
+
name="pairwise_spatial_enrichment",
|
| 173 |
+
version=VERSION,
|
| 174 |
+
description="This configuration contains data used by the Pairwise Spatial Enrichment Notebook."
|
| 175 |
+
)
|
| 176 |
]
|
| 177 |
|
| 178 |
def _info(self):
|
|
|
|
| 185 |
"fiber_segmentation",
|
| 186 |
"LDA_preprocessing",
|
| 187 |
"LDA_training_inference",
|
| 188 |
+
"neighborhood_analysis",
|
| 189 |
+
"pairwise_spatial_enrichment",
|
| 190 |
]:
|
| 191 |
features = datasets.Features(
|
| 192 |
{f: datasets.Value("string") for f in _URL_DATASET_CONFIGS[self.config.name].keys()}
|