You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`--compression-level` - Compression level: 1-9 for zstd/gzip, 1-11 for brotli (default: `3`)
148
+
-`--use-pyarrow` / `--no-pyarrow` - Use pyarrow backend for parquet writes (default: `True`)
149
+
150
+
**HGNC Gene Mapping:**
151
+
-`--mappers` / `-m` - Path to HGNC mappers pickle file (optional, auto-created if needed)
152
+
-`--create-hgnc` - Force creation of HGNC mapper (default: auto-created only if needed)
153
+
154
+
**HuggingFace Upload:**
155
+
-`--repo-id` / `-r` - HuggingFace repository ID (e.g., `username/dataset-name`)
156
+
-`--token` / `-t` - HuggingFace API token (can also use `HF_TOKEN` env var)
157
+
158
+
**Publication Metadata:**
159
+
-`--lookup-publication` / `--no-lookup-publication` - Enable/disable CellxGene API lookup (default: enabled)
160
+
161
+
**Logging:**
162
+
-`--log-dir` - Directory for log files, separate log per file (default: `./logs`)
163
+
164
+
**Other:**
165
+
-`--keep-interim` - Keep interim parquet files after processing (default: False, cleaned up to save space)
166
+
167
+
### Publication Metadata Lookup
168
+
169
+
For datasets from [CellxGene Discover](https://cellxgene.cziscience.com/), publication metadata lookup is **enabled by default**. This automatically adds publication information:
170
+
171
+
```bash
172
+
# Publication lookup is enabled by default
173
+
uv run preprocess run ./data/input/10cc50a0-af80-4fa1-b668-893dd5c0113a.h5ad
174
+
175
+
# To disable publication lookup
176
+
uv run preprocess run ./data/input/file.h5ad --no-lookup-publication
177
+
178
+
# In batch mode (enabled by default)
179
+
uv run preprocess run --batch-mode --input-dir ./data/input
180
+
```
181
+
182
+
This queries the CellxGene API and adds the following columns to your output:
183
+
-`collection_id` - CellxGene collection ID
184
+
-`publication_title` - Title of the associated publication/collection
185
+
-`publication_doi` - DOI of the publication (if available)
186
+
-`publication_contact` - Contact name for the publication
187
+
188
+
**Note:** The API lookup may fail for some datasets if:
189
+
- The dataset is not from CellxGene Discover
190
+
- The CellxGene API changes
191
+
- Network issues occur
192
+
193
+
When lookup fails, processing continues without publication metadata.
194
+
120
195
### Run Individual Steps (Legacy Two-Step Approach)
121
196
122
197
If you need more control, you can run individual steps. Note: This creates interim files.
123
198
124
-
#### Step 1: Create HGNC Mapper
199
+
#### Download Dataset
125
200
126
201
```bash
127
-
uv run preprocess step1-hgnc-mapper --interim-dir ./data/interim
202
+
# Download with default URL (AIDA dataset)
203
+
uv run preprocess download
204
+
205
+
# Download from custom URL
206
+
uv run preprocess download --url https://example.com/dataset.h5ad
207
+
208
+
# Specify output directory and filename
209
+
uv run preprocess download \
210
+
--url https://example.com/dataset.h5ad \
211
+
--input-dir ./data/input \
212
+
--filename custom_name.h5ad
213
+
214
+
# Force re-download even if file exists
215
+
uv run preprocess download --force
128
216
```
129
217
130
-
#### Step 2: Convert H5AD to Parquet (Two-Step Approach)
218
+
**Download Command Options:**
219
+
-`--url` / `-u` - URL to download dataset from (default: AIDA dataset URL)
220
+
-`--input-dir` / `-i` - Directory to save downloaded files (default: `./data/input`)
221
+
-`--filename` / `-f` - Optional filename (if not provided, extracted from URL)
222
+
-`--force` - Force re-download even if file exists
223
+
-`--log-file` / `-l` - Path to eliot log file (optional)
131
224
132
-
**Note:** The `run-all` command now uses the one-step approach which is more efficient.
133
-
Use this only if you need separate steps.
225
+
#### Create HGNC Mapper
134
226
135
227
```bash
136
-
# Auto-detect h5ad from input folder
137
-
uv run preprocess step2-convert-h5ad --input-dir ./data/input
138
-
139
-
# Or specify file explicitly
140
-
uv run preprocess step2-convert-h5ad /path/to/file.h5ad \
141
-
--mappers ./data/interim/hgnc_mappers.pkl \
142
-
--interim-dir ./data/interim/parquet_chunks \
143
-
--chunk-size 10000 \
144
-
--top-genes 2000
228
+
# Create HGNC mapper explicitly (usually auto-created when needed)
229
+
uv run preprocess hgnc-mapper --interim-dir ./data/interim
-`--interim-dir` / `-i` - Directory to save interim files (HGNC mappers) (default: `./data/interim`)
237
+
-`--log-file` / `-l` - Path to eliot log file (optional)
148
238
149
-
This step can be skipped if you want users on HuggingFace to decide on their own splitting strategy. Use `--skip-train-test-split` flag in the `run-all` command.
239
+
#### Upload to HuggingFace
150
240
151
241
```bash
152
-
uv run preprocess step3-train-test-split \
153
-
--interim-dir ./data/interim/parquet_chunks \
242
+
# Upload a single dataset directory (uses default repo-id if not specified)
0 commit comments