Skip to content

Commit

Permalink
Use sample data in notebooks (#12)
Browse files Browse the repository at this point in the history
* Organized sample data like real data.

* Removed output from notebook.

* Fix buggy image sorting.

* Added description of the sample data.

* Use sample data in notebooks.

* Allow user not to sort the images.

* Fixed minimum mass for biological channels.
  • Loading branch information
mapazarr authored Apr 12, 2020
1 parent 2298051 commit 4d6e360
Show file tree
Hide file tree
Showing 16 changed files with 145 additions and 171 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This module contains a python source file with helper functions in order to plot
2. help with the visualization of the several steps of the low level analysis (background subtraction and image cleaning) of the MIBI data.

The notebooks are particularly useful to visualize the data coming out from the MIBI/O (a.k.a. mibio) analysis software from IONpath or the MIBItracker.
The notebooks are stored in a clean state, but can be run immediately to obtain meaningful plots that exemplify the usage of the visualization tools, using the data stored in the *sample_data* module.

### interface_mibio

Expand All @@ -26,6 +27,20 @@ This module is only intended for advanced users. It contains a single python fil

In order to install and use this module, only the script inside the module and a regular python3 installation are required (no conda is necessary). The following sections refer to the main module of this repository.

### sample_data

This module contains real MIBI data used within the notebooks of the *mibisualization* module.
The data represents one point (a.k.a. FoV or ROI) in one run (a.k.a. slide) and comes in the form of:
- MIBItiff files containing image data for each of the cleaning steps:
- raw binned images (in subfolder `bg_none`).
- slide bg removal (in subfolder `bg_au_050_ta_020`).
- isobaric corrections (characterized only for channel 115; with suffix `-MassCorrected`).
- denoising (with suffix `-Filtered`).
- CSV files containing panel information and spectral data.
- JSON files containing cleaning parameters: isobaric correction and denoising parameters.

The slide bg was removed using thresholds of 50 and 20 counts for the gold and tantalum channels respectively.

## Installation

- Install the Python 3.7 version from [Miniconda](https://docs.conda.io/en/latest/miniconda.html).
Expand Down
26 changes: 13 additions & 13 deletions mibisualization/visualize_channel.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -60,41 +60,41 @@
"metadata": {},
"outputs": [],
"source": [
"data_path = os.path.expanduser('~/common/path/to/data')\n",
"data_path = '../sample_data'\n",
"\n",
"# channel to plot\n",
"# define as mass, in order to anonymize the targets\n",
"channel_to_plot = 000\n",
"channel_to_plot = 115\n",
"\n",
"slide_num = 0\n",
"point_num = 0\n",
"run_name = 'run_name_for_slide0'\n",
"slide_num = 1\n",
"point_num = 1\n",
"run_name = 'CohortSlide1'\n",
"\n",
"# load tiffs\n",
"l_tiff_files = []\n",
"l_titles = []\n",
"\n",
"l_tiff_files.append(os.path.join(data_path,\n",
" f'raw_msdf/{run_name}/{run_name}_TIFF',\n",
" f'sl{slide_num:02}_pt{point_num:02}/bg_none/',\n",
" f'{run_name}/{run_name}_TIFF',\n",
" 'bg_none',\n",
" f'Point{point_num}_RowNumber0_Depth_Profile0.tiff'))\n",
"l_titles.append('no bg removal')\n",
"\n",
"l_tiff_files.append(os.path.join(data_path,\n",
" f'raw_msdf/{run_name}/{run_name}_TIFF',\n",
" f'sl{slide_num:02}_pt{point_num:02}/bg_au_050_ta_020/',\n",
" f'{run_name}/{run_name}_TIFF',\n",
" 'bg_au_050_ta_020',\n",
" f'Point{point_num}_RowNumber0_Depth_Profile0.tiff'))\n",
"l_titles.append('bg removed: Au 50, Ta 20')\n",
"\n",
"l_tiff_files.append(os.path.join(data_path,\n",
" f'raw_msdf/{run_name}/{run_name}_TIFF',\n",
" f'sl{slide_num:02}_pt{point_num:02}/bg_au_050_ta_020/',\n",
" f'{run_name}/{run_name}_TIFF',\n",
" 'bg_au_050_ta_020',\n",
" f'Point{point_num}_RowNumber0_Depth_Profile0-MassCorrected.tiff'))\n",
"l_titles.append('isobaric interferences corrected')\n",
"\n",
"l_tiff_files.append(os.path.join(data_path,\n",
" f'raw_msdf/{run_name}/{run_name}_TIFF',\n",
" f'sl{slide_num:02}_pt{point_num:02}/bg_au_050_ta_020/',\n",
" f'{run_name}/{run_name}_TIFF',\n",
" 'bg_au_050_ta_020',\n",
" f'Point{point_num}_RowNumber0_Depth_Profile0-MassCorrected-Filtered.tiff'))\n",
"l_titles.append('denoised')\n",
"\n",
Expand Down
12 changes: 6 additions & 6 deletions mibisualization/visualize_channel_2thresholds.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,21 @@
"metadata": {},
"outputs": [],
"source": [
"data_path = os.path.expanduser('/Users/adam_kagel/Documents/AngeloLab/projects/LowLevelPipelines/exampleData')\n",
"data_path = '../sample_data'\n",
"\n",
"# channel to plot\n",
"# define as mass, in order to anonymize the targets\n",
"channel_to_plot = 151\n",
"channel_to_plot = 115\n",
"\n",
"# bg thresholds to use\n",
"bg_thresholds_au = [0, 1, 2, 3, 4, 5, 10, 20, 30, 40, 50, 100]\n",
"bg_thresholds_ta = [0, 1, 2, 3, 4, 5, 10, 20, 30, 40, 50, 100]\n",
"\n",
"# tiff files\n",
"slide_num = 0\n",
"point_num = 0\n",
"run_name = 'run_name_for_slide0'\n",
"tiff_file_prefix = f'raw_msdf/{run_name}/{run_name}_TIFF/'\n",
"slide_num = 1\n",
"point_num = 1\n",
"run_name = 'CohortSlide1'\n",
"tiff_file_prefix = f'{run_name}/{run_name}_TIFF/'\n",
"tiff_file_suffix = f'Point{point_num}_RowNumber0_Depth_Profile0.tiff'\n",
"\n",
"#anonymize_targets = True\n",
Expand Down
Loading

0 comments on commit 4d6e360

Please sign in to comment.