Skip to content
wgiese edited this page Nov 8, 2019 · 52 revisions

Macrophage Analysis Wiki

This is a short overview on the scripts used for analyse spatial patterns of macrophage distributions. The analysis tools are written in Python 3.6, the following python modules need to be installed:

  • numpy
  • seaborn
  • matplotlib
  • pandas as pd
  • scipy
  • skimage

Usage

workflow diagram

The workflow is shown in the diagram above. As input the following files need to be provided

Metafile

mouse_name type analysis_file_vessels analysis_file_macrophages x_resolution [um] y_resolution [um] vessel_channel macrophage_channel
mouse_1 4 weeks vessel_file1.tif macrophages_1.csv 400 400 0 1
mouse_1 4 weeks vessel_file2.tif macrophages_2.csv 400 400 0 1
mouse_2 2 weeks vessel_file3.tif macrophages_3.csv 300 300 1 0

Series of vessel images

Binary images containing segemented vessels

X-Y positions of macrophages

X Y
1 225 37
1 186 220
1 160 279

Parameter file

The parameter file has the following content

    "data_directory": "/directory/to/your/data/",
    "output_directory": "/directory/to/your/output/",
    "meta_data_file" : "meta_file",
    "subfolder_vessel_images" : "subfolder/",
    "type_column" : "tumor_type",
    "macrophage_channel"  : ["macrophage_channel1", "macrophage_channel2"],
    "macrophage_position_files"   : ["macrophage_channel1_files","macrophage_channel2_files"],  
    "selected_feature" : ["distance_vessels"],
    "occupancy_radius" : 10.0,
    "occupancy_sampling" : 10000

Here you can adjust folder names and channel names etc.

Features

The following features can be calculated

  1. nearest distance of macrophages to the vessels
  2. nearest distance of macrophages to thick vessels (here thick is defined by a threshold on the vessel area)
  3. nearest distance of macrophages to thin vessels (here thin is defined by a threshold on the vessel area)
  4. normalized distance of macrophages to the vessels (here the distances are normalized to the distances that would stem from a completely random distribution)
  5. occupancy of vessels
  6. n-nearest neighbor distances among macrophages

Acknowledgements

leducq_logo

Clone this wiki locally