Input/Output#
- sparty.io.load_cosmx(path, dataset_id='R5941_ColonTMA', feature_key='target')#
Load cosmx data as SpatialData object
- Parameters:
- Return type:
- Returns:
SpatialData object
- sparty.io.load_merscope(path, slide_name, vpt_outputs=None, region_name='region_0', z_layers=2, feature_key='gene', layer='counts')#
Load vizgen merscope data as SpatialData object
- Parameters:
path (
str) – path to folder.vpt_outputs (
str(default:None)) – path to vpt folder.region_name (
str(default:'region_0')) – region_name id.slide_name (
str) – slide_name id.z_layers (
int(default:2)) – z layers to load.feature_key (
str(default:'gene')) – default column for feature name in transcripts.
- Return type:
- Returns:
SpatialData object
- sparty.io.load_xenium(path, layer='counts', region='cell_boundaries', feature_key='feature_name', instance_key='cell_id', table_key='table', spatial_key='spatial', index_table=True, n_jobs=1)#
Load xenium data as SpatialData object
- Parameters:
path (
str) – path to folder.index_table (
bool(default:True)) – rename the index in table.obs with the cell_idregion (
str(default:'cell_boundaries')) – default shape element for region in table.obs.feature_key (
str(default:'feature_name')) – default column for feature name in transcripts.n_jobs (
int(default:1)) – number of jobs to load the xenium object
- Return type:
- Returns:
SpatialData object
- sparty.io.shapes_from_xe(file, pixel_size=0.2125, plot_fig=True, ncols=4, return_gdf=True)#
Create polygons from a CSV file containing X/Y coordinates.
If the CSV has a ‘Selection’ column, one polygon is created per selection. Otherwise, the whole file is treated as one polygon.