anndict.utils.build_adata_from_transcript_positions

anndict.utils.build_adata_from_transcript_positions#

anndict.utils.build_adata_from_transcript_positions(paths_dict, box_size=16, step_size=16, platform='Merscope')[source]#

Builds an AnnData object from a detected_transcripts.csv (Merscope) or transcripts.csv (Xenium) file and saves it to a specified output path. These are the files output by most spatial transcriptomic platforms, including Visium, Visium HD, Xenium, and Merscope.

Parameters:
paths_dict dict[str, str]

A dictionary with input paths as keys and output paths as values.

box_size int (default: 16)

The size of the box.

step_size int (default: 16)

The step size.

platform Literal['Merscope', 'Xenium'] (default: 'Merscope')

The platform used, either “Merscope” (default) or “Xenium”.

Return type:

None

Returns:

None

Notes

Writes the processed AnnData objects to the specified output paths.

Example

# Define input and output paths
paths_dict = {
    'input_path1.csv': 'output_path1.h5ad',
    'input_path2.csv': 'output_path2.h5ad'
}
# Write AnnData objects to output paths
build_adata_from_transcript_positions(paths_dict)