-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add JUMP image data compatibility and example notebook (#18)
* add testing data * add additional orig images * add exception messages for #15 * add imagecodecs; jupyterlab deps * shift to mask focus for current outlines * update to outline method; tests; outline image nms * add docs; slight modifications; example notebook * linting
- Loading branch information
Showing
17 changed files
with
1,871 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Examples | ||
|
||
```{toctree} | ||
--- | ||
caption: "List of examples" | ||
maxdepth: 2 | ||
glob: | ||
--- | ||
examples/* | ||
``` |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
# --- | ||
# jupyter: | ||
# jupytext: | ||
# text_representation: | ||
# extension: .py | ||
# format_name: light | ||
# format_version: '1.5' | ||
# jupytext_version: 1.16.4 | ||
# kernelspec: | ||
# display_name: Python 3 (ipykernel) | ||
# language: python | ||
# name: python3 | ||
# --- | ||
|
||
# # CytoDataFrame at a Glance | ||
# | ||
# This notebook demonstrates various capabilities of | ||
# [CytoDataFrame](https://github.com/WayScience/CytoDataFrame) using examples. | ||
# | ||
# CytoDataFrame is intended to provide you a Pandas-like | ||
# DataFrame experience which is enhanced with single-cell | ||
# visual information which can be viewed directly in a Jupyter notebook. | ||
|
||
# + | ||
from cytodataframe.frame import CytoDataFrame | ||
|
||
# create paths for use with CytoDataFrames below | ||
jump_data_path = "../../../tests/data/cytotable/JUMP_plate_BR00117006" | ||
nf1_cellpainting_path = "../../../tests/data/cytotable/NF1_cellpainting_data_shrunken/" | ||
nuclear_speckles_path = "../../../tests/data/cytotable/nuclear_speckles" | ||
# - | ||
# %%time | ||
# view JUMP plate BR00117006 with images | ||
CytoDataFrame( | ||
data=f"{jump_data_path}/BR00117006_shrunken.parquet", | ||
data_context_dir=f"{jump_data_path}/images/orig", | ||
)[ | ||
[ | ||
"Metadata_ImageNumber", | ||
"Cells_Number_Object_Number", | ||
"Image_FileName_OrigAGP", | ||
"Image_FileName_OrigDNA", | ||
"Image_FileName_OrigRNA", | ||
] | ||
][:3] | ||
|
||
# %%time | ||
# view JUMP plate BR00117006 with images and overlaid outlines for segmentation | ||
CytoDataFrame( | ||
data=f"{jump_data_path}/BR00117006_shrunken.parquet", | ||
data_context_dir=f"{jump_data_path}/images/orig", | ||
data_outline_context_dir=f"{jump_data_path}/images/outlines", | ||
)[ | ||
[ | ||
"Metadata_ImageNumber", | ||
"Cells_Number_Object_Number", | ||
"Image_FileName_OrigAGP", | ||
"Image_FileName_OrigDNA", | ||
"Image_FileName_OrigRNA", | ||
] | ||
][:3] | ||
|
||
|
||
# %%time | ||
# view NF1 Cell Painting data with images | ||
CytoDataFrame( | ||
data=f"{nf1_cellpainting_path}/Plate_2_with_image_data_shrunken.parquet", | ||
data_context_dir=f"{nf1_cellpainting_path}/Plate_2_images", | ||
)[ | ||
[ | ||
"Metadata_ImageNumber", | ||
"Metadata_Cells_Number_Object_Number", | ||
"Image_FileName_GFP", | ||
"Image_FileName_RFP", | ||
"Image_FileName_DAPI", | ||
] | ||
][:3] | ||
|
||
# %%time | ||
# view NF1 Cell Painting data with images and overlaid outlines from masks | ||
CytoDataFrame( | ||
data=f"{nf1_cellpainting_path}/Plate_2_with_image_data_shrunken.parquet", | ||
data_context_dir=f"{nf1_cellpainting_path}/Plate_2_images", | ||
data_mask_context_dir=f"{nf1_cellpainting_path}/Plate_2_masks", | ||
)[ | ||
[ | ||
"Metadata_ImageNumber", | ||
"Metadata_Cells_Number_Object_Number", | ||
"Image_FileName_GFP", | ||
"Image_FileName_RFP", | ||
"Image_FileName_DAPI", | ||
] | ||
][:3] | ||
|
||
# %%time | ||
# view nuclear speckles data with images and overlaid outlines from masks | ||
CytoDataFrame( | ||
data=f"{nuclear_speckles_path}/test_slide1_converted.parquet", | ||
data_context_dir=f"{nuclear_speckles_path}/images/plate1", | ||
data_mask_context_dir=f"{nuclear_speckles_path}/masks/plate1", | ||
)[ | ||
[ | ||
"Metadata_ImageNumber", | ||
"Nuclei_Number_Object_Number", | ||
"Image_FileName_A647", | ||
"Image_FileName_DAPI", | ||
"Image_FileName_GOLD", | ||
] | ||
][:3] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.