spacr 0.3.32__tar.gz → 0.3.33__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {spacr-0.3.32/spacr.egg-info → spacr-0.3.33}/PKG-INFO +1 -1
- {spacr-0.3.32 → spacr-0.3.33}/setup.py +1 -1
- {spacr-0.3.32 → spacr-0.3.33}/spacr/plot.py +228 -89
- {spacr-0.3.32 → spacr-0.3.33/spacr.egg-info}/PKG-INFO +1 -1
- {spacr-0.3.32 → spacr-0.3.33}/.readthedocs.yaml +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/LICENSE +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/MANIFEST.in +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/README.rst +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/deploy_docs.sh +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/requirements.txt +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/Makefile +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/doctrees/environment.pickle +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_modules/index.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_modules/spacr/app_annotate.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_modules/spacr/app_classify.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_modules/spacr/app_make_masks.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_modules/spacr/app_mask.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_modules/spacr/app_measure.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_modules/spacr/app_sequencing.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_modules/spacr/app_umap.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_modules/spacr/core.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_modules/spacr/deep_spacr.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_modules/spacr/graph_learning.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_modules/spacr/gui.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_modules/spacr/gui_core.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_modules/spacr/gui_elements.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_modules/spacr/gui_utils.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_modules/spacr/io.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_modules/spacr/logger.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_modules/spacr/measure.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_modules/spacr/plot.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_modules/spacr/sequencing.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_modules/spacr/settings.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_modules/spacr/sim.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_modules/spacr/timelapse.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_modules/spacr/utils.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_sources/index.rst.txt +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_sources/modules.rst.txt +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_sources/spacr.rst.txt +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/_sphinx_javascript_frameworks_compat.js +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/basic.css +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/badge_only.css +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/Roboto-Slab-Bold.woff +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/Roboto-Slab-Bold.woff2 +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/Roboto-Slab-Regular.woff +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/Roboto-Slab-Regular.woff2 +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/fontawesome-webfont.eot +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/fontawesome-webfont.svg +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/fontawesome-webfont.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/fontawesome-webfont.woff +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/fontawesome-webfont.woff2 +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/lato-bold-italic.woff +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/lato-bold-italic.woff2 +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/lato-bold.woff +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/lato-bold.woff2 +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/lato-normal-italic.woff +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/lato-normal-italic.woff2 +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/lato-normal.woff +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/lato-normal.woff2 +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/theme.css +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/doctools.js +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/documentation_options.js +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/file.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/jquery.js +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/js/badge_only.js +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/js/html5shiv-printshiv.min.js +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/js/html5shiv.min.js +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/js/theme.js +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/language_data.js +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/minus.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/plus.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/pygments.css +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/searchtools.js +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/sphinx_highlight.js +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/genindex.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/index.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/modules.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/objects.inv +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/py-modindex.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/search.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/searchindex.js +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/spacr.html +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/conf.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/index.rst +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/make.bat +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/modules.rst +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/docs/source/spacr.rst +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/environment.yaml +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/fonts/OpenSans-Regular.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/notebooks/cv_scoring_nb.ipynb +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/notebooks/deep_learning_spacr.ipynb +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/notebooks/machine_learning_spacr_nb.ipynb +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/notebooks/spacr_0.1_all_settings_git.ipynb +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/notebooks/spacr_0.1_minimal.ipynb +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/path/home/carruthers/datasets/plate1/measurements/measurements.db +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/path/home/carruthers/datasets/plate1/settings/measure_crop_settings.csv +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/path/settings/preprocess_generate_masks_settings.csv +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/requirements.txt +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/settings/measure_crop_settings.csv +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/setup.cfg +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/setup_docs.sh +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/source/conf.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/source/index.rst +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/source/modules.rst +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/source/setup.rst +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/source/spacr.rst +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/__init__.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/__main__.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/app_annotate.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/app_classify.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/app_make_masks.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/app_mask.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/app_measure.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/app_sequencing.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/app_umap.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/cellpose.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/core.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/deep_spacr.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/gui.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/gui_core.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/gui_elements.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/gui_utils.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/io.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/logger.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/measure.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/mediar.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/ml.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/openai.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/.gitignore +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/LICENSE +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/README.md +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/SetupDict.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/config/baseline.json +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/config/mediar_example.json +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/config/pred/pred_mediar.json +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/config/step1_pretraining/phase1.json +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/config/step1_pretraining/phase2.json +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/config/step2_finetuning/finetuning1.json +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/config/step2_finetuning/finetuning2.json +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/config/step3_prediction/base_prediction.json +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/config/step3_prediction/ensemble_tta.json +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/core/BasePredictor.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/core/BaseTrainer.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/core/Baseline/Predictor.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/core/Baseline/Trainer.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/core/Baseline/__init__.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/core/Baseline/utils.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/core/MEDIAR/EnsemblePredictor.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/core/MEDIAR/Predictor.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/core/MEDIAR/Trainer.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/core/MEDIAR/__init__.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/core/MEDIAR/utils.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/core/__init__.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/core/utils.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/evaluate.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/generate_mapping.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/image/examples/img1.tiff +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/image/examples/img2.tif +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/image/failure_cases.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/image/mediar_framework.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/image/mediar_model.PNG +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/image/mediar_results.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/main.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/predict.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/requirements.txt +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/train_tools/__init__.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/train_tools/data_utils/__init__.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/train_tools/data_utils/custom/CellAware.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/train_tools/data_utils/custom/LoadImage.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/train_tools/data_utils/custom/NormalizeImage.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/train_tools/data_utils/custom/__init__.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/train_tools/data_utils/custom/modalities.pkl +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/train_tools/data_utils/datasetter.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/train_tools/data_utils/transforms.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/train_tools/data_utils/utils.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/train_tools/measures.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/train_tools/models/MEDIARFormer.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/train_tools/models/__init__.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/MEDIAR/train_tools/utils.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/data/lopit.csv +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/data/toxoplasma_metadata.csv +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/OFL.txt +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/OpenSans-Italic-VariableFont_wdth,wght.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/OpenSans-VariableFont_wdth,wght.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/README.txt +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans-Bold.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans-BoldItalic.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans-ExtraBold.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans-ExtraBoldItalic.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans-Italic.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans-Light.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans-LightItalic.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans-Medium.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans-MediumItalic.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans-Regular.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans-SemiBold.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans-SemiBoldItalic.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans_Condensed-Bold.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans_Condensed-BoldItalic.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans_Condensed-ExtraBold.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans_Condensed-ExtraBoldItalic.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans_Condensed-Italic.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans_Condensed-Light.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans_Condensed-LightItalic.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans_Condensed-Medium.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans_Condensed-MediumItalic.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans_Condensed-Regular.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans_Condensed-SemiBold.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans_Condensed-SemiBoldItalic.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-Bold.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-BoldItalic.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-ExtraBold.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-ExtraBoldItalic.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-Italic.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-Light.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-LightItalic.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-Medium.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-MediumItalic.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-Regular.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-SemiBold.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/font/open_sans/static/OpenSans_SemiCondensed-SemiBoldItalic.ttf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/icons/abort.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/icons/annotate.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/icons/cellpose_all.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/icons/cellpose_masks.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/icons/classify.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/icons/convert.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/icons/default.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/icons/dna_matrix.mp4 +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/icons/download.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/icons/logo.pdf +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/icons/logo_spacr.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/icons/logo_spacr_1.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/icons/make_masks.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/icons/map_barcodes.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/icons/mask.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/icons/measure.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/icons/ml_analyze.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/icons/plaque.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/icons/recruitment.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/icons/regression.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/icons/run.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/icons/sequencing.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/icons/settings.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/icons/train_cellpose.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/icons/umap.png +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/images/plate1_E01_T0001F001L01A01Z01C02.tif +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/images/plate1_E01_T0001F001L01A02Z01C01.tif +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/resources/images/plate1_E01_T0001F001L01A03Z01C03.tif +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/sequencing.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/settings.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/sim.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/submodules.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/timelapse.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/toxo.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/utils.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr/version.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr.egg-info/SOURCES.txt +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr.egg-info/dependency_links.txt +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr.egg-info/entry_points.txt +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr.egg-info/requires.txt +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/spacr.egg-info/top_level.txt +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/tests/test_annotate_app.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/tests/test_core.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/tests/test_gui_classify_app.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/tests/test_gui_mask_app.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/tests/test_gui_measure_app.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/tests/test_gui_sim_app.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/tests/test_gui_utils.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/tests/test_io.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/tests/test_mask_app.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/tests/test_measure.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/tests/test_plot.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/tests/test_sim.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/tests/test_timelapse.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/tests/test_train.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/tests/test_umap.py +0 -0
- {spacr-0.3.32 → spacr-0.3.33}/tests/test_utils.py +0 -0
@@ -2103,7 +2103,7 @@ class spacrGraph:
|
|
2103
2103
|
"""
|
2104
2104
|
self.df = df
|
2105
2105
|
self.grouping_column = grouping_column
|
2106
|
-
self.data_column = data_column
|
2106
|
+
self.data_column = data_column if isinstance(data_column, list) else [data_column]
|
2107
2107
|
self.graph_type = graph_type
|
2108
2108
|
self.summary_func = summary_func
|
2109
2109
|
self.order = order
|
@@ -2148,7 +2148,8 @@ class spacrGraph:
|
|
2148
2148
|
|
2149
2149
|
def preprocess_data(self):
|
2150
2150
|
"""Preprocess the data: remove NaNs, sort/order the grouping column, and optionally group by 'prc'."""
|
2151
|
-
|
2151
|
+
# Remove NaNs in both the grouping column and each data column
|
2152
|
+
df = self.df.dropna(subset=[self.grouping_column] + self.data_column) # Handle multiple data columns
|
2152
2153
|
|
2153
2154
|
# Group by 'prc' column if representation is 'well'
|
2154
2155
|
if self.representation == 'well':
|
@@ -2158,9 +2159,10 @@ class spacrGraph:
|
|
2158
2159
|
df[self.grouping_column] = pd.Categorical(df[self.grouping_column], categories=self.order, ordered=True)
|
2159
2160
|
else:
|
2160
2161
|
df[self.grouping_column] = pd.Categorical(df[self.grouping_column], categories=sorted(df[self.grouping_column].unique()), ordered=True)
|
2161
|
-
|
2162
|
+
|
2162
2163
|
return df
|
2163
2164
|
|
2165
|
+
|
2164
2166
|
def remove_outliers_from_plot(self):
|
2165
2167
|
"""Remove outliers from the plot but keep them in the data."""
|
2166
2168
|
filtered_df = self.df.copy()
|
@@ -2176,26 +2178,28 @@ class spacrGraph:
|
|
2176
2178
|
return filtered_df
|
2177
2179
|
|
2178
2180
|
def perform_normality_tests(self):
|
2179
|
-
"""Perform normality tests for each group."""
|
2181
|
+
"""Perform normality tests for each group and each data column."""
|
2180
2182
|
unique_groups = self.df[self.grouping_column].unique()
|
2181
|
-
|
2182
|
-
|
2183
|
-
|
2184
|
-
|
2185
|
-
|
2186
|
-
|
2183
|
+
normality_results = []
|
2184
|
+
|
2185
|
+
for column in self.data_column:
|
2186
|
+
grouped_data = [self.df.loc[self.df[self.grouping_column] == group, column] for group in unique_groups]
|
2187
|
+
normal_p_values = [normaltest(data).pvalue for data in grouped_data]
|
2188
|
+
normal_stats = [normaltest(data).statistic for data in grouped_data]
|
2189
|
+
is_normal = all(p > 0.05 for p in normal_p_values) # Test if all groups are normal
|
2190
|
+
|
2191
|
+
for group, stat, p_value in zip(unique_groups, normal_stats, normal_p_values):
|
2192
|
+
normality_results.append({
|
2193
|
+
'Comparison': f'Normality test for {group} on {column}',
|
2194
|
+
'Test Statistic': stat,
|
2195
|
+
'p-value': p_value,
|
2196
|
+
'Test Name': 'Normality test',
|
2197
|
+
'Column': column,
|
2198
|
+
'n': len(self.df[self.df[self.grouping_column] == group]) # Sample size
|
2199
|
+
})
|
2200
|
+
|
2201
|
+
return is_normal, normality_results
|
2187
2202
|
|
2188
|
-
test_results = []
|
2189
|
-
for group, stat, p_value in zip(unique_groups, normal_stats, normal_p_values):
|
2190
|
-
test_results.append({
|
2191
|
-
'Comparison': f'Normality test for {group}',
|
2192
|
-
'Test Statistic': stat,
|
2193
|
-
'p-value': p_value,
|
2194
|
-
'Test Name': 'Normality test',
|
2195
|
-
'n_object': len(raw_grouped_data[unique_groups.tolist().index(group)]), # Raw sample size (objects/cells)
|
2196
|
-
'n_well': len(grouped_data[unique_groups.tolist().index(group)]) if self.representation == 'well' else np.nan # Summarized size (wells)
|
2197
|
-
})
|
2198
|
-
return is_normal, test_results
|
2199
2203
|
|
2200
2204
|
def perform_levene_test(self, unique_groups):
|
2201
2205
|
"""Perform Levene's test for equal variance."""
|
@@ -2294,83 +2298,117 @@ class spacrGraph:
|
|
2294
2298
|
if self.remove_outliers:
|
2295
2299
|
self.df = self.remove_outliers_from_plot()
|
2296
2300
|
|
2297
|
-
#
|
2298
|
-
is_normal, normality_results = self.perform_normality_tests()
|
2299
|
-
|
2300
|
-
# Perform Levene's test for equal variance
|
2301
|
+
# Get the unique groups from the grouping column
|
2301
2302
|
unique_groups = self.df[self.grouping_column].unique()
|
2302
|
-
levene_stat, levene_p = self.perform_levene_test(unique_groups)
|
2303
|
-
levene_result = {
|
2304
|
-
'Comparison': 'Levene’s test for equal variance',
|
2305
|
-
'Test Statistic': levene_stat,
|
2306
|
-
'p-value': levene_p,
|
2307
|
-
'Test Name': 'Levene’s Test'
|
2308
|
-
}
|
2309
|
-
|
2310
|
-
# Perform statistical tests
|
2311
|
-
stat_results = self.perform_statistical_tests(unique_groups, is_normal)
|
2312
|
-
|
2313
|
-
# Perform post-hoc tests if applicable
|
2314
|
-
posthoc_results = self.perform_posthoc_tests(is_normal, unique_groups)
|
2315
|
-
|
2316
|
-
# Combine all test results
|
2317
|
-
self.results_df = pd.DataFrame(normality_results + [levene_result] + stat_results + posthoc_results)
|
2318
|
-
|
2319
|
-
# Add sample size column
|
2320
|
-
sample_sizes = self.df.groupby(self.grouping_column)[self.data_column].count().reset_index(name='n')
|
2321
|
-
self.results_df['n'] = self.results_df['Comparison'].apply(
|
2322
|
-
lambda x: next((sample_sizes[sample_sizes[self.grouping_column] == g]['n'].values[0] for g in sample_sizes[self.grouping_column] if g in x), np.nan)
|
2323
|
-
)
|
2324
2303
|
|
2325
|
-
#
|
2326
|
-
|
2327
|
-
|
2328
|
-
|
2304
|
+
# Flatten the DataFrame to handle multiple `data_column` values in a single plot
|
2305
|
+
self.df_melted = pd.melt(self.df, id_vars=[self.grouping_column], value_vars=self.data_column,
|
2306
|
+
var_name='Data Column', value_name='Value')
|
2307
|
+
|
2308
|
+
# Dynamically set figure dimensions based on the number of unique groups and data columns
|
2309
|
+
num_groups = len(self.df_melted[self.grouping_column].unique())
|
2310
|
+
num_data_columns = len(self.data_column)
|
2311
|
+
bar_width = 2.0 / num_data_columns
|
2312
|
+
spacing_between_groups = 0.1
|
2329
2313
|
|
2330
|
-
fig_width = num_groups *
|
2331
|
-
fig_height =
|
2314
|
+
fig_width = (num_groups * num_data_columns * bar_width) + (spacing_between_groups * num_groups)
|
2315
|
+
fig_height = 10
|
2332
2316
|
|
2333
2317
|
if ax is None:
|
2334
|
-
self.fig, ax = plt.subplots(figsize=(fig_width, fig_height))
|
2318
|
+
self.fig, ax = plt.subplots(figsize=(fig_width, fig_height))
|
2335
2319
|
else:
|
2336
|
-
self.fig = ax.figure
|
2337
|
-
|
2338
|
-
|
2339
|
-
|
2340
|
-
|
2341
|
-
|
2342
|
-
|
2343
|
-
|
2344
|
-
|
2345
|
-
|
2346
|
-
if self.
|
2347
|
-
sns.stripplot(x=self.grouping_column, y=self.data_column, data=self.df, palette=color_palette, jitter=True, alpha=0.6, ax=ax)
|
2348
|
-
elif self.graph_type == 'bar':
|
2320
|
+
self.fig = ax.figure
|
2321
|
+
|
2322
|
+
if len(self.data_column) == 1:
|
2323
|
+
self.hue=self.grouping_column
|
2324
|
+
self.jitter_bar_dodge = False
|
2325
|
+
else:
|
2326
|
+
self.hue='Data Column'
|
2327
|
+
self.jitter_bar_dodge = True
|
2328
|
+
|
2329
|
+
# Handle the different plot types based on `graph_type`
|
2330
|
+
if self.graph_type == 'bar':
|
2349
2331
|
self._create_bar_plot(bar_width, ax)
|
2332
|
+
elif self.graph_type == 'jitter':
|
2333
|
+
#transparent_palette = [(r, g, b, 0.6) for (r, g, b) in sns.color_palette(self.sns_palette, n_colors=len(df_melted[hue].unique()))]
|
2334
|
+
self._create_jitter_plot(ax)
|
2350
2335
|
elif self.graph_type == 'box':
|
2351
2336
|
self._create_box_plot(ax)
|
2352
2337
|
elif self.graph_type == 'violin':
|
2353
2338
|
self._create_violin_plot(ax)
|
2354
|
-
elif self.graph_type == 'jitter':
|
2355
|
-
self._create_jitter_plot(ax)
|
2356
2339
|
else:
|
2357
|
-
raise ValueError(f"
|
2340
|
+
raise ValueError(f"Unknown graph type: {self.graph_type}")
|
2341
|
+
|
2342
|
+
if ax is None:
|
2343
|
+
self.fig, ax = plt.subplots(figsize=(fig_width, fig_height))
|
2344
|
+
else:
|
2345
|
+
self.fig = ax.figure
|
2346
|
+
|
2358
2347
|
|
2359
2348
|
# Set y-axis start
|
2360
2349
|
if self.y_axis_start is not None:
|
2361
2350
|
ax.set_ylim(bottom=self.y_axis_start)
|
2362
2351
|
|
2363
|
-
#
|
2364
|
-
ax.minorticks_on()
|
2365
|
-
ax.tick_params(axis='x', which='minor', bottom=False) # Disable minor ticks on x-axis
|
2366
|
-
ax.tick_params(axis='x', which='major', length=6, width=2, direction='out')
|
2367
|
-
ax.tick_params(axis='y', which='major', length=6, width=2, direction='out')
|
2368
|
-
ax.tick_params(axis='y', which='minor', length=4, width=1, direction='out')
|
2352
|
+
# Remove top and right spines
|
2369
2353
|
sns.despine(ax=ax, top=True, right=True)
|
2370
2354
|
|
2355
|
+
# Adjust the position of the plot to move it closer to the table
|
2356
|
+
ax.set_position([0.1, 0.25, 0.8, 0.45]) # Adjust the height of the plot, leaving more space for the table
|
2357
|
+
|
2358
|
+
# Move the legend outside the plot
|
2359
|
+
ax.legend(loc='center left', bbox_to_anchor=(1, 0.5), title='Data Column')
|
2360
|
+
|
2361
|
+
ax.set_xlabel('')
|
2362
|
+
|
2363
|
+
if len(self.data_column) == 1:
|
2364
|
+
ax.legend().remove()
|
2365
|
+
ax.set_xticklabels(ax.get_xticklabels(), rotation=45, ha='right')
|
2366
|
+
|
2367
|
+
# Create the grid with '+' and '-' symbols
|
2368
|
+
if len(self.data_column) > 1:
|
2369
|
+
ax.set_xticks([])
|
2370
|
+
ax.tick_params(bottom=False)
|
2371
|
+
ax.set_xticklabels([])
|
2372
|
+
|
2373
|
+
legend_ax = self.fig.add_axes([0.1, 0.02, 0.8, 0.2]) # Position the table closer to the graph
|
2374
|
+
legend_ax.set_axis_off()
|
2375
|
+
|
2376
|
+
# Prepare the rows and symbols
|
2377
|
+
row_labels = self.data_column
|
2378
|
+
table_data = []
|
2379
|
+
|
2380
|
+
# Ensure the rows for each data column match the number of unique bars
|
2381
|
+
for column in self.data_column:
|
2382
|
+
column_bars = []
|
2383
|
+
for group in unique_groups:
|
2384
|
+
# For each group and data column, assign a '+' or '-'
|
2385
|
+
for bar_position in range(num_data_columns): # Loop through each data_column position
|
2386
|
+
if bar_position == self.data_column.index(column):
|
2387
|
+
column_bars.append('+')
|
2388
|
+
else:
|
2389
|
+
column_bars.append('-')
|
2390
|
+
table_data.append(column_bars)
|
2391
|
+
|
2392
|
+
# Display the table directly below the graph with white background and thicker row height
|
2393
|
+
legend_table = legend_ax.table(cellText=table_data,
|
2394
|
+
rowLabels=row_labels,
|
2395
|
+
loc='center',
|
2396
|
+
cellLoc='center',
|
2397
|
+
rowColours=['white'] * len(row_labels), # Set background to white
|
2398
|
+
cellColours=[['white'] * len(column_bars) for _ in table_data], # White cell background
|
2399
|
+
edges='closed', # Show edges around cells
|
2400
|
+
bbox=[0, 0, 1, 1])
|
2401
|
+
|
2402
|
+
# Adjust the row height for readability
|
2403
|
+
for key, cell in legend_table.get_celld().items():
|
2404
|
+
cell.set_height(0.5) # Increase row height
|
2405
|
+
cell.set_edgecolor('white') # Set grid color to white
|
2406
|
+
cell.set_linewidth(2) # Set line thickness
|
2407
|
+
|
2371
2408
|
if self.save:
|
2372
2409
|
self._save_results()
|
2373
2410
|
|
2411
|
+
plt.tight_layout() # Ensure the layout is tight
|
2374
2412
|
plt.show() # Ensure the plot is shown, but plt.show() doesn't clear the figure context
|
2375
2413
|
|
2376
2414
|
def get_figure(self):
|
@@ -2379,31 +2417,74 @@ class spacrGraph:
|
|
2379
2417
|
|
2380
2418
|
def _create_bar_plot(self, bar_width, ax):
|
2381
2419
|
"""Helper method to create a bar plot with consistent bar thickness and centered error bars."""
|
2382
|
-
summary_df = self.df.groupby(self.grouping_column)[self.data_column].agg([self.summary_func, 'std', 'sem'])
|
2383
2420
|
|
2421
|
+
# Melt the dataframe for easier use with seaborn's hue functionality
|
2422
|
+
df_melted = pd.melt(self.df, id_vars=[self.grouping_column], value_vars=self.data_column,
|
2423
|
+
var_name='Data Column', value_name=self.summary_func)
|
2424
|
+
|
2425
|
+
# Group the melted DataFrame by grouping column and data column for error bars calculation
|
2426
|
+
summary_df = df_melted.groupby([self.grouping_column, 'Data Column']).agg({self.summary_func: ['mean', 'std', 'sem']}).reset_index()
|
2427
|
+
summary_df.columns = ['_'.join(col).strip() if isinstance(col, tuple) else col for col in summary_df.columns]
|
2428
|
+
|
2429
|
+
# Determine which type of error bars to show (std or sem)
|
2384
2430
|
if self.error_bar_type == 'std':
|
2385
|
-
error_bars = summary_df['
|
2431
|
+
error_bars = summary_df[f'{self.summary_func}_std']
|
2386
2432
|
elif self.error_bar_type == 'sem':
|
2387
|
-
error_bars = summary_df['
|
2433
|
+
error_bars = summary_df[f'{self.summary_func}_sem']
|
2388
2434
|
else:
|
2389
2435
|
raise ValueError(f"Invalid error_bar_type: {self.error_bar_type}. Choose either 'std' or 'sem'.")
|
2390
2436
|
|
2391
|
-
|
2437
|
+
# Set the hue to 'Data Column' if there are multiple data columns
|
2438
|
+
hue = 'Data Column' if len(self.data_column) > 1 else None
|
2439
|
+
|
2440
|
+
# Create the bar plot with dodge=True to ensure bars for different data columns are side by side
|
2441
|
+
barplot = sns.barplot(
|
2442
|
+
data=df_melted,
|
2443
|
+
x=self.grouping_column,
|
2444
|
+
y=self.summary_func,
|
2445
|
+
hue=hue,
|
2446
|
+
palette=self.sns_palette,
|
2447
|
+
dodge=self.jitter_bar_dodge, # Ensure bars are separated
|
2448
|
+
ax=ax,
|
2449
|
+
ci=None # Disable Seaborn's internal error bars
|
2450
|
+
)
|
2451
|
+
|
2452
|
+
# Sort summary_df to match the order of bars in the plot
|
2453
|
+
summary_df_sorted = summary_df.sort_values([f'{self.grouping_column}_', 'Data Column_'])
|
2454
|
+
|
2455
|
+
# Get the positions of the bars
|
2456
|
+
bars = [patch for patch in ax.patches if isinstance(patch, plt.Rectangle)]
|
2457
|
+
|
2458
|
+
# Ensure error bars are aligned with correct bars
|
2459
|
+
for bar, (_, row) in zip(bars, summary_df_sorted.iterrows()):
|
2460
|
+
x_bar = bar.get_x() + bar.get_width() / 2 # Center of the bar
|
2461
|
+
err = row[f'{self.summary_func}_{self.error_bar_type}'] # Get the correct error value for this bar
|
2462
|
+
|
2463
|
+
ax.errorbar(x=x_bar, y=bar.get_height(), yerr=err, fmt='none', c='black', capsize=5, lw=2)
|
2464
|
+
|
2465
|
+
# Set the legend outside the plot
|
2466
|
+
if hue:
|
2467
|
+
ax.legend(title="Data Column", loc='center left', bbox_to_anchor=(1, 0.5))
|
2468
|
+
else:
|
2469
|
+
if len(self.data_column) > 1:
|
2470
|
+
ax.legend_.remove()
|
2471
|
+
|
2472
|
+
# Set labels
|
2473
|
+
ax.set_xlabel(self.grouping_column)
|
2474
|
+
ax.set_ylabel(self.summary_func)
|
2392
2475
|
|
2393
|
-
# Plot the error bars
|
2394
|
-
ax.errorbar(x=np.arange(len(summary_df)), y=summary_df[self.summary_func], yerr=error_bars, fmt='none', c='black', capsize=5)
|
2395
2476
|
|
2396
2477
|
def _create_jitter_plot(self, ax):
|
2397
|
-
"""Helper method to create a jitter plot (strip plot)."""
|
2398
|
-
sns.stripplot(x=self.grouping_column, y=
|
2478
|
+
"""Helper method to create a jitter plot (strip plot) for a specified column."""
|
2479
|
+
sns.stripplot(data=self.df_melted, x=self.grouping_column, y='Value', hue=self.hue, palette=self.sns_palette, dodge=self.jitter_bar_dodge, jitter=True, ax=ax, alpha=0.6)
|
2399
2480
|
|
2400
2481
|
def _create_box_plot(self, ax):
|
2401
|
-
"""Helper method to create a box plot."""
|
2402
|
-
sns.boxplot(x=self.grouping_column, y=
|
2482
|
+
"""Helper method to create a box plot for a specified column."""
|
2483
|
+
sns.boxplot(data=self.df_melted, x=self.grouping_column, y='Value', hue=self.hue, palette=self.sns_palette, ax=ax)
|
2403
2484
|
|
2404
2485
|
def _create_violin_plot(self, ax):
|
2405
|
-
"""Helper method to create a violin plot."""
|
2406
|
-
sns.violinplot(x=self.grouping_column, y=
|
2486
|
+
"""Helper method to create a violin plot for a specified column."""
|
2487
|
+
sns.violinplot(data=self.df_melted, x=self.grouping_column, y='Value', hue=self.hue, palette=self.sns_palette, ax=ax)
|
2407
2488
|
|
2408
2489
|
def _save_results(self):
|
2409
2490
|
"""Helper method to save the plot and results."""
|
@@ -2417,4 +2498,62 @@ class spacrGraph:
|
|
2417
2498
|
|
2418
2499
|
def get_results(self):
|
2419
2500
|
"""Return the results dataframe."""
|
2420
|
-
return self.results_df
|
2501
|
+
return self.results_df
|
2502
|
+
|
2503
|
+
def plot_data_from_db(settings):
|
2504
|
+
from .io import _read_db
|
2505
|
+
from spacr.utils import annotate_conditions
|
2506
|
+
"""
|
2507
|
+
Extracts the specified table from the SQLite database and plots a specified column.
|
2508
|
+
|
2509
|
+
Args:
|
2510
|
+
db_path (str): The path to the SQLite database.
|
2511
|
+
table_name (str): The name of the table to extract.
|
2512
|
+
column_name (str): The column to plot from the table.
|
2513
|
+
|
2514
|
+
Returns:
|
2515
|
+
df (pd.DataFrame): The extracted table as a DataFrame.
|
2516
|
+
"""
|
2517
|
+
|
2518
|
+
db_loc = os.path.join(settings['src'], 'measurements',settings['database'])
|
2519
|
+
|
2520
|
+
[df] = _read_db(db_loc, tables=[settings['table_name']])
|
2521
|
+
|
2522
|
+
df = annotate_conditions(df,
|
2523
|
+
cells=settings['cell_types'],
|
2524
|
+
cell_loc=settings['cell_plate_metadata'],
|
2525
|
+
pathogens=settings['pathogen_types'],
|
2526
|
+
pathogen_loc=settings['pathogen_plate_metadata'],
|
2527
|
+
treatments=settings['treatments'],
|
2528
|
+
treatment_loc=settings['treatment_plate_metadata'])
|
2529
|
+
|
2530
|
+
df['prc'] = df['plate'].astype(str) + '_' + df['row'].astype(str) + '_' + df['col'].astype(str)
|
2531
|
+
df = df.dropna(subset=settings['column_name'])
|
2532
|
+
df['class'] = df['png_path'].apply(lambda x: 'class_1' if 'class_1' in x else ('class_0' if 'class_0' in x else None))
|
2533
|
+
#display(df)
|
2534
|
+
# Initialize the spacrGraph class with your DataFrame and desired parameters
|
2535
|
+
spacr_graph = spacrGraph(
|
2536
|
+
df=df, # Your DataFrame
|
2537
|
+
grouping_column=settings['grouping_column'], # Column for grouping the data (x-axis)
|
2538
|
+
data_column=settings['column_name'], # Column for the data (y-axis)
|
2539
|
+
graph_type=settings['graph_type'], # Type of plot ('bar', 'box', 'violin', 'jitter')
|
2540
|
+
summary_func='mean', # Function to summarize data (e.g., 'mean', 'median')
|
2541
|
+
colors=None, # Custom colors for the plot (optional)
|
2542
|
+
output_dir=settings['dst'], # Directory to save the plot and results
|
2543
|
+
save=settings['save'], # Whether to save the plot and results
|
2544
|
+
y_axis_start=0, # Starting point for y-axis (optional)
|
2545
|
+
error_bar_type='std', # Type of error bar ('std' or 'sem')
|
2546
|
+
representation='well',
|
2547
|
+
theme=settings['theme'], # Seaborn color palette theme (e.g., 'pastel', 'muted')
|
2548
|
+
)
|
2549
|
+
|
2550
|
+
# Create the plot
|
2551
|
+
spacr_graph.create_plot()
|
2552
|
+
|
2553
|
+
# Get the figure object if needed
|
2554
|
+
fig = spacr_graph.get_figure()
|
2555
|
+
|
2556
|
+
# Optional: Get the results DataFrame containing statistical test results
|
2557
|
+
results_df = spacr_graph.get_results()
|
2558
|
+
display(results_df)
|
2559
|
+
return fig
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/Roboto-Slab-Bold.woff
RENAMED
File without changes
|
{spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/Roboto-Slab-Bold.woff2
RENAMED
File without changes
|
{spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/Roboto-Slab-Regular.woff
RENAMED
File without changes
|
{spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/Roboto-Slab-Regular.woff2
RENAMED
File without changes
|
{spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/fontawesome-webfont.eot
RENAMED
File without changes
|
{spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/fontawesome-webfont.svg
RENAMED
File without changes
|
{spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/fontawesome-webfont.ttf
RENAMED
File without changes
|
{spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/fontawesome-webfont.woff
RENAMED
File without changes
|
{spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/fontawesome-webfont.woff2
RENAMED
File without changes
|
{spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/lato-bold-italic.woff
RENAMED
File without changes
|
{spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/lato-bold-italic.woff2
RENAMED
File without changes
|
File without changes
|
File without changes
|
{spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/lato-normal-italic.woff
RENAMED
File without changes
|
{spacr-0.3.32 → spacr-0.3.33}/docs/source/_build/html/_static/css/fonts/lato-normal-italic.woff2
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|