Skip to content

Commit 88566df

Browse files
authored
Merge pull request #45 from HiDiHlabs/main
Merge main into py312
2 parents 02744e2 + 310a364 commit 88566df

23 files changed

Lines changed: 3502 additions & 1303 deletions

.github/workflows/cibuildwheel.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@ jobs:
1515
runs-on: ${{ matrix.os }}
1616
strategy:
1717
matrix:
18-
# macos-13 is an intel runner, macos-14 and up is apple silicon
19-
os: [ubuntu-latest, windows-latest, macos-13, macos-latest]
18+
os:
19+
- ubuntu-latest
20+
- ubuntu-24.04-arm
21+
- windows-latest
22+
- macos-latest
23+
- macos-26-intel
2024

2125
steps:
2226
- uses: actions/checkout@v6
@@ -30,9 +34,6 @@ jobs:
3034

3135
- name: Build wheels
3236
uses: pypa/cibuildwheel@v3.4.1
33-
env:
34-
CIBW_ENVIRONMENT: ${{ matrix.os == 'macos-13' && 'MACOSX_DEPLOYMENT_TARGET=13.0' || '' }}
35-
CIBW_ENVIRONMENT_LINUX: 'PATH=$PATH:$HOME/.cargo/bin'
3637

3738
- uses: actions/upload-artifact@v6
3839
with:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@ generated
1212
apidocs
1313
dist
1414
jupyter_execute
15+
.ipynb_checkpoints
16+
*.pickle
1517

1618
settings.json

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ repos:
2121
rev: v0.15.15
2222
hooks:
2323
- id: ruff-check
24+
exclude: ^docs/source/.*/(?:tips|export)\.ipynb$
2425
- id: ruff-format
2526
- repo: https://github.com/pre-commit/mirrors-mypy
2627
rev: v2.1.0

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ num = { version = "0.4.1" }
1818
numpy = { version = "0.27" }
1919
polars = { version = "0.53", features = ["partition_by", "dtype-categorical"] }
2020
polars-arrow = { version = "0.53" }
21-
pyo3 = { version = "0.27", features = ["extension-module"] }
21+
pyo3 = { version = "0.27", features = ["extension-module", "abi3"] }
2222
pyo3-polars = { version = "0.26", features = ["dtype-categorical"] }
2323
rayon = { version = "1.8" }
2424
sprs = { version = "0.11.4", features = ["serde"] }

docs/source/_static/science.mp3

7.17 KB
Binary file not shown.

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
8181

8282
html_theme = "sphinx_rtd_theme"
83-
html_static_path: list[str] = []
83+
html_static_path = ["_static"]
8484

8585

8686
def skip_submodules(app, what, name, obj, skip, options):

docs/source/index.rst

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,36 @@
11
What is sainsc?
22
===================
33

4-
sainsc (pronounced /ˈsaiəns/) is a segmentation-free analysis tool for spatial
4+
.. |audio_science| raw:: html
5+
6+
<button onclick="new Audio('_static/science.mp3').play()"
7+
style="border:none;background:none;cursor:pointer;padding:0;">
8+
🔊
9+
</button>
10+
11+
sainsc (pronounced /ˈsaiəns/|audio_science|, i.e., 'science') is a segmentation-free analysis tool for spatial
512
transcriptomics from in situ capture technologies (but also works for
613
imaging-based technologies).
714

815
It is easily integratable with the `scverse <https://github.com/scverse>`_
9-
(i.e. `scanpy` and `squidpy`) by exporting data in
16+
(i.e., `scanpy` and `squidpy`) by exporting data in
1017
`AnnData <https://anndata.readthedocs.io/>`_ or
1118
`SpatialData <https://spatialdata.scverse.org/>`_ format.
1219

1320
Citations
1421
---------
1522

16-
If you are using `sainsc` for your research please cite
23+
If you are using `sainsc` for your research, please cite
1724

