Skip to content

AI4SCR/prostate-cancer-microenvironment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PCa

Set-up

Python

Install the regular Python dependencies from pyproject.toml.

Some project dependencies are installed manually and are not managed through pyproject.toml:

uv pip install -e ~/projects/ai4bmr-datasets
uv pip install -e ~/projects/ai4bmr-learn
uv pip install -e ~/projects/ATHENA

Git Configuration

Add task specific ignores in the corresponding .gitignore of the relevant sub-folders. I recommend to configure your global ignores with this gist.

Environment

Your scripts should access the data in the machine specific folder. Use .env in this folder with the following content: To make the environment variable available to your scripts, you need to load the .env file.

# with R
library(dotenv)
PATH_BOX = Sys.getenv("PATH_BOX")
# with python
from dotenv import load_dotenv
load_dotenv()

import os
PATH_BOX = os.getenv('PATH_BOX')

Slurm

To start a Slurm job that keeps an allocation alive for 24 hours, run:

sbatch -p gpu-l40 --gres=gpu:1 --mem=128G --time=24:00:00 --wrap='sleep 24h'

Steinbock

Setup

Install docker dektop and make sure that the daemon is running. Add the following function to your .zshrc or .bashrc to make the steinbock docker image available as a command.

# in your terminal
vim .zshrc
steinbock0.16.1(){
docker run \
-v "$(pwd)":/data \
ghcr.io/bodenmillergroup/steinbock:0.16.1 \
"$@"
}

Set-up

R

Do not install R with brew on Mac!

Add CRAN Repository and Key https://cran.r-project.org/bin/linux/ubuntu/fullREADME.html

if (!require("BiocManager", quietly = TRUE))
  install.packages("BiocManager")
BiocManager::install(version = "3.18")

Available CPU Processors
echo "CPU threads: $(grep -c processor /proc/cpuinfo)"
update.packages(lib.loc="/usr/local/lib/R/site-library", ask = FALSE,
  checkBuilt = TRUE, Ncpus = 28)

install.packages(
'rlang', 'ggrastr', 'ragg')
)

Warning messages:
1: In install.packages(...) :
  installation of packagetextshapinghad non-zero exit status
2: In install.packages(...) :
  installation of packageragghad non-zero exit status
3: In install.packages(...) :
  installation of packageggrastrhad non-zero exit status
4: In install.packages(...) :
  installation of packagescaterhad non-zero exit status
> client_loop: send disconnect: Broken pipe

R studio server

enbale incoming conncetions

sudo ufw allow 8787

Commands

mkdir -p steinbock/raw && cd steinbock
find <PATH_TO_RAW_DATA> -name "*.mcd" -exec cp raw/{} \; # copy .mcd files
ln -s <PATH_TO_PROJECT>/03_spatial/03_spatial/process-steinbock-panel.py .
steinbock0.16.1 preprocess imc panel
cut -d "," -f 2 panel.csv  # show available markers

conda activate PCa
python process-steinbock-panel.py panel.csv

steinbock0.16.1 preprocess imc images --hpf 50 --imgout img

mkdir img_store && mv img/* img_store
find img_store -regex ".*220811_TMA 17_15_III_A1_Big_slide 2_00[1-9].tiff" -exec mv {} img/ \;
find img_store -regex ".*PCa\ TMA\ 15_02_IVB\ ROI\ 1\ to\ 8_00[1-9].tiff" -exec mv {} img/ \;

steinbock0.16.1 segment deepcell --minmax --type nuclear && \
steinbock0.16.1 measure intensities && \
steinbock0.16.1 measure regionprops && \
steinbock0.16.1 measure neighbors --type centroids --kmax 5

Troubleshooting

  • When using symlinks make sure that the location to which the symlink points is available in the docker image, i.e. mounted

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors