Ark-analysis

Latest version: v0.7.0

Safety actively analyzes 629855 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 6 of 8

0.4.3

Users will now be able to use the Docker image without any installation errors with the `arrow` library. Additionally, the Docker startup script now ensures only one container gets created per image.

🚀 Features

- Use existing Docker container when possible to prevent redundancy alex-l-kong ([742](https://github.com/angelolab/ark-analysis/pull/742))
- Remove `batch_size` parameter from spatial analysis functions alex-l-kong ([752](https://github.com/angelolab/ark-analysis/pull/752))
- Rework mask saving and cell labeling to support just single FOV parameter alex-l-kong ([737](https://github.com/angelolab/ark-analysis/pull/737))


🐛 Bug Fixes

- Patch up `arrow` library in Docker alex-l-kong ([748](https://github.com/angelolab/ark-analysis/pull/748))


🧰 Maintenance

- Bump to v0.4.3 alex-l-kong ([757](https://github.com/angelolab/ark-analysis/pull/757))

0.4.2

0.4.1

🚀 Features

<details>
<summary>Post clustering functionality ngreenwald (658)</summary>

**If you haven't already, please read through our [contributing guidelines](https://ark-analysis.readthedocs.io/en/latest/_rtd/contributing.html) before opening your PR**

**What is the purpose of this PR?**
Adds in logic to annotate the cell table following pixel clustering, as well as detailed instructions for how to use Mantis.

**How did you implement your changes**
A notebook with two parts. The first allows the user to select subsets of cells, give them new names, and then create a mantis directory to examine them. The second allows the user to identify specific thresholds for functional markers.

**Remaining issues**
For people who haven't used Mantis, is this clear enough guidance for what they need to do? Are there places where the bare code in the notebook is going to lead to problems? Given that the user is directly manipulating the pandas df there are some inelegant lines still in there, but I couldn't think of a way to avoid it that wasn't super over-engineered.
</details>

<details>
<summary>Update spatial analysis ackagel (451)</summary>

**Purpose**

The spatial analysis notebook doesn't support the current saved label format, doesn't support batching (although that might be hard to add conceptually), and is generally pretty lackluster feature/documentation wise. This PR hopes to update the notebook, clarify implementation details, and add QoL features, such as an example cell-cluster/expression image plot.

**Implementation**

So far just extracting tifs from the `.xr` labels file, and converting the notebook to load those tiffs, instead of the `.xr` file. More changes to come from separate branches.

**Remaining issues**

Only the labels loading interface has been updated so far. The rest of the features mentioned still need to be implemented.

</details>

<details>
<summary>Simplify `save_segmentation_labels` to remove label saving and default to channel overlay saving alex-l-kong (661)</summary>

**What is the purpose of this PR?**

Closes 626. There is no need to resave the segmentation labels (already done so in `_feature_0.tiff`), and the user should by default receive an overlay with the nuclear and membrane channels.

**How did you implement your changes**

1. Remove saving of segmentation labels.
2. Default `channels` arg to `['nuclear_channel', 'membrane_channel']`. This list will be assigned in `ark.settings` and copied over to prevent overwriting. Changes will propagate over to `Segment_Image_Data.ipynb` because no `channel` arg is passed, meaning the nuclear and membrane channel overlay gets generated by default.
</details>

<details>
<summary>Create release-drafter.yml srivarra (673)</summary>

**If you haven't already, please read through our [contributing guidelines](https://ark-analysis.readthedocs.io/en/latest/_rtd/contributing.html) before opening your PR**

**What is the purpose of this PR?**

Adds Github Actions to this repo via the workflow-template made in angelolab/.github.

**How did you implement your changes**

Made a few adjustments to the angelolab/.github.

**Remaining issues**

Will have to fix the icon later.

</details>

<details>
<summary>Delete .github/ISSUE\_TEMPLATE directory ngreenwald (670)</summary>

**If you haven't already, please read through our [contributing guidelines](https://ark-analysis.readthedocs.io/en/latest/_rtd/contributing.html) before opening your PR**

**What is the purpose of this PR?**
Removes the old templates in `ark` so that the repo-wide files will apply
</details>


🐛 Bug Fixes

<details>
<summary>Mantis Project - Improved Filtering of user Supplied FOVs srivarra (667)</summary>

- investigating mask issue
- added fov mask filtering

**If you haven't already, please read through our [contributing guidelines](https://ark-analysis.readthedocs.io/en/latest/_rtd/contributing.html) before opening your PR**

**What is the purpose of this PR?**

Closes 655.

**How did you implement your changes**

Updated the test to save different masks and segmentation labels for each FOV. In addition added filtering for user supplied FOVs, so only those masks with a supplied FOV get copied over. Improved the organization and documentation for this test function.

**Remaining issues**

Might want to refactor it one day, incase we create more Mantis related functions.
</details>


🧰 Maintenance

<details>
<summary>Next Release - v0.4.1 srivarra (674)</summary>

- added development docs for creating a new release
- label documentation -> dependencies

**If you haven't already, please read through our [contributing guidelines](https://ark-analysis.readthedocs.io/en/latest/_rtd/contributing.html) before opening your PR**

**What is the purpose of this PR?**

Creates a new Release of Ark. In addition adds instructions about creating a new release.

**How did you implement your changes**

Added detailed steps to go through when you create a new release.

**Remaining issues**

Waiting for the following to be merged to `main`:

- [x] 650
- [x] 658
- [x] 660
- [ ] 657 - Save v0.4.2
- [x] 675

After this is merged:

Create the new release with the tag: `v0.4.1`. This will push it to PyPI and create a new Docker Image.
</details>

<details>
<summary>Python 3.8 and Native Apple Silicon Support srivarra (650)</summary>

- bumped packages, skimage.tifffile -> tifffile
- tiffwriter adjustments
- adjusted connectivity in measure.label

**If you haven't already, please read through our [contributing guidelines](https://ark-analysis.readthedocs.io/en/latest/_rtd/contributing.html) before opening your PR**

**What is the purpose of this PR?**

Closes 649. Closes 504.

**How did you implement your changes**

Fixed API changes with respect to tifffile, and scikit-image. In addition bumped a few packages up for Apple Silicon compatibility.

Updated rtd requirements as well.

**Remaining issues**

- [x] Adjusting documentation, removing Rosetta installation instructions for miniforge.
</details>


📚️ Documentation

<details>
<summary>Ark Pipeline Flowchart srivarra (660)</summary>

**If you haven't already, please read through our [contributing guidelines](https://ark-analysis.readthedocs.io/en/latest/_rtd/contributing.html) before opening your PR**

**What is the purpose of this PR?**

Closes 211.

**How did you implement your changes**

Added a pipeline flowchart for the ark notebooks.

**Remaining issues**

Should we consider renaming `example_spatial_analysis_script` to reflect that it's using spatial pairwise enrichment?
</details>

<details>
<summary>Update README.md to account for new Docker tagging system alex-l-kong (675)</summary>

**What is the purpose of this PR?**

Although `start_docker.sh` will no longer require explicit updates to ensure the right image gets pulled, the user still needs to ensure the correct image gets pulled.

`start_docker.sh` does automatically pull the image for you, but this only applies if you don't have the image already. If you need to overwrite an existing image, you'll need to explicitly run the `docker pull` command with the correct tag.

**How did you implement your changes**

Change the Docker section of the `README.md` to explicitly tell the user which tag to look out for when running the `docker pull` command. This change will also be applied to the Docker update section.

**Remaining issues**

If we plan on overwriting the Docker images each time the dependencies change, then we can just allow `start_docker.sh` to update the image in the background without explicit input from the user.
</details>

<details>
<summary>Python 3.8 and Native Apple Silicon Support srivarra (650)</summary>

- bumped packages, skimage.tifffile -> tifffile
- tiffwriter adjustments
- adjusted connectivity in measure.label

**If you haven't already, please read through our [contributing guidelines](https://ark-analysis.readthedocs.io/en/latest/_rtd/contributing.html) before opening your PR**

**What is the purpose of this PR?**

Closes 649. Closes 504.

**How did you implement your changes**

Fixed API changes with respect to tifffile, and scikit-image. In addition bumped a few packages up for Apple Silicon compatibility.

Updated rtd requirements as well.

**Remaining issues**

- [x] Adjusting documentation, removing Rosetta installation instructions for miniforge.
</details>

<details>
<summary>Add a section to address restarting WSL in case of mounting issues alex-l-kong (664)</summary>

**What is the purpose of this PR?**

Closes 651. Occasionally, WSL may fail to mount an external drive correctly, meaning it cannot be accessed by Docker. The process to address this should be put in `windows_setup.md`.

**How did you implement your changes**

Add a brief step-by-step process for restarting WSL, which involves running `wsl --shutdown` and restarting Docker using the prompt that pops up.
</details>

<details>
<summary>Notebook Reorganization ngreenwald (648)</summary>

**If you haven't already, please read through our [contributing guidelines](https://ark-analysis.readthedocs.io/en/latest/_rtd/contributing.html) before opening your PR**

**What is the purpose of this PR?**

Reorganizes the notebooks to be more in line with toffy. Closes 640, closes 590

**Remaining issues**
The links, table of contents, etc in readme will need to be updated. The testbook stuff will need to be updated

</details>
ackagel, alex-l-kong, ngreenwald and srivarra

0.4.0

🚀 Features

<details>
<summary>Split up `som_utils.py` into separate modules for pixel and cell clustering alex-l-kong (662)</summary>

**What is the purpose of this PR?**

Closes 544. It's confusing to have both pixel and cell clustering helper functions reside in the same module, so we'll split them up.

**How did you implement your changes**

Reorganize the functions to `pixel_cluster_utils.py` and `cell_cluster_utils.py`, with the test modules also being moved accordingly.
</details>

<details>
<summary>Remove Rplots.pdf camisowers (638)</summary>

**If you haven't already, please read through our [contributing guidelines](https://ark-analysis.readthedocs.io/en/latest/_rtd/contributing.html) before opening your PR**

**What is the purpose of this PR?**

Closes 519. Removes the pdf that is produced by R scripts in the example_pixel_clustering notebook.
</details>



<details>
<summary>Docker Tags in line with ark-analysis Version srivarra (636)</summary>

**If you haven't already, please read through our [contributing guidelines](https://ark-analysis.readthedocs.io/en/latest/_rtd/contributing.html) before opening your PR**

**What is the purpose of this PR?**

Closes 634, 659.

Currently `latest` always points to the most recent build of the docker image, which may not be the current version of the repository. As a best practice we should tag the docker image to the same version of ark-analysis.

**How did you implement your changes**

Adjusted the docker build section of the `.travis.yml` to include the tag, and pushing it properly.

**Remaining issues**

None atm.
</details>

<details>
<summary>Add nuclear filtering functionality to pixel clustering pipeline alex-l-kong (653)</summary>

**What is the purpose of this PR?**

Closes 619. Prior to pixel clustering, users may need to filter out non-nuclear marker signal from the nucleus and vice-versa for nuclear marker signal.

**How did you implement your changes**

Add a function `filter_with_nuclear_mask` to `som_utils` which runs this process. The code in 619 provides most of the functionality, however we'll need to make two modifications:

- Ensure `seg_dir is not None` prior to running. Users may run pixel clustering without segmentation labels, however they will not be able to run this function if that's the case because it relies on the `_feature_1.tiff` files.
- Ensure `channel` defaults to `None` in the notebook and function. This is the easiest guard against errors caused by running all the cells at once in the notebook.

The cell that calls this function in `example_pixel_clustering` will be placed after the smoothing process.

This PR also solidifies some of the notebook testing, as it was not using the renamed channels after smoothing. This should also apply for the nuclear filtering tests too.
</details>

<details>
<summary>Added Batching Functionality to Pixel Mask Generation and FOV Saving srivarra (643)</summary>

**If you haven't already, please read through our [contributing guidelines](https://ark-analysis.readthedocs.io/en/latest/_rtd/contributing.html) before opening your PR**

**What is the purpose of this PR?**

Closes 552

**How did you implement your changes**

Added two batching functions for the pixel and cell clustering notebooks. In addition added testbook tests.

**Remaining issues**

None ATM.
</details>

<details>
<summary>Create Mantis Project Function srivarra (641)</summary>

- added mantis function
- mantis_project made

**If you haven't already, please read through our [contributing guidelines](https://ark-analysis.readthedocs.io/en/latest/_rtd/contributing.html) before opening your PR**

**What is the purpose of this PR?**

Closes 563.

**How did you implement your changes**

Added the function which creates a mantis project directory. Added tests to the mantis project function.

**Remaining issues**

Need to encapsulate pixel clustering output as well. Potential reorganization of the output if necessary. Also need to add an argument which only runs over a subset of fovs supplied (so the user won't copy over their entire run contents into a mantis project).
</details>

<details>
<summary>Save fov images as int16 camisowers (644)</summary>

**If you haven't already, please read through our [contributing guidelines](https://ark-analysis.readthedocs.io/en/latest/_rtd/contributing.html) before opening your PR**

**What is the purpose of this PR?**

Closes 521.
Edits the `save_fov_images` function so the pixel clustering notebook saves overlays images that can be loaded into photoshop.

**Remaining issues**

Could instead add the saving dtype as a default arg to the function, if that's something you think we'd use.
</details>

<details>
<summary>Ensure the meta cluster rename drop down menu for remapping doesn't get cut off alex-l-kong (642)</summary>

**What is the purpose of this PR?**

Closes 630. The way the toolbar is set up, the meta cluster renaming textbox/drop-down menu can get cut off on the far right. This needs to be pushed further to the center.

**How did you implement your changes**

Adjust the toolbar's `layout.justify_content` setting to `'center'`.

</details>

<details>
<summary>Add option to restart pixel clustering notebook from crash alex-l-kong (620)</summary>

**What is the purpose of this PR?**

Closes 575. `example_pixel_clustering.ipynb` includes very expensive processes such as preprocessing, SOM training, and SOM cluster assignment. This PR provides a way to prevent these from re-running (at least in full) for items that have already been checked off on a previous run that crashed midway through.

**How did you implement your changes**

Add options to check for files, or specific columns in files, indicating that certain processes have finished or not. This ensures we only need to process FOVs that haven't been completed.

</details>

<details>
<summary>Removal of `force_ints` in all load functions. srivarra (609)</summary>

**If you haven't already, please read through our [contributing guidelines](https://ark-analysis.readthedocs.io/en/latest/_rtd/contributing.html) before opening your PR**

**What is the purpose of this PR?**

Closes 606.

`load_imgs_from_tree` and `load_imgs_from_dir` will no longer allow any type conversions. There are significantly fewer user accessible type conversion options throughout ark.

**How did you implement your changes**

Removed the majority of front facing instances `dtype` in function arguments. In `deepcell_service_utils` the raw bytes output from `Deepcell` will now be converted from floating point to integer values.


**Remaining issues**

The JSON returned by Deepcell has the following metadata when running the `Segment_Image_Data.ipynb` notebook:
`{"shape": [1, 1024, 1024]}`. This is the same for this branch, master (after 605 was merged in), and with the last commit in 624. Seems like it was just something I got confused with when I was adjusting the reshaping earlier in the PR process.
</details>

<details>
<summary>Add `dtype` argument to channel and pixel norm functions alex-l-kong (623)</summary>

**What is the purpose of this PR?**

Closes 612. The `dtype` argument currently isn't propagated through to the channel and pixel normalization functions, causing the `load_imgs_from_tree` calls to attempt to load the images using the default `int16` type. This will throw a warning if the images were of type `float32` regardless of if the user passed `float32` to `create_pixel_matrix`.

**How did you implement your changes**

Add `dtype` with a default argument of `int16` to both `calculate_channel_percentiles` and `calculate_pixel_intensity_percentile`. Explicitly pass the `dtype` argument received by `create_pixel_matrix` to these functions.
</details>


🐛 Bug Fixes

<details>
<summary>Docker Tags in line with ark-analysis Version srivarra (636)</summary>

**If you haven't already, please read through our [contributing guidelines](https://ark-analysis.readthedocs.io/en/latest/_rtd/contributing.html) before opening your PR**

**What is the purpose of this PR?**

Closes 634, 659.

Currently `latest` always points to the most recent build of the docker image, which may not be the current version of the repository. As a best practice we should tag the docker image to the same version of ark-analysis.

**How did you implement your changes**

Adjusted the docker build section of the `.travis.yml` to include the tag, and pushing it properly.

**Remaining issues**

None atm.
</details>

<details>
<summary>Ensure channel norm and pixel norm files get re-computed if a new set of channels are provided alex-l-kong (654)</summary>

**What is the purpose of this PR?**

Closes 599. The underlying issue is if the user provides a different set of channels on a `pixel_output_dir` that has an existing `channel_norm.feather` computed on a different set of channels.

**How did you implement your changes**

We need to ensure that the set of channels provided when loading in an existing `channel_norm.feather` match the `channels` argument set-wise. If they don't, then we simply re-compute and re-save.

The same needs to be done for `pixel_norm.feather`. We store a checkpoint during the `channel_norm.feather` check to ensure this can happen seamlessly for the pixel norm too.
</details>

<details>
<summary>Pin matplotlib at 3.4.3 in requirements.txt to prevent colorbar scaling issue alex-l-kong (639)</summary>

**What is the purpose of this PR?**

Closes 614. Currently, the Python 3.7 image is built using the latest `matplotlib` version (3.5.x), which introduced several bugs to colorbar scaling. Several issues related to this are still open on the `matplotlib` repo, so it's best that we don't use this version for our purposes.

**How did you implement your changes**

Pin `requirements.txt` at version `3.4.2`.

**Remaining issues**

The Python 3.7 Docker image is still problematic because we haven't rebuilt it with `matplotlib==3.4.2` yet. Before this is done, users should continue using the Python 3.6/latest image.

Additionally, we should keep close watch of `matplotlib` updates on colorbar usage. Once they resolve the issue, we can matplotlib back to the most recent version.
</details>

<details>
<summary>add .json and .bin file compatibility to remove\_file\_extensions() camisowers (632)</summary>

**If you haven't already, please read through our [contributing guidelines](https://ark-analysis.readthedocs.io/en/latest/_rtd/contributing.html) before opening your PR**

**What is the purpose of this PR?**

Closes 631

</details>

<details>
<summary>Retry Deepcell in case of bad gateway (or similar) response errors alex-l-kong (605)</summary>

**What is the purpose of this PR?**

Closes 602, which indicates an error in decoding the JSON in case the Deepcell API returns a response indicating an error.

**How did you implement your changes**

Utilize the `Retry` module in `requests` and mount it to a `requests.Session`, which we use to invoke the `post` method to Deepcell.

We also add a `try`/`except` block around this statement in case none of the retries work and the resulting `json` cannot be decoded anyways.

**Remaining issues**

I'm a bit in the dark here because I've not encountered this error personally. ngreenwald let me know if this resolves the issue, or if it will need additional work.

</details>

<details>
<summary>PKG\_FOLDER variable in `setup.py` cannot find `requirements.txt` due to filepath issue. srivarra (624)</summary>

**If you haven't already, please read through our [contributing guidelines](https://ark-analysis.readthedocs.io/en/latest/_rtd/contributing.html) before opening your PR**

**What is the purpose of this PR?**

`ark-analysis` will not install properly via PyPI, the issue seems to reside with the `PKG_FOLDER` variable.

**How did you implement your changes**

Set `PKG_FOLDER` the same as it is in `toffy`.

**Remaining issues**

Need to adjust ark-analysis requirement in angelolab/toffy132, and make sure it can install properly.
</details>
alex-l-kong, camisowers and srivarra

0.3.2

🐛 Bug Fixes

<details>
<summary>PKG_FOLDER variable in `setup.py` cannot find `requirements.txt` due to filepath issue. srivarra (624)</summary>

**If you haven't already, please read through our [contributing guidelines](https://ark-analysis.readthedocs.io/en/latest/_rtd/contributing.html) before opening your PR**

**What is the purpose of this PR?**

`ark-analysis` will not install properly via PyPI, the issue seems to reside with the `PKG_FOLDER` variable.

**How did you implement your changes**

Set `PKG_FOLDER` the same as it is in `toffy`.

**Remaining issues**

Need to adjust ark-analysis requirement in angelolab/toffy132, and make sure it can install properly.
</details>

0.3.1

🚀 Features

<details>
<summary>Place `channel_norm.feather` and `pixel_norm.feather` in the pixel directory alex-l-kong (616)</summary>

**What is the purpose of this PR?**

Closes 610. This PR saves the normalization files in the pixel directory for the clustering run to ensure it doesn't get overwritten. Additionally, it adds `pixel_cluster_prefix` to their names.
</details>


🐛 Bug Fixes

<details>
<summary>VERSION 0.3.00 -> 0.3.1 srivarra (617)</summary>

**If you haven't already, please read through our [contributing guidelines](https://ark-analysis.readthedocs.io/en/latest/_rtd/contributing.html) before opening your PR**

**What is the purpose of this PR?**

This fixes an issue where version `0.3.00` does not exist, and pip / conda will try to install this version and fails.

**How did you implement your changes**

Adjusts the version from `0.3.00` to `0.3.1`. This should fix the installing it locally.


**Remaining issues**

None ATM.
</details>

<details>
<summary>Add back channel normalization before preprocessing cliu72 (613)</summary>

**What is the purpose of this PR?**

Add back channel normalization before pixel matrix generation, which seems to have been lost when parallelization was added. As in this commit: https://github.com/angelolab/ark-analysis/tree/370415cea71ec675c4be9f2c57a8644702390350 before the parallelization functionality was added, pixel values should be channel normalized before being fed into `create_fov_pixel_data`.

**How did you implement your changes**

Added back the code to channel normalize in `preprocess_fov` before calling `create_fov_pixel_data`.

**Remaining issues**

Don't think there are remaining issues.

</details>
alex-l-kong, cliu72 and srivarra

Page 6 of 8

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.