D3AIST: Data-Driven Detection of Atypical Interactions in Spatial Transcriptomics

Supplementary Material 5: Instructions/pipeline for reproducibility

1) Download, compile and install buildim and imfuse from the github repository:

git clone https://github.com/JdMDE/D3AIST.git

follwing the directions given at its README.md file

2) From inside the current directory (where this README lives), execute
the shell script createdirs.sh:

./createdirs.sh

This should create directories P1, P2, P5 and P6, with some subdirectories inside them.
P1, P2 and P5 correspond to GEO GSE280314 (Oliveira et al). P6 corresponds to
GEO GSE267680 (Bell et al).

3) Download the data from

https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE280314

and from

https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE267680

Then, extract the files

GSE280314_Xenium_V1_Human_Colon_Cancer_P{1,2,5}_CRC_Add_on_FFPE_outs.zip

and copy/move the csv files of cells and transcripts (cells.csv and transcripts.csv) to
subdirectories P1, P2 and P5 respectively

Also, extract the file

GSE267680_RAW.tar
and move .csv files of cells and transcripts of subdirectory data/xenium/PanIN1134 to
subdirectory P6

Keep also the morphology.ome.tif images at any known place for both cases since
subimages will have to be extracted from them later.

4) Edit each of the provided .desc files to change the variable PrependPath to the
current directory, as an absolute path. Then, execute buildim with each .desc file:

buildim P1Ac.desc
buildim P1Ae.desc
buildim P2Ad.desc
buildim P2Af.desc
buildim P5Ah.desc
buildim P6.desc

This will populate the subdirectories for each case and each selected area with the
R files contanining the coordinates of the transcription events as long as .groovy
scripts, .fuse description files for imfuse and .hist files with the gene abundance of
each area.

5) (Optional) Use QuPath to open each image and execute over them the .groovy scripts.
They will extract the subimages in the correct directory to be used by imfuse. They
will be named with the _backg.tif suffix. For users of other programs, the windows in
pixels for each area of each image are:

Case 1, Areac: (22274,14652) to (23482,15941)
Case 1, Areae: (21208,5642) to (23442,7556)
Case 2, Aread: (9738,12458) to (11015,13639)
Case 2, Areaf: (15820,19936) to (17421,21457)
Case 5, Areah: (18230,19132) to (19615,20326)
Case 6, Areaa: (18590,13178) to (25532,16243)

6) (Optional) Execute the imfuse program to get the images of each area with the
colored superimposed spots

imfuse [file.fuse] [your_desired_image_name] -adjcdown

7a) Edit the SuppMat2.qmd and change line 106 to adapt the path in variable PrependPath
to the current directory. Open R or RStudio and execute the qmd file to generate the
gene interaction graphs for the three areas of the GSE280314 study. Alternatively, you
can execute

quarto render SuppMat2.qmd

to run the file and generate SuppMat2.pdf, or run the script SuppMat2.R from inside R
using source("SuppMat2.R")

7b) Edit the SuppMat3.qmd and change line 98 to adapt the path in variable PrependPath
to the current directory. Open R or RStudio and execute the qmd file to generate the
gene interaction graphs for the area considered in the GSE267680 study. Alternatively,
you can execute

quarto render SuppMat3.qmd

to run the file and generate SuppMat3.pdf, or run the script SuppMat3.R from inside R
using source("SuppMat3.R")


 
