Skip to content

Commit 0103021

Browse files
committed
added alignment functions
1 parent a2554d6 commit 0103021

9 files changed

Lines changed: 6976 additions & 0 deletions

File tree

src/xenium_analysis_tools/alignment/align_sections.py

Lines changed: 2001 additions & 0 deletions
Large diffs are not rendered by default.

src/xenium_analysis_tools/alignment/format_for_napari.py

Lines changed: 990 additions & 0 deletions
Large diffs are not rendered by default.

src/xenium_analysis_tools/example_notebooks/combine_sections.ipynb

Lines changed: 694 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
{
2+
"726465": {
3+
"xenium_name": "Xenium_726465_2024-09-18",
4+
"genotype": "Slc32a1-IRES-Cre;Oi1",
5+
"sectioning_depth": 450,
6+
"sections_thickness": 20
7+
},
8+
"738168": {
9+
"xenium_name": "Xenium_738168_2025-03-12",
10+
"genotype": "Slc32a1-IRES-Cre;Oi1",
11+
"sectioning_depth": 450,
12+
"sections_thickness": 20,
13+
"confocal_name": "confocal-thick-tissue_748168_2025-02-13_processed_2026-01-07_01-02-54",
14+
"raw_confocal_name": "confocal-thick-tissue_748168_2025-02-13",
15+
"zstack_name": "ophys-z-stacks_748168_registered",
16+
"zstack_masks_name": "ophys-z-stacks_748168_segmented"
17+
},
18+
"748168": {
19+
"xenium_name": "Xenium_738168_2025-03-12",
20+
"genotype": "Slc32a1-IRES-Cre;Oi1",
21+
"sectioning_depth": 450,
22+
"sections_thickness": 20,
23+
"confocal_name": "confocal-thick-tissue_748168_2025-02-13_processed_2026-01-07_01-02-54",
24+
"zstack_name": "ophys-z-stacks_748168_registered",
25+
"zstack_masks_name": "ophys-z-stacks_748168_segmented"
26+
},
27+
"760970": {
28+
"xenium_name": "Xenium_760970_2025-04-25",
29+
"genotype": "Slc32a1-IRES-Cre;Oi1",
30+
"sectioning_depth": 450,
31+
"sections_thickness": 20
32+
},
33+
"756772": {
34+
"xenium_name": "Xenium_756772_2025-04-23",
35+
"genotype": "Slc32a1-IRES-Cre;Oi1",
36+
"sectioning_depth": 450,
37+
"sections_thickness": 20,
38+
"confocal_name": "confocal-thick-tissue_756772_2025-04-09_processed_2026-01-07_00-36-19",
39+
"raw_confocal_name": "confocal-thick-tissue_756772_2025-04-09",
40+
"zstack_name": "ophys-z-stacks_756772_registered",
41+
"zstack_masks_name": "ophys-z-stacks_756772_segmented"
42+
},
43+
"759003": {
44+
"xenium_name": "Xenium_759003_2025-04-23",
45+
"genotype": "Slc32a1-IRES-Cre;Oi1",
46+
"sectioning_depth": 450,
47+
"sections_thickness": 20
48+
},
49+
"778174": {
50+
"xenium_name": "Xenium_778174_2025-05-07",
51+
"genotype": "Snap25-IRES2-Cre;Oi4",
52+
"sectioning_depth": 450,
53+
"sections_thickness": 20
54+
},
55+
"770057": {
56+
"xenium_name": "Xenium_770057_2025-07-17",
57+
"genotype": "Slc32a1-IRES-Cre;Oi1",
58+
"sectioning_depth": 450,
59+
"sections_thickness": 20
60+
},
61+
"786297": {
62+
"xenium_name": "Xenium_786297_2025-07-16",
63+
"genotype": "Snap25-IRES2-Cre;Oi4",
64+
"sectioning_depth": 450,
65+
"sections_thickness": 20
66+
},
67+
"775682": {
68+
"xenium_name": "Xenium_775682_2025-10-03",
69+
"genotype": "Slc32a1-IRES-Cre;Oi1",
70+
"sectioning_depth": 450,
71+
"sections_thickness": 20
72+
},
73+
"779891": {
74+
"xenium_name": "Xenium_779891_2025-10-03",
75+
"genotype": "Slc32a1-IRES-Cre;Oi1",
76+
"sectioning_depth": 450,
77+
"sections_thickness": 20
78+
},
79+
"797371": {
80+
"xenium_name": "Xenium_797371_2025-10-22",
81+
"genotype": "Snap25-IRES2-Cre;Oi4",
82+
"sectioning_depth": 600,
83+
"sections_thickness": 20,
84+
"confocal_name": "confocal-thick-tissue_797371_2025-09-25_processed_2026-01-06_23-00-58",
85+
"raw_confocal_name": "confocal-thick-tissue_797371_2025-09-25",
86+
"zstack_name": "ophys-z-stacks_797371_registered",
87+
"zstack_masks_name": "ophys-z-stacks_797371_segmented"
88+
},
89+
"806644": {
90+
"xenium_name": "Xenium_806644_2025-12-18",
91+
"genotype": "Snap25-IRES2-Cre;Oi4",
92+
"sectioning_depth": 600,
93+
"sections_thickness": 20
94+
},
95+
"804670": {
96+
"xenium_name": "Xenium_804670_2025-12-18",
97+
"genotype": "Slc32a1-IRES-Cre;Oi1",
98+
"sectioning_depth": 600,
99+
"sections_thickness": 20
100+
},
101+
"810976": {
102+
"xenium_name": "Xenium_810976_2026-02-07",
103+
"genotype": "Snap25-IRES2-Cre;Oi4",
104+
"sectioning_depth": 600,
105+
"sections_thickness": 20
106+
},
107+
"816462": {
108+
"xenium_name": "Xenium_816462_2026-02-07",
109+
"genotype": "Snap25-IRES2-Cre;Oi4",
110+
"sectioning_depth": 600,
111+
"sections_thickness": 20
112+
}
113+
}
114+

