knitr::opts_chunk$set(echo = TRUE)

This script downloads the CellProfiler output of a small test dataset. The Github repository containing this data can be accessed here.

More specifically, we will use the 210308_ImcTestData dataset.

Download the CellProfiler output

Here, we will first download the output of the standard ImcSegmentationPipeline. For this, we an use the automatically generated Github assets.

cur_url <- "https://github.com/BodenmillerGroup/TestData/releases/download/v1.0.10/210308_ImcTestData_analysis_cpout.tar.gz"

download.file(cur_url, "210308_ImcTestData_analysis_cpout.tar.gz")
untar("210308_ImcTestData_analysis_cpout.tar.gz")
unlink("210308_ImcTestData_analysis_cpout.tar.gz")

Only copy the .csv files

For reading in the single-cell features, we will only need to copy the .csv files of the output folder.

file.copy(list.files("datasets/210308_ImcTestData/analysis/cpout/", pattern = ".csv$", full.names = TRUE),
          "../extdata/mockData/cpout", overwrite = TRUE)
unlink("datasets/", recursive = TRUE)

Rename object relationship file

This needs to be done to avoid an R CMD check warning indicating an invalid file name.

file.rename("../extdata/mockData/cpout/Object relationships.csv",
            "../extdata/mockData/cpout/Object_relationships.csv")


BodenmillerGroup/imcRtools documentation built on Oct. 14, 2024, 9:39 p.m.