{"name":"anchor-droplet-chip","display_name":"anchor-droplet-chip","visibility":"public","icon":"","categories":[],"schema_version":"0.2.0","on_activate":null,"on_deactivate":null,"contributions":{"commands":[{"id":"anchor-droplet-chip.get_reader","title":"Read dataset","python_name":"adc._reader:napari_get_reader","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"anchor-droplet-chip.make_centers","title":"Show centers","python_name":"adc._sample_data:make_centers","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"anchor-droplet-chip.make_template","title":"Show template","python_name":"adc._sample_data:make_template","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"anchor-droplet-chip.DetectWells","title":"Detect wells","python_name":"adc._align_widget:DetectWells","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"anchor-droplet-chip.CombineStack","title":"Combine Stack","python_name":"adc._combine_widget:CombineStack","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"anchor-droplet-chip.CountCells","title":"Count Cells","python_name":"adc._count_widget:CountCells","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"anchor-droplet-chip.MakeProjection","title":"Make projection along selected axis","python_name":"adc._projection_stack:ProjectAlong","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"anchor-droplet-chip.ManualRois","title":"Populate ROIs","python_name":"adc._manual_rois:make_matrix","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"anchor-droplet-chip.CropRois","title":"Crop ROIs","python_name":"adc._manual_rois:crop_rois","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"anchor-droplet-chip.SubStack","title":"Make a sub stack","python_name":"adc._sub_stack:SubStack","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"anchor-droplet-chip.SplitAlong","title":"Split the stack along one dimension","python_name":"adc._split_stack:SplitAlong","short_title":null,"category":null,"icon":null,"enablement":null}],"readers":[{"command":"anchor-droplet-chip.get_reader","filename_patterns":["*.npy","*.nd2","*.zarr","*.tif","*.csv"],"accepts_directories":true}],"writers":null,"widgets":[{"command":"anchor-droplet-chip.DetectWells","display_name":"Detect wells","autogenerate":false},{"command":"anchor-droplet-chip.CombineStack","display_name":"Combine stack","autogenerate":false},{"command":"anchor-droplet-chip.CountCells","display_name":"Count Cells","autogenerate":false},{"command":"anchor-droplet-chip.CropRois","display_name":"Crop ROIs","autogenerate":false},{"command":"anchor-droplet-chip.ManualRois","display_name":"Populate ROIs along the line","autogenerate":false},{"command":"anchor-droplet-chip.SubStack","display_name":"Make a sub stack","autogenerate":false},{"command":"anchor-droplet-chip.SplitAlong","display_name":"Split the stack along one dimension","autogenerate":false},{"command":"anchor-droplet-chip.MakeProjection","display_name":"Make projection along one dimension","autogenerate":false}],"sample_data":[{"command":"anchor-droplet-chip.make_template","key":"template","display_name":"Show template"},{"command":"anchor-droplet-chip.make_centers","key":"centers","display_name":"Show centers"}],"themes":null,"menus":{},"submenus":null,"keybindings":null,"configuration":[]},"package_metadata":{"metadata_version":"2.1","name":"anchor-droplet-chip","version":"0.4.0","dynamic":null,"platform":null,"supported_platform":null,"summary":"Segment organoids and measure intensities","description":"# ⚓ anchor-droplet-chip\n## Measuring single-cell susceptibility to antibiotics within monoclonal fluorescent bacteria.\n\nWe are imaging the entire chip using 20x 0.7NA objective lens using automatic stitching in NIS.\nBright-field image 2D and TRITC-3D acquired. The 3D stack is converted to 2D using maximum projection in NIS or Fiji. Both channels are then merged together and saved as a tif stack. After that this package can be applied to detect the individual droplets and count the fluorescent cells.\n\nAs the chips are bonded to the coverslip manually, they contain a randon tilt and shift, so detecting individual droplets proved to be unreliable. The current approach consisnts of preparing a well-lebelled template bright-field image and a labelled mask and matching the experimental brightfield image to the template.\n![Paper outline(1)](https://user-images.githubusercontent.com/11408456/178001287-513e6398-c4e0-4946-b38f-6cb98dc0ee6c.svg)\n\n## Installation\n```bash\npip install anchor-droplet-chip\n```\n## Usage\n\n1. Notebook: `jupyter lab example.ipynb`\n2. Napari plugin: see the menu `Plugins / andhor-droplet-chips / ...\n3. Command line:\n\n `python -m adc.align --help`\n\n `python -m adc.count --help`\n\n### Dowloading the raw data\nHead to release page https://github.com/BaroudLab/anchor-droplet-chip/releases/tag/v0.0.1 and download files one by one.\n\nOr\n\nExecute the notebook example.ipynb - the data will be fetched automatically.\n\n### Aligning the chips with the template and the mask\n\nDay 1:\n```bash\npython -m adc.align day1/00ng_BF_TRITC_bin2.tif template_bin16_bf.tif labels_bin2.tif\n```\nThis command will create the stack day1/00ng_BF_TRITC_bin2-aligned.tif, which can be viewed in Fiji.\n![Screenshot of 00ng_BF_TRITC_bin2-aligned.tif](https://user-images.githubusercontent.com/11408456/176169270-3d494fc3-a771-4bf0-859e-c9cc853ce2d9.png)\n\nDay 2:\n```bash\npython -m adc.align day2/00ng_BF_TRITC_bin2_24h.tif template_bin16_bf.tif labels_bin2.tif\n```\n\n### Counting the cells day 1 and day2\n```\npython -m adc.count day1/00ng_BF_TRITC_bin2-aligned.tif day1/counts.csv\npython -m adc.count day2/00ng_BF_TRITC_bin2_24h-aligned.tif day2/counts.csv\n```\n\n### Combining the tables from 2 days\n```\npython adc.merge day1/counts.csv day2/counts.csv table.csv\n```\n\n### Plotting and fitting the probabilities\n\n\n## Sample data\n\n### Batch processing:\n\nFirst you'll need to clone the repo locally and install it to have the scripts at hand.\n\n```bash\ngit clone https://github.com/BaroudLab/anchor-droplet-chip.git\n\ncd anchor-droplet-chip\n\npip install .\n```\nMake a data folder\n```bash\nmkdir data\n\n```\nDownload the dataset from Zenodo https://zenodo.org/record/6940212\n```bash\nzenodo_get 6940212 -o data\n```\nProceed with Snakemake pipeline to get tha table and plots. Be careful with the number of threads `-c` as a single thread can consume over 8 GBs of RAM.\n```bash\nsnakemake -c4 -d data table.csv\n```\n\n# Napari plugin functionaluties\n\n## nd2 reader\n\nOpen large nd2 file by drag-n-drop and select anchor-droplet-chip as a reader.\nThe reader plugin will aotimatically detect the subchannels and split them in different layers.\nThe reader will also extract the pixel size from metadata and save it as Layer.metadata[\"pixel_size_um\"]\nThe data itself is opened ad dask array using nd2 python library.\n\n## Substack\n\nSome datasets are so big, it's hard to even to open them, let alone doing processing in them.\n`anchor-droplet-chip / Make a sub stack ` addresses this problem.\nUpon opening the plugin you'll see all dimensions of you dataset, and the axes will become named accordingly.\nSimply choose the subset of data you need, and click \"Crop it!\". This will create a new layer with the subset of data.\nNote that no new files are created in the process and in the background nd2 library lazy loading chunks of data from the original nd2 file.\n\n## Populate ROIs along the line\nDraw a line in the new shapes layer and call the widget. It will populate square ROIs along the line. Adjust the number of columns and rows. This way you can manually map the 2D wells on your chip.\n\n## Crop ROIs\nUse this widget to crop the mapped previously ROIs. The extracted crops can be saved as tifs.\n\n## Split along axis\n\nAllows to split any dataset along a selected axis and save the pieces as separate tifs (imagej format, so only TZCYX axes supported)\n* Select the axis name\n* Click Split it! and check the table with the names, shapes and paths.\n* To change the prefix, set the folder by clicking at \"Choose folder\"\n* Once the table looks right, click \"Save tifs\" and wait. The colunm \"saved\" will be updated along the way.\n![image](https://user-images.githubusercontent.com/11408456/214313498-5b1f8408-1fa3-4e24-810a-b9394e936c8e.png)\n","description_content_type":"text/markdown","keywords":null,"home_page":"https://github.com/BaroudLab/anchor-driplet-chip","download_url":null,"author":"Andrey Aristov","author_email":"aaristov@pasteur.fr","maintainer":null,"maintainer_email":null,"license":"BSD-3-Clause","classifier":["Development Status :: 2 - Pre-Alpha","Framework :: napari","Intended Audience :: Developers","License :: OSI Approved :: BSD License","Operating System :: OS Independent","Programming Language :: Python","Programming Language :: Python :: 3","Programming Language :: Python :: 3 :: Only","Programming Language :: Python :: Implementation :: CPython","Topic :: Software Development :: Testing"],"requires_dist":["dask","fire","jupyterlab","matplotlib","napari","nd2","numpy","pandas","pyqt6","pytest-qt","pyyaml","scikit-image","scipy","seaborn","tifffile","zarr-tools","zenodo-get"],"requires_python":">=3.8","requires_external":null,"project_url":["Source Code, https://github.com/BaroudLab/anchor-droplet-chip"],"provides_extra":null,"provides_dist":null,"obsoletes_dist":null},"npe1_shim":false}