src/xenium_analysis_tools/example_notebooks/map_dataset.ipynb

Lines changed: 1834 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"zarr_settings": {
3+
"default_format": 3
4+
},
5+
"paths": {
6+
"data_root": "/root/capsule/data",
7+
"scratch_root": "/root/capsule/scratch",
8+
"results_root": "/root/capsule/results",
9+
"abc_path": "/root/capsule/data/abc_atlas",
10+
"mmc_path": "/root/capsule/data/abc_atlas/mapmycells"
11+
},
12+
"sdata_reader_params": {
13+
"n_jobs": "max",
14+
"cells_as_circles": true,
15+
"gex_only": false
16+
},
17+
"processing_control": {
18+
"save_initial_data_parent_folder": "results",
19+
"save_processed_data_parent_folder": "results",
20+
"save_mapped_data_parent_folder": "results",
21+
"save_initial_dataset_suffix": "_slides",
22+
"save_mapped_dataset_suffix": "_mapped",
23+
"save_processed_dataset_suffix": "_processed",
24+
"save_initial_dataset_prefix": "slide_",
25+
"save_processed_dataset_prefix": "section_",
26+
"check_data_folder_slides": false,
27+
"check_data_folder_sections": false,
28+
"check_data_folder_mapped": true
29+
},
30+
"validation_params": {
31+
"test_loading_data": false,
32+
"test_sizes": true,
33+
"plot_bboxes": true
34+
},
35+
"mapping_config": {
36+
"input_data_folder_name": "input_data",
37+
"input_h5ad_name": "input_cellxgene.h5ad",
38+
"mapped_data_folder_name": "mapped_data",
39+
"mapped_data_h5ad_name": "mapped_cellxgene.h5ad",
40+
"basic_results_name": "basic_results.csv",
41+
"extended_results_name": "extended_results.json",
42+
"overwrite_all_steps": false,
43+
"overwrite_input_data": false,
44+
"overwrite_running_mapping": false,
45+
"overwrite_formatting": false,
46+
"overwrite_merge": false,
47+
"validate_input": true,
48+
"filter_mapping_v1_types": {
49+
"enabled": true,
50+
"h_level": "subclass",
51+
"min_cells": 6,
52+
"saved_df_name": "v1_merfish_cells.csv"
53+
},
54+
"drop_nodes_dict": null,
55+
"var_filters": {
56+
"feature_types": {
57+
"eq": "Gene Expression"
58+
},
59+
"tag_feature": {
60+
"eq": false
61+
}
62+
},
63+
"mapping_params": {
64+
"normalization": "raw",
65+
"drop_level": "supertype",
66+
"mapping_type": "hrc",
67+
"bootstrap_iteration": 100,
68+
"bootstrap_factor": 0.5,
69+
"n_runner_ups": 2,
70+
"clobber": "1",
71+
"chunk_size": 15000,
72+
"num_workers": 8,
73+
"rng_seed": 42
74+
}
75+
}
76+
}

0 commit comments

Comments
 (0)