diff --git a/.github/ISSUE_TEMPLATE/custom.md b/.github/ISSUE_TEMPLATE/custom.md index 48d5f81f..b894315f 100644 --- a/.github/ISSUE_TEMPLATE/custom.md +++ b/.github/ISSUE_TEMPLATE/custom.md @@ -6,5 +6,3 @@ labels: '' assignees: '' --- - - diff --git a/.gitignore b/.gitignore index e24ef273..726e1fe7 100644 --- a/.gitignore +++ b/.gitignore @@ -100,4 +100,4 @@ coverage.xml *.cover *.py,cover .hypothesis/ -.pytest_cache/ \ No newline at end of file +.pytest_cache/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3c877354..320d742c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,6 +25,3 @@ repos: - id: end-of-file-fixer - id: check-yaml - id: debug-statements - - id: double-quote-string-fixer - - id: name-tests-test - - id: requirements-txt-fixer diff --git a/LICENSE b/LICENSE index 42156c31..9cc7d10b 100644 --- a/LICENSE +++ b/LICENSE @@ -26,4 +26,4 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md index b1f3dcea..f047802b 100644 --- a/README.md +++ b/README.md @@ -108,4 +108,4 @@ Our article is not published yet. In the meantime, you can cite our [preprint](h eprint = {https://www.biorxiv.org/content/early/2023/12/23/2023.12.22.571863.full.pdf}, journal = {bioRxiv} } -``` \ No newline at end of file +``` diff --git a/docs/api/_sdata.md b/docs/api/_sdata.md index 1c5451c1..8683d4ee 100644 --- a/docs/api/_sdata.md +++ b/docs/api/_sdata.md @@ -23,4 +23,4 @@ ::: sopa._sdata.get_spatial_image options: - show_root_heading: true \ No newline at end of file + show_root_heading: true diff --git a/docs/api/annotation/fluorescence.md b/docs/api/annotation/fluorescence.md index ef1e9afe..882af767 100644 --- a/docs/api/annotation/fluorescence.md +++ b/docs/api/annotation/fluorescence.md @@ -4,4 +4,4 @@ ::: sopa.annotation.preprocess_fluo options: - show_root_heading: true \ No newline at end of file + show_root_heading: true diff --git a/docs/api/annotation/tangram.md b/docs/api/annotation/tangram.md index e9b47297..2a3cfb23 100644 --- a/docs/api/annotation/tangram.md +++ b/docs/api/annotation/tangram.md @@ -1,3 +1,3 @@ ::: sopa.annotation.tangram.tangram_annotate options: - show_root_heading: true \ No newline at end of file + show_root_heading: true diff --git a/docs/api/io.explorer.md b/docs/api/io.explorer.md index 716151fb..b5343497 100644 --- a/docs/api/io.explorer.md +++ b/docs/api/io.explorer.md @@ -33,11 +33,11 @@ ::: sopa.io.explorer.str_cell_id options: show_root_heading: true - + ::: sopa.io.explorer.align options: show_root_heading: true ::: sopa.io.explorer.save_column_csv options: - show_root_heading: true \ No newline at end of file + show_root_heading: true diff --git a/docs/api/io.md b/docs/api/io.md index fd8e08e5..83ee81b3 100644 --- a/docs/api/io.md +++ b/docs/api/io.md @@ -30,4 +30,4 @@ ::: sopa.io.ome_tif options: - show_root_heading: true \ No newline at end of file + show_root_heading: true diff --git a/docs/api/segmentation/aggregate.md b/docs/api/segmentation/aggregate.md index ac0591e9..1dfa90f1 100644 --- a/docs/api/segmentation/aggregate.md +++ b/docs/api/segmentation/aggregate.md @@ -16,4 +16,4 @@ ::: sopa.segmentation.aggregate.Aggregator options: - show_root_heading: true \ No newline at end of file + show_root_heading: true diff --git a/docs/api/segmentation/baysor.md b/docs/api/segmentation/baysor.md index 82b8d954..9704226e 100644 --- a/docs/api/segmentation/baysor.md +++ b/docs/api/segmentation/baysor.md @@ -1,3 +1,3 @@ ::: sopa.segmentation.baysor.resolve.resolve options: - show_root_heading: true \ No newline at end of file + show_root_heading: true diff --git a/docs/api/segmentation/methods.md b/docs/api/segmentation/methods.md index 571c0a14..7392dc8b 100644 --- a/docs/api/segmentation/methods.md +++ b/docs/api/segmentation/methods.md @@ -1,3 +1,3 @@ ::: sopa.segmentation.methods.cellpose_patch options: - show_root_heading: true \ No newline at end of file + show_root_heading: true diff --git a/docs/api/segmentation/patching.md b/docs/api/segmentation/patching.md index 0a807958..048cc26b 100644 --- a/docs/api/segmentation/patching.md +++ b/docs/api/segmentation/patching.md @@ -1,3 +1,3 @@ ::: sopa.segmentation.patching.Patches2D options: - show_root_heading: true \ No newline at end of file + show_root_heading: true diff --git a/docs/api/segmentation/stainings.md b/docs/api/segmentation/stainings.md index 69b344ea..8e59f172 100644 --- a/docs/api/segmentation/stainings.md +++ b/docs/api/segmentation/stainings.md @@ -1,3 +1,3 @@ ::: sopa.segmentation.stainings.StainingSegmentation options: - show_root_heading: true \ No newline at end of file + show_root_heading: true diff --git a/docs/api/utils/data.md b/docs/api/utils/data.md index 2396edcd..3e4013e9 100644 --- a/docs/api/utils/data.md +++ b/docs/api/utils/data.md @@ -4,4 +4,4 @@ ::: sopa.utils.data.blobs options: - show_root_heading: true \ No newline at end of file + show_root_heading: true diff --git a/docs/api/utils/image.md b/docs/api/utils/image.md index 507f572b..3c82fed1 100644 --- a/docs/api/utils/image.md +++ b/docs/api/utils/image.md @@ -8,4 +8,4 @@ ::: sopa.utils.image.resize_numpy options: - show_root_heading: true \ No newline at end of file + show_root_heading: true diff --git a/docs/cite_us.md b/docs/cite_us.md index 79d3e84d..10b8acc6 100644 --- a/docs/cite_us.md +++ b/docs/cite_us.md @@ -17,4 +17,4 @@ Our article is not published yet. In the meantime, you can cite our [preprint](h This library has been developed by Quentin Blampey, PhD student in Biomathematics / Deep Learning. The following institutions funded this work: - Lab of Mathematics and Computer Science (MICS), **CentraleSupélec** (Engineering School, Paris-Saclay University). -- PRISM center, **Gustave Roussy Institute** (Cancer campus, Paris-Saclay University). \ No newline at end of file +- PRISM center, **Gustave Roussy Institute** (Cancer campus, Paris-Saclay University). diff --git a/docs/cli.md b/docs/cli.md index ece97205..35fc9ce4 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -11,7 +11,7 @@ When installing `sopa` as written in our [getting-started guidelines](../getting ```console // Run the Sopa CLI helper $ sopa --help - Usage: sopa [OPTIONS] COMMAND [ARGS]... + Usage: sopa [OPTIONS] COMMAND [ARGS]... ╭─ Commands ─────────────────────────────────────────────────────╮ │ aggregate Aggregate transcripts/channels inside cells │ │ annotate Perform cell-type annotation │ diff --git a/docs/css/custom.css b/docs/css/custom.css index eff204ff..b9d77de0 100644 --- a/docs/css/custom.css +++ b/docs/css/custom.css @@ -6,4 +6,4 @@ .termy [data-termynal] { white-space: pre-wrap; -} \ No newline at end of file +} diff --git a/docs/css/termynal.css b/docs/css/termynal.css index 8dc47805..e0ecaeac 100644 --- a/docs/css/termynal.css +++ b/docs/css/termynal.css @@ -107,4 +107,4 @@ a[data-terminal-control] { 50% { opacity: 0; } -} \ No newline at end of file +} diff --git a/docs/js/custom.js b/docs/js/custom.js index 0a65c113..fa9041c2 100644 --- a/docs/js/custom.js +++ b/docs/js/custom.js @@ -102,4 +102,4 @@ function loadVisibleTermynals() { } window.addEventListener("scroll", loadVisibleTermynals); createTermynals(); -loadVisibleTermynals(); \ No newline at end of file +loadVisibleTermynals(); diff --git a/docs/js/mathjax.js b/docs/js/mathjax.js index 1c35fc15..85528390 100644 --- a/docs/js/mathjax.js +++ b/docs/js/mathjax.js @@ -10,8 +10,7 @@ window.MathJax = { processHtmlClass: "arithmatex" } }; - - document$.subscribe(() => { + + document$.subscribe(() => { MathJax.typesetPromise() }) - \ No newline at end of file diff --git a/docs/js/termynal.js b/docs/js/termynal.js index 1c52db84..4ac32708 100644 --- a/docs/js/termynal.js +++ b/docs/js/termynal.js @@ -261,4 +261,4 @@ if (document.currentScript.hasAttribute('data-termynal-container')) { const containers = document.currentScript.getAttribute('data-termynal-container'); containers.split('|') .forEach(container => new Termynal(container)) -} \ No newline at end of file +} diff --git a/docs/tutorials/advanced_segmentation.md b/docs/tutorials/advanced_segmentation.md index faba2643..885238da 100644 --- a/docs/tutorials/advanced_segmentation.md +++ b/docs/tutorials/advanced_segmentation.md @@ -173,7 +173,7 @@ def dummy_method(**method_kwargs): ### 2. Setup -To use the CLI, you'll need to clone the repository. Also, we recommend installing Sopa in dev mode, allowing you to update your segmentation function without re-installing everything. For instance: +To use the CLI, you'll need to clone the repository. Also, we recommend installing Sopa in dev mode, allowing you to update your segmentation function without re-installing everything. For instance: ```sh git clone https://github.com/gustaveroussy/sopa.git diff --git a/docs/tutorials/cli_usage.md b/docs/tutorials/cli_usage.md index bf86a407..d71011ad 100644 --- a/docs/tutorials/cli_usage.md +++ b/docs/tutorials/cli_usage.md @@ -300,4 +300,4 @@ import spatialdata sdata = spatialdata.read_zarr("tuto.zarr") ``` - You can use [Squidpy](https://squidpy.readthedocs.io/en/latest/index.html) which operates on both the `SpatialData` object or the `AnnData` object, or use other tools of the `scverse` ecosystem such as [`Scanpy`](https://scanpy.readthedocs.io/en/stable/index.html). -- You can also use the file `tuto.explorer/adata.h5ad` if you prefer the `AnnData` object instead of the full `SpatialData` object. \ No newline at end of file +- You can also use the file `tuto.explorer/adata.h5ad` if you prefer the `AnnData` object instead of the full `SpatialData` object. diff --git a/mkdocs.yml b/mkdocs.yml index 13278f2f..76d500e5 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -68,4 +68,4 @@ extra_javascript: - js/custom.js - js/mathjax.js - https://polyfill.io/v3/polyfill.min.js?features=es6 - - https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js \ No newline at end of file + - https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js diff --git a/tests/test_rasterize_geometries.py b/tests/test_rasterize_geometries.py index 78abf3ee..08f6a965 100644 --- a/tests/test_rasterize_geometries.py +++ b/tests/test_rasterize_geometries.py @@ -28,7 +28,7 @@ def test_raster_and_geometrize(): assert ( mask == new_mask - ).all(), f"Applying geometrize and then rasterize shouldn't change the mask" + ).all(), "Applying geometrize and then rasterize shouldn't change the mask" def test_rasterize_cropped(): diff --git a/workflow/Snakefile b/workflow/Snakefile index c6b2f51e..9e95997c 100644 --- a/workflow/Snakefile +++ b/workflow/Snakefile @@ -99,7 +99,7 @@ rule patch_segmentation_baysor: if command -v module &> /dev/null; then module purge fi - + cd {input.baysor_patch} {config[executables][baysor]} run --save-polygons GeoJSON -c config.toml transcripts.csv {params.args_baysor_prior_seg} """ @@ -222,4 +222,4 @@ rule explorer: shell: """ sopa explorer write {paths.sdata_path} --output-path {paths.explorer_directory} {params.args_explorer} --mode '-i' - """ \ No newline at end of file + """ diff --git a/workflow/config/README.md b/workflow/config/README.md index eb476d7c..a37ceb56 100644 --- a/workflow/config/README.md +++ b/workflow/config/README.md @@ -3,4 +3,4 @@ Snakemake config are `.yaml` files. We provide many examples of such a config in this directory. You can choose an existing one (inside the directory corresponding to your technology of interest) or make your own config. -All arguments are detailed in the [`example_commented.yaml`](https://github.com/gustaveroussy/sopa/blob/master/workflow/config/example_commented.yaml) file. \ No newline at end of file +All arguments are detailed in the [`example_commented.yaml`](https://github.com/gustaveroussy/sopa/blob/master/workflow/config/example_commented.yaml) file. diff --git a/workflow/config/example_commented.yaml b/workflow/config/example_commented.yaml index ecf17e41..11ee3c37 100644 --- a/workflow/config/example_commented.yaml +++ b/workflow/config/example_commented.yaml @@ -1,7 +1,7 @@ ### This file details all existing Sopa parameters ### ### Most of these parameters are optional: don't hesitate to delete those that doesn't interest you -### +### ### Before creating your own config, you should check if there is not already an existing ### config that works for you, see https://github.com/gustaveroussy/sopa/tree/master/workflow/config @@ -102,4 +102,4 @@ explorer: # parameters related to the conversion to the Xenium Explorer (Sopa's pixel_size: 0.2125 # [optional] this is the number of microns in a pixel for the technology used (see the config of your technology of interest) executables: - baysor: ~/.julia/bin/baysor # [optional] if you run baysor, write here the path to the 'baysor' executable \ No newline at end of file + baysor: ~/.julia/bin/baysor # [optional] if you run baysor, write here the path to the 'baysor' executable diff --git a/workflow/config/phenocycler/README.md b/workflow/config/phenocycler/README.md index 693aa9d5..829e43ff 100644 --- a/workflow/config/phenocycler/README.md +++ b/workflow/config/phenocycler/README.md @@ -2,4 +2,4 @@ For PhenoCycler data, there are multiple config files based on the resolution se Choose the right one according to your settings: - 10X (1 micron is 1 pixel) - 20X (1 micron is 2 pixels) -- 40X (1 micron is 4 pixels) \ No newline at end of file +- 40X (1 micron is 4 pixels) diff --git a/workflow/config/phenocycler/base_10X.yaml b/workflow/config/phenocycler/base_10X.yaml index 61538964..9601ecb6 100644 --- a/workflow/config/phenocycler/base_10X.yaml +++ b/workflow/config/phenocycler/base_10X.yaml @@ -18,7 +18,7 @@ aggregate: average_intensities: true min_intensity_ratio: 0.1 expand_radius_ratio: 0.1 - + explorer: ram_threshold_gb: 8 - pixel_size: 1 \ No newline at end of file + pixel_size: 1 diff --git a/workflow/config/phenocycler/base_20X.yaml b/workflow/config/phenocycler/base_20X.yaml index 15735c36..74bb21ff 100644 --- a/workflow/config/phenocycler/base_20X.yaml +++ b/workflow/config/phenocycler/base_20X.yaml @@ -18,7 +18,7 @@ aggregate: average_intensities: true min_intensity_ratio: 0.1 expand_radius_ratio: 0.1 - + explorer: ram_threshold_gb: 8 pixel_size: 0.5 diff --git a/workflow/config/phenocycler/base_40X.yaml b/workflow/config/phenocycler/base_40X.yaml index 6bcf46b3..199df272 100644 --- a/workflow/config/phenocycler/base_40X.yaml +++ b/workflow/config/phenocycler/base_40X.yaml @@ -18,7 +18,7 @@ aggregate: average_intensities: true min_intensity_ratio: 0.1 expand_radius_ratio: 0.1 - + explorer: ram_threshold_gb: 8 - pixel_size: 0.25 \ No newline at end of file + pixel_size: 0.25 diff --git a/workflow/config/toy/uniform_baysor.yaml b/workflow/config/toy/uniform_baysor.yaml index a7647383..21c392f2 100644 --- a/workflow/config/toy/uniform_baysor.yaml +++ b/workflow/config/toy/uniform_baysor.yaml @@ -47,7 +47,7 @@ annotation: CK: Tumoral cell CD3: T cell CD20: B cell - + explorer: gene_column: "genes" ram_threshold_gb: 16 diff --git a/workflow/config/toy/uniform_baysor_overlaps.yaml b/workflow/config/toy/uniform_baysor_overlaps.yaml index d0618470..f817fa4f 100644 --- a/workflow/config/toy/uniform_baysor_overlaps.yaml +++ b/workflow/config/toy/uniform_baysor_overlaps.yaml @@ -47,7 +47,7 @@ annotation: CK: Tumoral cell CD3: T cell CD20: B cell - + explorer: gene_column: "genes" ram_threshold_gb: 16 diff --git a/workflow/config/xenium/base.yaml b/workflow/config/xenium/base.yaml index 50ec9289..76c2a390 100644 --- a/workflow/config/xenium/base.yaml +++ b/workflow/config/xenium/base.yaml @@ -37,7 +37,7 @@ segmentation: aggregate: average_intensities: true - + # Comment this out if you want to use tangram --> # annotation: diff --git a/workflow/config/xenium/cellpose_baysor.yaml b/workflow/config/xenium/cellpose_baysor.yaml index 9fece2a5..9fcfc1cb 100644 --- a/workflow/config/xenium/cellpose_baysor.yaml +++ b/workflow/config/xenium/cellpose_baysor.yaml @@ -46,7 +46,7 @@ segmentation: aggregate: average_intensities: true - + # Comment this out if you want to use tangram --> # annotation: diff --git a/workflow/slurm/config.yaml b/workflow/slurm/config.yaml index d6c0dc4d..3dd6609d 100644 --- a/workflow/slurm/config.yaml +++ b/workflow/slurm/config.yaml @@ -20,4 +20,4 @@ keep-going: True rerun-incomplete: True printshellcmds: True scheduler: greedy -use-conda: True \ No newline at end of file +use-conda: True diff --git a/workflow/utils.py b/workflow/utils.py index 0b5f9151..f78a0b0f 100644 --- a/workflow/utils.py +++ b/workflow/utils.py @@ -14,7 +14,7 @@ def sanity_check_config(config: dict): "data_path" in config or "sdata_path" in config ), "Invalid config. Provide '--config data_path=...' when running the pipeline" - if "data_path" in config and not "sdata_path" in config: + if "data_path" in config and "sdata_path" not in config: config["sdata_path"] = Path(config["data_path"]).with_suffix(".zarr") print( f"SpatialData object path set to default: {config['sdata_path']}\nTo change this behavior, provide `--config sdata_path=...` when running the snakemake pipeline"