Skip to content

This repository was created for code used in the manuscript [1].

Notifications You must be signed in to change notification settings

stolzbernadette/TDA-Tumour-Vasculature

Repository files navigation

TDA-Tumour-Vasculature

Project founder:

Bernadette J. Stolz (for more information, see here.)

Description

This repository was created for code used in the manuscript [1]. The manuscript can be found here.

1_Data Extraction

This folder contains scripts to reconstruct 3D vascular networks from .nii image stacks (to create .nii files from .tiff stacks use Matlab toolbox by Sainsbury Wellcome Centre ( documentation ).

  • unet_core: Software package shared with permission from Russell Bates (see here for an updated version of this package that is compatible with newer versions of Python)

  • getUltramicroscopyDataScript.py:

    • input: .nii files

    • output: Folder Components with files ComponentXBranchY.txt: List of 3D coordinates along branch Y (on component X) starting and ending with a branching point (these are repeated on daughter branches)

    • Requirements: python3, networkx version 1.9

  • getDataSkeletonParams.py:

    • input: .nii files

    • output: Folder Components with files Summary_ComponentZ.txt: List of 3D coordinates of branching point 1, 3D coordinates of branching point 2, branch diameter, branch length, sum of angles metric (SOAM), chord-length-ratio (clr) for each branch on the component

  • RocheFormatAllVesselsComponentwise.m:

    • input: ComponentXBranchY.txt files

    • output: Vessels.mat summary of coordinates ordered by components and branches

  • getZAdjustedVessels.m:

    • input: Vessels.mat

    • output: ZVessels.mat adjusted coordinates that account for resolution difference in z-direction in intravital data

2_Radial Filtration

  • RocheConstructRadialFiltrationParallelFullQuarterPoints.m: Runs radial filtration on ultramicroscopy data

    • input: Vessels.mat files

    • output: Figures of vessel network points and chosen centre for radial filtration, barcodes for dimension 0 and 1 of the radial filtration, Betti curves

    • Requirements: javaPlex software

  • ConstructRadialFiltrationParallelScript: Runs radial filtration on intravital data

    • input: ZVessels.mat files

    • output: Figures of vessel network points and chosen centre for radial filtration, barcodes for dimension 0 and 1 of the radial filtration, Betti curves

    • Requirements: javaPlex software

3_Alpha Complex

Requirements: GUDHI

  • RocheGUDHI_Format_Parallel.m: Prepares ultramicroscopy data for alpha complex filtration

    • input: Vessels.mat files

    • output: .txt files with point cloud input formatted for GUDHI

  • RocheGetAlphaComplexes.m: Runs alpha complex filtration on ultramicroscopy data

    • input: .txt files with point cloud input formatted for GUDHI

    • output: barcodes for alpha complex filtration

    • uses function gudhi_reformat_output.m from here

  • GUDHI_Format_Parallel.m: Prepares intravital data for alpha complex filtration

    • input: ZVessels.mat files

    • output: .txt files with point cloud input formatted for GUDHI

  • GetAlphaComplexes.m: Runs alpha complex filtration on intravital data

    • input: .txt files with point cloud input formatted for GUDHI

    • output: barcodes for alpha complex filtration

    • uses function gudhi_reformat_output.m from here

4_Extraction of Topological Features

This folder contains codes that we use to extract topological descriptors from the barcodes of the radial filtration and the alpha complex filtration.

  • RocheGetBettiStruct.m: This script creates the file Roche_tumour_data.mat and includes the following information from the H_1 barcodes for each tumour:

    • Name

    • Day after initial treatment

    • Folder name

    • Betti 1 curve radial filtration

    • Total number of loops radial filtration

    • Total number of loops radial filtration

    • Number of loops in the first 250 filtration steps of the radial filtration (core)

    • Number of loops in the second 250 filtration steps of the radial filtration (periphery)

    • Distribution of loops across the filtration steps of the radial filtration

    • Birth times of loops in the radial filtration with respect to filtration steps

  • RocheGetMaximalRadius.m: This script extracts the following information from the Vessels.mat file of each tumour: Maximal radius used in the radial filtration

  • RocheAddBetti0toStruct.m: This script adds information from the H_0 barcodes to the file Roche_tumour_data.mat:

    • Birth times of connected components with respect to distance to the tumour centre

    • Death times of connected components with respect to distance to the tumour centre

    • Birth times of connected components with respect to filtration step

    • Death times of connected components with respect to filtration step

  • RocheDoboszStats.m: This script outputs.txt files with the number of branching points, the distances of branching points to the tumour centre, the number of vessel segments, and the distances of vessel segments to the tumour centre for each tumour.

  • RocheGetDoboszStatsInStruct.m: This script includes the the number of branching points, the distances of branching points to the tumour centre, the number of vessel segments, and the distances of vessel segments to the tumour centre in Roche_tumour_data.mat for each tumour. It further adds parameters to the file that were not used in our final analysis.

  • RocheGetTrueDoboszStatsInStruct.m: This script includes the parameters analysed by Dobosz et al. 2014 from CompleteStatistics_reduced_matrixform.csv and CompleteStatistics_reduced.csv into Roche_tumour_data.mat for each tumour.

  • RocheAddAlphaToStruct.m: This script adds the birth and death times for H_2 in the alpha complex filtration as well as the median persistence to Roche_tumour_data.mat.

  • RocheGetLoopsAndTortuosityBySegments.m: This script analyses the number of loops and number of short bars per vessel segment.

We copied relevant parameters from Roche_tumour_data.mat and the output of RocheGetLoopsAndTortuosityBySegments.m into the files RocheDataForR.csv and RocheLoopsStarts.csv for subsequent analysis in R (located in folder 5_Statistical Analysis of Results). The intravital data was analysed adapting the above scripts to create the file tumour_data.mat. We copied relevant parameters to MC38Data.csvfor subsequent analysis in R (located in folder 5_Statistical Analysis of Results).

5_Statistical Analysis of Results

This folder contains all statistical analyses performed on the intravital and ultramicroscopy data as well as the .csv files used for the analysis.

References

[1] Multiscale Topology Characterises Dynamic Tumour Vascular Networks. BJ Stolz, J Kaeppler, B Markelc, F Mech, F Lipsmeier, RJ Muschel, HM Byrne, HA Harrington, Science Advances 8 (23), eabm2456, 2022.

About

This repository was created for code used in the manuscript [1].

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published