Package: anchor-droplet-chip
⚓ anchor-droplet-chipMeasuring single-cell susceptibility to antibiotics within monoclonal fluorescent bacteria.We are imaging the entire chip using 20x 0.7NA objective lens using automatic stitching in NIS.
Bright-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.As 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.Installationpipinstallanchor-droplet-chipUsageNotebook:jupyter lab example.ipynbNapari plugin: see the menu `Plugins / andhor-droplet-chips / ...Command line:python -m adc.align --helppython -m adc.count --helpDowloading the raw dataHead to release pagehttps://github.com/BaroudLab/anchor-droplet-chip/releases/tag/v0.0.1and download files one by one.OrExecute the notebook example.ipynb - the data will be fetched automatically.Aligning the chips with the template and the maskDay 1:python-madc.alignday1/00ng_BF_TRITC_bin2.tiftemplate_bin16_bf.tiflabels_bin2.tifThis command will create the stack day1/00ng_BF_TRITC_bin2-aligned.tif, which can be viewed in Fiji.Day 2:python-madc.alignday2/00ng_BF_TRITC_bin2_24h.tiftemplate_bin16_bf.tiflabels_bin2.tifCounting the cells day 1 and day2python -m adc.count day1/00ng_BF_TRITC_bin2-aligned.tif day1/counts.csv
python -m adc.count day2/00ng_BF_TRITC_bin2_24h-aligned.tif day2/counts.csvCombining the tables from 2 dayspython adc.merge day1/counts.csv day2/counts.csv table.csvPlotting and fitting the probabilitiesSample dataBatch processing:First you'll need to clone the repo locally and install it to have the scripts at hand.gitclonehttps://github.com/BaroudLab/anchor-droplet-chip.gitcdanchor-droplet-chip

pipinstall.Make a data foldermkdirdataDownload the dataset from Zenodohttps://zenodo.org/record/6940212zenodo_get6940212-odataProceed with Snakemake pipeline to get tha table and plots. Be careful with the number of threads-cas a single thread can consume over 8 GBs of RAM.snakemake-c4-ddatatable.csvNapari plugin functionalutiesnd2 readerOpen large nd2 file by drag-n-drop and select anchor-droplet-chip as a reader.
The reader plugin will aotimatically detect the subchannels and split them in different layers.
The reader will also extract the pixel size from metadata and save it as Layer.metadata["pixel_size_um"]
The data itself is opened ad dask array using nd2 python library.SubstackSome datasets are so big, it's hard to even to open them, let alone doing processing in them.anchor-droplet-chip / Make a sub stackaddresses this problem.
Upon opening the plugin you'll see all  dimensions of you dataset, and the axes will become named accordingly.
Simply choose the subset of data you need, and click "Crop it!". This will create a new layer with the subset of data.
Note 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.Populate ROIs along the lineDraw 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.Crop ROIsUse this widget to crop the mapped previously ROIs. The extracted crops can be saved as tifs.Split along axisAllows to split any dataset along a selected axis and save the pieces as separate tifs (imagej format, so only TZCYX axes supported)Select the axis nameClick Split it! and check the table with the names, shapes and paths.To change the prefix, set the folder by clicking at "Choose folder"Once the table looks right, click "Save tifs" and wait. The colunm "saved" will be updated along the way.