1825
N. Müller-Bötticher, S. Tiesmeyer, R. Eils, N. Ishaque, "Sainsc: A Computational Tool
19-
for Segmentation-Free Analysis of In Situ Capture Data" *Small Methods* (2025)
20-
https://doi.org/10.1002/smtd.202401123
26+
for Segmentation-Free Analysis of In Situ Capture Data" *Small Methods* 9, 2401123 (2025)
27+
doi: `10.1002/smtd.202401123 <https://doi.org/10.1002/smtd.202401123>`_
2128

2229
.. toctree::
23-
:maxdepth: 1
30+
:maxdepth: 2
2431
:caption: Contents:
2532

2633
self
2734
quickstart
2835
installation
29-
usage
3036
tutorials/index

docs/source/installation.rst

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,26 +36,41 @@ If you prefer the installation using
3636
to speed up the installation.
3737

3838

39-
From GitHub
39+
From Source
4040
-----------
4141

42+
If you want to to build the package from source (either from GitHub or PyPI) you will need a Rust compiler.
43+
You can follow the `official Rust documentation <https://www.rust-lang.org/tools/install>`_ or,
44+
if you are using ``conda`` install it via ``conda install conda-forge::rust``.
45+
46+
To build the package from PyPI use
47+
48+
.. code-block:: bash
49+
50+
pip install --no-binary sainsc
51+
52+
53+
GitHub
54+
~~~~~~
55+
4256
You can install the latest versions directly from
43-
`GitHub <https://github.com/HiDiHlabs/sainsc>`_. To do so clone the repository using the
44-
``git clone`` command. Navigate into the downloaded directory and install using
57+
`GitHub <https://github.com/HiDiHlabs/sainsc>`_.
58+
To do so clone the repository using the ``git clone`` command.
59+
Navigate into the downloaded directory and install using
4560

4661
.. code-block:: bash
4762
4863
pip install .
4964
50-
.. note::
51-
If you want to to install the package from source (either from GitHub or with
52-
``pip install --no-binary sainsc``) you will need a Rust compiler. You can follow
53-
the `official Rust documentation <https://www.rust-lang.org/tools/install>`_ or,
54-
if you are using ``conda`` install it via ``conda install conda-forge::rust``.
55-
5665
If you want to install the development version you can install the additional optional
5766
dependencies with
5867

5968
.. code-block:: bash
6069
6170
pip install -e .[dev]
71+
72+
73+
.. warning::
74+
75+
If you install editable builds (``-e``) the Rust compiler will default to a debug build,
76+
i.e., the code is not optimized and slow. Don't use this for analysis (only for development)!

