Skip to content

Commit

Permalink
run pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
quentinblampey committed Feb 12, 2024
1 parent 02268fc commit 7be0976
Show file tree
Hide file tree
Showing 41 changed files with 45 additions and 51 deletions.
2 changes: 0 additions & 2 deletions .github/ISSUE_TEMPLATE/custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ labels: ''
assignees: ''

---


2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@ coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
.pytest_cache/
3 changes: 0 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -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.
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
```
```
2 changes: 1 addition & 1 deletion docs/api/_sdata.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@

::: sopa._sdata.get_spatial_image
options:
show_root_heading: true
show_root_heading: true
2 changes: 1 addition & 1 deletion docs/api/annotation/fluorescence.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

::: sopa.annotation.preprocess_fluo
options:
show_root_heading: true
show_root_heading: true
2 changes: 1 addition & 1 deletion docs/api/annotation/tangram.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
::: sopa.annotation.tangram.tangram_annotate
options:
show_root_heading: true
show_root_heading: true
4 changes: 2 additions & 2 deletions docs/api/io.explorer.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
show_root_heading: true
2 changes: 1 addition & 1 deletion docs/api/io.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@

::: sopa.io.ome_tif
options:
show_root_heading: true
show_root_heading: true
2 changes: 1 addition & 1 deletion docs/api/segmentation/aggregate.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@

::: sopa.segmentation.aggregate.Aggregator
options:
show_root_heading: true
show_root_heading: true
2 changes: 1 addition & 1 deletion docs/api/segmentation/baysor.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
::: sopa.segmentation.baysor.resolve.resolve
options:
show_root_heading: true
show_root_heading: true
2 changes: 1 addition & 1 deletion docs/api/segmentation/methods.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
::: sopa.segmentation.methods.cellpose_patch
options:
show_root_heading: true
show_root_heading: true
2 changes: 1 addition & 1 deletion docs/api/segmentation/patching.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
::: sopa.segmentation.patching.Patches2D
options:
show_root_heading: true
show_root_heading: true
2 changes: 1 addition & 1 deletion docs/api/segmentation/stainings.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
::: sopa.segmentation.stainings.StainingSegmentation
options:
show_root_heading: true
show_root_heading: true
2 changes: 1 addition & 1 deletion docs/api/utils/data.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

::: sopa.utils.data.blobs
options:
show_root_heading: true
show_root_heading: true
2 changes: 1 addition & 1 deletion docs/api/utils/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

::: sopa.utils.image.resize_numpy
options:
show_root_heading: true
show_root_heading: true
2 changes: 1 addition & 1 deletion docs/cite_us.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
- PRISM center, **Gustave Roussy Institute** (Cancer campus, Paris-Saclay University).
2 changes: 1 addition & 1 deletion docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 │
Expand Down
2 changes: 1 addition & 1 deletion docs/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

.termy [data-termynal] {
white-space: pre-wrap;
}
}
2 changes: 1 addition & 1 deletion docs/css/termynal.css
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ a[data-terminal-control] {
50% {
opacity: 0;
}
}
}
2 changes: 1 addition & 1 deletion docs/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ function loadVisibleTermynals() {
}
window.addEventListener("scroll", loadVisibleTermynals);
createTermynals();
loadVisibleTermynals();
loadVisibleTermynals();
5 changes: 2 additions & 3 deletions docs/js/mathjax.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ window.MathJax = {
processHtmlClass: "arithmatex"
}
};
document$.subscribe(() => {

document$.subscribe(() => {
MathJax.typesetPromise()
})

2 changes: 1 addition & 1 deletion docs/js/termynal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
2 changes: 1 addition & 1 deletion docs/tutorials/advanced_segmentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/cli_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
- You can also use the file `tuto.explorer/adata.h5ad` if you prefer the `AnnData` object instead of the full `SpatialData` object.
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
- https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
2 changes: 1 addition & 1 deletion tests/test_rasterize_geometries.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
4 changes: 2 additions & 2 deletions workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}
"""
Expand Down Expand Up @@ -222,4 +222,4 @@ rule explorer:
shell:
"""
sopa explorer write {paths.sdata_path} --output-path {paths.explorer_directory} {params.args_explorer} --mode '-i'
"""
"""
2 changes: 1 addition & 1 deletion workflow/config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
All arguments are detailed in the [`example_commented.yaml`](https://github.com/gustaveroussy/sopa/blob/master/workflow/config/example_commented.yaml) file.
4 changes: 2 additions & 2 deletions workflow/config/example_commented.yaml
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
baysor: ~/.julia/bin/baysor # [optional] if you run baysor, write here the path to the 'baysor' executable
2 changes: 1 addition & 1 deletion workflow/config/phenocycler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
- 40X (1 micron is 4 pixels)
4 changes: 2 additions & 2 deletions workflow/config/phenocycler/base_10X.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
pixel_size: 1
2 changes: 1 addition & 1 deletion workflow/config/phenocycler/base_20X.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions workflow/config/phenocycler/base_40X.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
pixel_size: 0.25
2 changes: 1 addition & 1 deletion workflow/config/toy/uniform_baysor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ annotation:
CK: Tumoral cell
CD3: T cell
CD20: B cell

explorer:
gene_column: "genes"
ram_threshold_gb: 16
Expand Down
2 changes: 1 addition & 1 deletion workflow/config/toy/uniform_baysor_overlaps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ annotation:
CK: Tumoral cell
CD3: T cell
CD20: B cell

explorer:
gene_column: "genes"
ram_threshold_gb: 16
Expand Down
2 changes: 1 addition & 1 deletion workflow/config/xenium/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ segmentation:

aggregate:
average_intensities: true

# Comment this out if you want to use tangram -->

# annotation:
Expand Down
2 changes: 1 addition & 1 deletion workflow/config/xenium/cellpose_baysor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ segmentation:

aggregate:
average_intensities: true

# Comment this out if you want to use tangram -->

# annotation:
Expand Down
2 changes: 1 addition & 1 deletion workflow/slurm/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ keep-going: True
rerun-incomplete: True
printshellcmds: True
scheduler: greedy
use-conda: True
use-conda: True
2 changes: 1 addition & 1 deletion workflow/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 7be0976

Please sign in to comment.