diff --git a/.gitignore b/.gitignore index bd1adf1f..84e3de44 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,8 @@ # Misc -cytospace -show_small.py -archive/ workflow/.snakemake workflow/logs *ignore* +archive/ explore sandbox @@ -14,7 +12,7 @@ sandbox # Documentation site -# Code Ocean related +# Code Ocean code results @@ -25,15 +23,6 @@ lightning_logs checkpoints run.log -# Data files -data/*/* -!data/aml/default.csv -!data/aml/short.h5ad -!data/bmmc/default.csv -!data/poised/default.csv -!data/debarcoding/default.csv -!data/README.md - # Jupyter Notebook .ipynb_checkpoints exploration/* diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2118ea84..0a70946e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,9 +8,9 @@ Contributions are welcome as we aim to continue improving the pipeline. For inst - Submitting a fix - Proposing new features -## Contributing to the code, or debugging +## Pull Requests -Even though *sopa* is meant for flamingo, you can set up this repository locally for development or debugging purposes. +To add some new code to **sopa**, you should: 1. Install the dependencies. 2. Create your personal branch from `master`. @@ -21,8 +21,7 @@ Even though *sopa* is meant for flamingo, you can set up this repository locally ## Coding guidelines - Use the `black` formatter and `isort`. Their usage should be automatic as they are in the `pyproject.toml` file. Depending on your IDE, you can choose to format your code on save. -- Follow the [PEP8](https://peps.python.org/pep-0008/) style guide. In particular, use snake_case notations (and PascalCase for classes). +- Follow the [PEP8](https://peps.python.org/pep-0008/) style guide. - Provide meaningful names to all your variables and functions. - Document your functions and type your function inputs/outputs. -- Create your functions in the intended file, or create one if needed. See the project layout. - Try as much as possible to follow the same coding style as the rest of the repository. \ No newline at end of file diff --git a/workflow/_Snakefile b/workflow/_Snakefile deleted file mode 100644 index ccf10840..00000000 --- a/workflow/_Snakefile +++ /dev/null @@ -1,68 +0,0 @@ -import utils - -### Required command line arguments - -# region: relative path to the region folder -# config: name of the config file to be used -relative_region = config["region"] -config_name = config["config"] - -run = utils.WorkflowPaths(relative_region, config_name) - -file = "..." -sdata_path = f"{file}.zarr" -config = "..." - -rule all: - input: - "..." - -checkpoint write_sdata: - input: - file, - config, - output: - sdata_path, - poly_paths_file, - shell: - f""" - python -m sopa.io.qptiff -p {file} -s {sdata_path} -c {config} - ... # write file with paths - """ - -def get_input_patches(wilcards): - with open(checkpoints.write_sdata.get(**wilcards).output[1], 'r') as f: - n_tiles = int(json.load(f)["window_grid"]["num_tiles"]) - return ... - -rule patch_segmentation: - input: - run.out.spec, - output: - f"{run.out.tiles_dir}/{{index}}.parquet", - resources: - mem_mb=3_000 - conda: - "vpt" - shell: - f""" - vpt --verbose run-segmentation-on-tile \ - --input-segmentation-parameters {run.out.spec} \ - --tile-index {{wildcards.index}} - """ - -rule aggregate_patches: - input: - run.out.spec, - get_input_patches, - output: - run.out.polygons, - resources: - mem_mb=32_000 - conda: - "vpt" - shell: - f""" - vpt --verbose compile-tile-segmentation \ - --input-segmentation-parameters {run.out.spec} - """ \ No newline at end of file