Skip to content

cnio-cmu-BioimageAnalysis/telomere_quantification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

processTelomereSegmentation

This Python script processes the output CSV files from QuPath telomere segmentation. It calculates several new features related to telomere intensity per nucleus and saves the results into a specified output directory.

Download processTelomereSegmentation code

  1. Go to the GitHub repository processTelomereSegmentation
  2. Click on <> Code > Download ZIP

  1. The downloaded repo will be found in the Downloads directory of your computer.

Setting up the environment

  1. Open a terminal or Anaconda Prompt.

    TIP: In the Microscopy Unit, we usually work with Miniforge. There is already a preconfigured environment to run this code. Most workstations have a shortcut to open the Miniforge Prompt directly. Make sure that the window title says something like:

  2. Activate the cellpose environment (or the environment where your required packages are installed).
    If you used Anaconda to install Cellpose, you can activate it by typing:

conda activate cellpose

Note: If you installed the dependencies in a different environment, make sure to activate the correct one.

Running the script

  1. Navigate to the location where you downloaded the repository and inside the src folder in the repository:
cd path/to/telomere_quantification/src
  1. Run the main Python script:
python main.py
  1. A GUI will pop up asking you to select:

    • Input directory: The folder where your QuPath telomere segmentation CSV files are stored.

      CAUTION: The input directory must contain only the .csv files you want to process.Do not include any other files in that folder, as the script assumes all files ending in .csv are valid inputs and will attempt to process them.

    • Output directory: The folder where the processed CSV files with the new calculated features will be saved.

  2. After selecting the directories, the script will start processing each file. When the processing finishes, you will see a message in the terminal for each file like:

    Processed file saved at: [path_to_file]_processed.csv

    This confirms that the file was successfully processed and saved. Each processed file keeps its original name with the suffix _processed added.

  3. Once the script finishes, you will find the processed CSV files in your selected output directory.
    Each output CSV will include the following new calculated columns:

Column name Description
Integrated density Sum intensity of each spot = mean intensity × area
Integrated density - mean per cell Mean per nucleus of sum intensity
Integrated density*number of foci - mean per cell Mean per nucleus of sum intensity × number of foci
Mean intensity - mean per cell Mean per nucleus of mean intensity
Max intensity - mean per cell Mean per nucleus of max intensity
Max intensity*number of foci - mean per cell Mean per nucleus of max intensity × number of foci
  1. You can now use the processed data for further analysis!

QuPath analysis script

This script is located inside the src/qupath_analysis_script folder in the repository. It will segment the nuclei of the cells with Cellpose deep learning models, using Channel 1(DAPI). After this step, it will segment, with a threshold-based algorithm, the spots (telomeres) on Channel 3. Then, it will calculate Max and Min intensities for each spot. And finally, it will export all measurements as a tab-separated csv file per image. If you want a per-cell summary of the spot measurements, you will have to run the python script mentioned above, to process all the csv files that QuPath generates. Before running this script, please create a folder named "output" at the same level as the QuPath project files.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published