docs/source/quickstart.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
],
8484
"source": [
8585
"# location of the Stereo-seq data\n",
86-
"data_path = Path(\"path/to/StereoSeq/data\")\n",
86+
"data_path = Path(\"path/to/stereoseq_data\")\n",
8787
"\n",
8888
"brain = read_StereoSeq(\n",
8989
" data_path / \"Mouse_brain_Adult_GEM_bin1.tsv.gz\", resolution=500, n_threads=8\n",
@@ -331,9 +331,9 @@
331331
],
332332
"metadata": {
333333
"kernelspec": {
334-
"display_name": "Python 3",
334+
"display_name": "Python [conda env:sainsc]",
335335
"language": "python",
336-
"name": "python3"
336+
"name": "conda-env-sainsc-py"
337337
},
338338
"language_info": {
339339
"codemirror_mode": {
@@ -345,7 +345,7 @@
345345
"name": "python",
346346
"nbconvert_exporter": "python",
347347
"pygments_lexer": "ipython3",
348-
"version": "3.10.14"
348+
"version": "3.11.10"
349349
}
350350
},
351351
"nbformat": 4,

docs/source/tutorials/VisiumHD_CRC.ipynb

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
"tags": []
2020
},
2121
"source": [
22-
"In this tutorial we will look at a colorectal cancer (CRC) sample profiled using VisiumHD. The data is available from the 10X website (see [here](https://www.10xgenomics.com/datasets/visium-hd-cytassist-gene-expression-libraries-of-human-crc)).\n",
22+
"In this tutorial, we will look at a colorectal cancer (CRC) sample profiled using VisiumHD. The data is available from the 10x Genomics website (see [here](https://www.10xgenomics.com/datasets/visium-hd-cytassist-gene-expression-libraries-of-human-crc)).\n",
2323
"\n",
24-
"To follow along you will need to download the data and install some additional packages;\n",
24+
"To follow along, you will need to download the data and install some additional packages;\n",
2525
"`scanpy` and `spatialdata_io`."
2626
]
2727
},
@@ -116,9 +116,11 @@
116116
"tags": []
117117
},
118118
"source": [
119-
"First we will generate cell type signature based on the 16 µm bins VisiumHD. Theoretically this should also work when using the 8 µm bins or segmentation-based cells. The signatures are then later used to map the cell types to the original 2 µm resolution.\n",
119+
"First, we will generate cell-type signatures based on the 16 µm bins in VisiumHD.\n",
120+
"Theoretically, this should also work when using the 8 µm bins or segmentation-based cells.\n",
121+
"The signatures are then later used to map the cell types to the original 2 µm resolution.\n",
120122
"\n",
121-
"This whole section can be replaced by your favorite single-cell workflow. We will follow a simple workflow here as this is not the main purpose of this tutorial."
123+
"This whole section can be replaced by your favorite single-cell workflow. We will follow a simple workflow here, as this is not the main purpose of this tutorial."
122124
]
123125
},
124126
{
@@ -230,7 +232,9 @@
230232
"tags": []
231233
},
232234
"source": [
233-
"Now we apply our favorite workflow to find clusters/cell types. Remember that you can adjust the processing here to your liking! For example you could switch to spatially variable genes instead of highly variable."
235+
"Now we apply our favorite workflow to find clusters/cell types.\n",
236+
"Remember that you can adjust the processing here to your liking!\n",
237+
"For example, you could switch to spatially variable genes instead of highly variable."
234238
]
235239
},
236240
{
@@ -352,7 +356,9 @@
352356
"source": [
353357
"Now we are ready to generate the cell type signatures.\n",
354358
"\n",
355-
"The only thing to keep in mind if you don't follow the workflow above is that the signatures should be non-negative i.e. they should not be generated from z-scores or Pearson residuals, etc. which does not mean that you can't use these methods to do the cell typing just make sure to use the log-transformed counts to calculate the signatures.\n",
359+
"The only thing to keep in mind if you don't follow the workflow above is that the signatures should be non-negative, i.e., they should not be generated from z-scores or Pearson residuals, etc.\n",
360+
"This does not mean that you can't use these methods to do the cell typing.\n",
361+
"Just make sure to use the log-transformed counts to calculate the signatures.\n",
356362
"\n",
357363
"Here, we will only use the highly variable genes."
358364
]
@@ -609,9 +615,9 @@
609615
"tags": []
610616
},
611617
"source": [
612-
"To compare the cell typing we will plot the unbinned and binned data next to each other.\n",
618+
"To compare the cell typing, we will plot the unbinned and binned data next to each other.\n",
613619
"\n",
614-
"First lets get the images for the cell typing of the unbinned data. "
620+
"First, let's get the images for the cell typing of the unbinned data. "
615621
]
616622
},
617623
{
@@ -692,7 +698,8 @@
692698
"tags": []
693699
},
694700
"source": [
695-
"Now we are ready to compare the results. We will also include the KDE as it gives us an orientation of what the tissue looks like. "
701+
"Now we are ready to compare the results.\n",
702+
"We will also include the KDE, as it gives us an orientation of what the tissue looks like. "
696703
]
697704
},
698705
{

0 commit comments

Comments
 (0)