cancer-evolution / SPIAT

Spatial Image Analysis of Tissues
15 stars 7 forks source link

Analyzing INFORM DATA #17

Open dasilew opened 2 years ago

dasilew commented 2 years ago

Hi everyone, I would like to use SPIAT for analysis of multiplex IHC images. #

I face problems with the import of the file. Could you maybe help to give tipps on how to code loading the data, in order to use the marker_permutation function. I would appreciate a lot your help and input! thanks d

fuerzhou commented 2 years ago

Hi @dasilew ,

Sorry for the slow reply. Not sure if you still need this but I'll copy the code to read your image here anyway. The code used the functions from the "master" branch (v0.2).

Please note that marker_permutation function is not fully developed and we have removed it from the newest version of SPIAT (0.99.0). The new version has just been submitted to Bioconductor and we anticipate it in the devel branch of Bioconductor in a few days. Please stay tuned!

# Read image
raw_inform_data <- "~/Desktop/sce_object3.txt" #(change to your file path)
markers <- c("DAPI", "FoxP3", "CD3", "CD163", "panCK", "CD8", "PD.L1")
intensity_columns_interest <- c(
    "Nucleus.DAPI...DAPI..Mean..Normalized.Counts..Total.Weighting.",
    "Nucleus.FoxP3...Opal.540..Mean..Normalized.Counts..Total.Weighting.", 
    "Nucleus.CD3...Opal.570..Mean..Normalized.Counts..Total.Weighting.",
    "Nucleus.CD163...Opal.620..Mean..Normalized.Counts..Total.Weighting.",
    "Nucleus.panCK...Opal.650..Mean..Normalized.Counts..Total.Weighting.", 
    "Nucleus.CD8...Opal.520..Mean..Normalized.Counts..Total.Weighting.",
    "Nucleus.PD.L1...Opal.690..Mean..Normalized.Counts..Total.Weighting."
)

formatted_image <- format_image_to_sce(
    format="INFORM",
    image=raw_inform_data,
    markers=markers,
    intensity_columns_interest=intensity_columns_interest)

# use the following code to inspect the image
head(colData(formatted_image))
head(t(assay(formatted_image)))