10X Xenium Starter Tutorial¶
Input Data¶
This tutorial uses SGE data generated with the 10x Genomics Xenium platform, and it has been cropped to a small region of the adult mouse brain for demonstration purposes.
File Format
10X Genomics Xenium platform outputs Spatial Gene Expression (SGE) data in a comma-separated values (CSV) format.
CSV File Format
1 2 3 4 |
|
- "
transcript_id
": Unique identifier for each detected transcript molecule. - "
cell_id
": ID of the segmented cell associated with the transcript. - "
overlaps_nucleus
": 1 if the transcript overlaps the nucleus mask, 0 otherwise. - "
feature_name
": Gene or other features name corresponding to the transcript. - "
x_location
": X-coordinate of the transcript. - "
y_location
": Y-coordinate of the transcript. - "
z_location
": Z-coordinate (depth) of the transcript. - "
qv
": Quality value indicating confidence in transcript detection.
Data Access
The example data is hosted on Zenedo ().
Follow the commands below to download the example data.
1 2 3 4 |
|
Set Up the Environment¶
Define paths to all required binaries and resources, and target AWS S3 bucket. Optionally, specify a fixed color map for consistent rendering.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
Define data ID and analysis parameters:
1 2 3 4 5 6 7 8 |
|
How to Define Scaling Factors for Xenium
The Xenium example data currently used here provides SGE in micrometer units. Use define scaling factor from coordinate to micrometer as 1.
SGE Format Conversion¶
Convert the raw input to the unified SGE format. See more details in Reference page.
1 2 3 4 5 6 7 8 9 10 |
|
Parameter | Required | Type | Description |
---|---|---|---|
--platform |
required | string | Platform (options: "10x_visium_hd ", "seqscope ", "10x_xenium ", "bgi_stereoseq ", "cosmx_smi ", "vizgen_merscope ", "pixel_seq ", "generic ") |
--in-csv |
required | string | Path to the input TSV/CSV file |
--units-per-um |
required | float | Scale to convert coordinates to microns (default: 1.0 ) |
--out-dir |
required | string | Output directory for the converted SGE files |
--makefn |
string | File name for the generated Makefile (default: sge_convert.mk ) |
|
--exclude-feature-regex |
regex | Pattern to exclude control features | |
--sge-visual |
flag | Enable SGE visualization step (generates diagnostic image) (default: FALSE ) |
|
--spatula |
string | Path to the spatula binary (default: spatula ) |
|
--n-jobs |
int | Number of parallel jobs for processing (default: 1 ) |
FICTURE
analysis¶
Compute spatial factors using punkst
(FICTURE2 mode). See more details in Reference page.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
Parameter | Required | Type | Description |
---|---|---|---|
--main |
required 1 | flag | Enable cartloader to run all five steps |
--in-transcript |
required | string | Path to input transcript-level SGE file |
--out-dir |
required | string | Path to output directory |
--width |
required | int or comma-separated list | LDA training hexagon width(s) |
--n-factor |
required | int or comma-separated list | Number of LDA factors |
--makefn |
string | File name for the generated Makefile (default: run_ficture2.mk ) |
|
--in-feature |
string | Path to input feature file | |
--in-minmax |
string | Path to input coordinate min/max file | |
--cmap-file |
string | Path to color map file | |
--exclude-feature-regex |
regex | Pattern to exclude features | |
--spatula |
string | Path to the spatula binary (default: spatula ) |
|
--ficture2 |
string | Path to the punkst directory (defaults to punkst repository within submodules directory of cartloader ) |
|
--n-jobs |
int | Number of parallel jobs (default: 1 ) |
|
--threads |
int | Number of threads per job (default: 1 ) |
1: cartloader
requires the user to specify at least one action. Available actions includes: --tile
to run tiling step; --segment
to run segmentation step; --init-lda
to run LDA training step; --decode
to run decoding step; --summary
to run summarization step; --main
to run all above five actions.
cartloader
Compilation¶
Generate pmtiles and web-compatible tile directories. See more details in Reference page.
1 2 3 4 5 6 7 8 9 10 |
|
Parameter | Required | Type | Description |
---|---|---|---|
--fic-dir |
required | string | Path to the input directory containing FICTURE2 output |
--out-dir |
required | string | Path to the output directory for PMTiles and web tiles |
--id |
required | string | Dataset ID used for naming outputs and metadata |
--makefn |
string | File name for the generated Makefile (default: run_cartload2.mk ) |
|
--spatula |
string | Path to the spatula binary (default: spatula ) |
|
--pmtiles |
string | Path to the pmtiles binary (default: pmtiles ) |
|
--tippecanoe |
string | Path to the tippecanoe binary (default: tippecanoe ) |
|
--n-jobs |
int | Number of parallel jobs (default: 1 ) |
|
--threads |
int | Number of threads per job (default: 1 ) |
Upload to Data Repository¶
AWS Uploads¶
Copy the generated cartloader outputs to your designated AWS S3 catalog path:
1 2 3 4 5 |
|
Parameter | Required | Type | Description |
---|---|---|---|
--in-dir |
required | string | Path to the input directory containing the cartloader compilation output |
--s3-dir |
required | string | Path to the target S3 directory for uploading |
--aws |
string | Path to the AWS CLI binary | |
--n-jobs |
int | Number of parallel jobs |