Skip to main content

Convert Stereo-seq data to 10X Genomics Xenium format.

Project description

install

conda activate 
pip install stereo2xenium

usage

inDir="/media/dell/data2/Stereo/eyeball/mmEyeBall/outs/feature_expression"
outDir="/media/dell/data2/Stereo/eyeball/toXenium"
SN=C04687E314
stereo2xenium convert --input ${inDir} --output ${outDir} --sample ${SN} --genome GRCm39 --cellbin_gem
stereo2xenium viewh5 --h5file ${inDir}/C04687E314.adjusted.cellbin.gef

rotate and flip

# determine the rotation angle 调整旋转角度
file="/media/dell/scRNA/spatial/Stereo/brainC04042E3/outs/visualization/C04042E3.adjusted.cellbin.gef"
outDir="/media/dell/scRNA/spatial/Stereo/brainC04042E3/toXenium"
# plot cell centroids without rotation
stereo2xenium plotRotation --file ${file} --output ${outDir} 
# try different theta value to rotate the image clockwisely or anticlockwisely.
stereo2xenium plotRotation --file ${file} --output ${outDir} --theta 138 --anticlockwise 

# Run stereo2xenium with proper theta values. 
# All of the coordination, including cell centroids, cell boundaries, and transcripts, will be rotated.
inDir="/media/dell/scRNA/spatial/Stereo/brainC04042E3/outs/visualization"   
outDir="/media/dell/scRNA/spatial/Stereo/brainC04042E3/toXenium"   
SN="C04042E3"  

stereo2xenium convert --input ${inDir} --output ${outDir} --sample ${SN} --segmentation 'HE' --genome mm10 --anticlockwise --theta 130

image-20260127061837591

image-20260127061951636

Mapping molecules to cells

  1. The stereo-seq output data typically does not include the cellbin.gem file, which is required for mapping molecules to cells.

  2. To generate this file, first run saw convert to retrieve the cellbin.gem. Then, run stereo2xenium convert to process the data.

  3. If stereo2xenium convert has already been executed, you can run stereo2xenium getTranscripts separately to complete the mapping of molecules to cells.

  4. Warning:

    Mapping molecules to cells is time- and memory-intensive and is not required for downstream analysis.

    You can skip it by running stereo2xenium convert without --cellbin_gem.

inDir=/media/dell/scRNA/spatial/Stereo/brainC04042E3/outs/visualization
SN=C04042E3

saw convert --threads-num 16 gef2gem --bin-size 1 \
--gef ${inDir}/${SN}.tissue.gef \
--cellbin-gef ${inDir}/${SN}.adjusted.cellbin.gef \
--cellbin-gem ${inDir}/${SN}.adjusted.cellbin.gem 

gzip ${inDir}/${SN}.adjusted.cellbin.gem

stereo2xenium convert --input ${inDir} --output ${outDir} --sample ${SN} --segmentation 'HE' --genome mm10 --cellbin_gem --anticlockwise --theta 130

stereo2xenium getTranscripts --input ${inDir} --sample ${SN} --output ${outDir} --cellbin_gem --theta 130 --anticlockwise

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stereo2xenium-0.2.6.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stereo2xenium-0.2.6-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file stereo2xenium-0.2.6.tar.gz.

File metadata

  • Download URL: stereo2xenium-0.2.6.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.20

File hashes

Hashes for stereo2xenium-0.2.6.tar.gz
Algorithm Hash digest
SHA256 045adc09cf4be1fbd2b5bf500fe982a297349fa8c8e0c9e8110f1b5ef707b7b7
MD5 a1a1df6d4df2ee88f8e1d2c2b780df3c
BLAKE2b-256 0f28bf88f54304b5507659a8728009562e82d50b72fd4482ef98ab3cbdaa5804

See more details on using hashes here.

File details

Details for the file stereo2xenium-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: stereo2xenium-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.20

File hashes

Hashes for stereo2xenium-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 80385f0cf173c0500541fe29550fb2f3660e8ac6b1f44f1a9d43861c2edff8af
MD5 b314f79b0720db37ee7d9f99a2fd856c
BLAKE2b-256 abbc81784b7ae9777fa3d5ad430ed9e23eba4c4fee2c5ce21956dc3b9e785622

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page