Format conversion

This tutorial will show how to implement basic format conversions using the complementary pipeline SAW convert. To make this utility more straightforward and concise, several pipelines have been created under SAW convert. The sub-pipeline is usually named as "A2B", which signifies the switching from A-form to B-form.

Select the one you need for format conversion.

visualization

Conversion from a raw GEF to a visualization GEF.

The raw GEF only saves the gene expression in the bin1 dimension to prevent the output file from becoming too large. For GEF to be visualized in StereoMap, it is necessary to have comprehensive information on various bin sizes, usually with a bin list of [ 1, 5, 10, 20, 50, 100, 150, 200].

saw convert visualization \
    --gef=/path/to/input/GEF \
    --bin-size=1,5,10,20,50,100,150,200 \
    --visualization-gef=/path/to/output/visualization/GEF

gef2gem

Conversion from a bin GEF to a GEM.

The feature expression recorded in GEM has only one type of bin size, so you have to set --bin-size for the conversion.

saw convert gef2gem \
    --gef=/path/to/input/GEF \
    --bin-size=1 \
    --gem=/path/to/output/GEM

Conversion from a cellbin GEF to a cellbin GEM.

circle-info

It is important to note that the corresponding bin GEF is necessary to obtain DNB information, during the conversion from cellbin GEF to cellbin GEM.

gem2gef

Conversion from a GEM to a bin GEF.

  • If your input GEM is of bin1, the output GEF will be a visualization GEF that includes expression counts of bin1, 5, 10, 20, 50, 100, 150, 200.

  • If your input GEM is not of bin1, the output GEF will contain the expression counts of that specific bin size.

Conversion from a cellbin GEM to a cellbin GEF.

bin2cell

Conversion from a bin GEF to a cellbin GEF.

circle-info

A cell segmentation mask is used to delineate the boundaries of individual cells, which is then utilized to generate an expression matrix at the cell dimension.

gef2h5ad

Conversion from a bin GEF to an AnnData H5AD.

circle-info

AnnData H5ADarrow-up-right is a widely used data format to start downstream analysis. And AnnData package version >= 0.8.0.

Conversion from a cellbin GEF to an AnnData H5AD.

gem2h5ad

Conversion from a GEM to an AnnData H5AD.

Conversion from a cellbin GEF to an AnnData H5AD.

gef2img

Plot a heatmap of a bin GEF.

It supports using feature expression matrix to generate a grayscale image heatmap of the spatial expression.

tar2img

Extract TIFF images from an image .tar.gz file. Usually including a microscope image aligned with the matrix, a tissue segmentation image and a cell segmentation image, if required algorithmic or manual processing results are recorded in the image .tar.gz file.

img2rpi

Conversion from TIFF images to an RPI file, used in StereoMap.

circle-info

Layer names can be set arbitrarily, but follow the format of <stain_type>/<image_type>, like DAPI/TissueMask. For the image of cell segmentation, we recommend you setting the layer name with a prefix of "CellMask", so that StereoMap display cell borders directly.

merge

Merge images (up to three) into one image.

circle-info

Note that the order of the image input represents its color channel, R-G-B.

Merged image of microscopy image ssDNA_SS200000135TL_D1_regist.tif and tissue segmentation mask file ssDNA_SS200000135TL_D1_tissue_cut.tif to evaluate the performance of tissue segmentation.

Part of the merged image of the microscopy image ssDNA_SS200000135TL_D1_regist.tif and cell segmentation mask file ssDNA_SS200000135TL_D1_mask.tif to evaluate the performance of cell segmentation.

overlay

Stack the template points onto the image, to check whether the image template crosspoints derived by image QC are accurate.

circle-info

The matrix template file, <stain_type>_matrix_template.txt, can be found in visualization.tar.gz.

Stack the matrix template onto ssDNA_SS200000135TL_D1_regist.tif image to verify the registration outcome.

Last updated