{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# `ContaminationDetector` in action\n", "\n", "In this example, we apply `ContaminationDetector` from `coSMicQC` on an example dataset from the NF1 project.\n", "\n", "The NF1 project example includes wells from a cell line that was contaminated with mycoplasma.\n", "In the wet lab, these cells were detected as negative for mycoplasma.\n", "We do not want to process contaminated cells, so we can use this methodology to confirm the contamination and the extent of it on the plate.\n", "\n", "The result of this method is either a pass or fail.\n", "If the data is clean, then the method stops at step 1 and says the data is ready for further downstream analysis.\n", "If the data has contamination, this method will continue processing after step 1 to determine if the problem is for the whole plate or part of the plate.\n" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "\n", "from cosmicqc import ContaminationDetector\n", "\n", "# set a path for the NF1 parquet-based dataset\n", "data_path = (\n", " \"../../../tests/data/cytotable/NF1_cellpainting_data/Plate_3_filtered.parquet\"\n", ")" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "(1355, 2321)\n" ] }, { "data": { "text/html": [ "
\n", " | Metadata_ImageNumber | \n", "Image_Metadata_Plate | \n", "Metadata_number_of_singlecells | \n", "Image_Metadata_Site | \n", "Image_Metadata_Well | \n", "Metadata_Cells_Number_Object_Number | \n", "Metadata_Cytoplasm_Parent_Cells | \n", "Metadata_Cytoplasm_Parent_Nuclei | \n", "Metadata_Nuclei_Number_Object_Number | \n", "Image_FileName_CY5 | \n", "... | \n", "Nuclei_Texture_Variance_DAPI_3_02_256 | \n", "Nuclei_Texture_Variance_DAPI_3_03_256 | \n", "Nuclei_Texture_Variance_GFP_3_00_256 | \n", "Nuclei_Texture_Variance_GFP_3_01_256 | \n", "Nuclei_Texture_Variance_GFP_3_02_256 | \n", "Nuclei_Texture_Variance_GFP_3_03_256 | \n", "Nuclei_Texture_Variance_RFP_3_00_256 | \n", "Nuclei_Texture_Variance_RFP_3_01_256 | \n", "Nuclei_Texture_Variance_RFP_3_02_256 | \n", "Nuclei_Texture_Variance_RFP_3_03_256 | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "30 | \n", "Plate_3 | \n", "279 | \n", "15 | \n", "B11 | \n", "1 | \n", "1 | \n", "2 | \n", "2 | \n", "B11_01_3_15_CY5_001_illumcorrect.tiff | \n", "... | \n", "619.327600 | \n", "594.798669 | \n", "271.137249 | \n", "268.157417 | \n", "311.088206 | \n", "282.370923 | \n", "198.402061 | \n", "202.133683 | \n", "203.094321 | \n", "193.875072 | \n", "
1 | \n", "31 | \n", "Plate_3 | \n", "279 | \n", "16 | \n", "B11 | \n", "1 | \n", "1 | \n", "2 | \n", "2 | \n", "B11_01_3_16_CY5_001_illumcorrect.tiff | \n", "... | \n", "323.170295 | \n", "321.310711 | \n", "34.841145 | \n", "35.139114 | \n", "38.075206 | \n", "38.080602 | \n", "131.691809 | \n", "126.174866 | \n", "136.433036 | \n", "132.735107 | \n", "
2 | \n", "34 | \n", "Plate_3 | \n", "279 | \n", "19 | \n", "B11 | \n", "1 | \n", "1 | \n", "2 | \n", "2 | \n", "B11_01_3_19_CY5_001_illumcorrect.tiff | \n", "... | \n", "321.457911 | \n", "314.851226 | \n", "286.810209 | \n", "261.637391 | \n", "257.878700 | \n", "259.463388 | \n", "157.252242 | \n", "156.042241 | \n", "154.576787 | \n", "154.894240 | \n", "
3 | \n", "35 | \n", "Plate_3 | \n", "279 | \n", "1 | \n", "B11 | \n", "1 | \n", "1 | \n", "2 | \n", "2 | \n", "B11_01_3_1_CY5_001_illumcorrect.tiff | \n", "... | \n", "1487.354034 | \n", "1468.971582 | \n", "516.742751 | \n", "489.945367 | \n", "519.912829 | \n", "510.173091 | \n", "369.462002 | \n", "366.631748 | \n", "383.771987 | \n", "364.529179 | \n", "
4 | \n", "44 | \n", "Plate_3 | \n", "279 | \n", "6 | \n", "B11 | \n", "1 | \n", "1 | \n", "2 | \n", "2 | \n", "B11_01_3_6_CY5_001_illumcorrect.tiff | \n", "... | \n", "508.054695 | \n", "501.770497 | \n", "51.695327 | \n", "54.248623 | \n", "57.984869 | \n", "52.494053 | \n", "262.420251 | \n", "255.894670 | \n", "259.081931 | \n", "266.519397 | \n", "
5 rows × 2321 columns
\n", "