SydneyBioX / MoleculeExperiment

https://sydneybiox.github.io/MoleculeExperiment/
Other
11 stars 0 forks source link

Vignette edit and readSegMask.R fix #8

Closed chungmuwei closed 9 months ago

chungmuwei commented 9 months ago

Vignette

  1. fixed typos
  2. Section 3.1.1 List 6: added BIDcell_segmask.tif image and in-situ plot for toyME in
  3. Section 3.1.2: added more detailed description about the keepCols argument of the readXenium()
  4. Section 6: changed the colours of virtual dissections (region 1 and region 2) to make them more visible. (segment_id and feature_id both used the same colours originally)

readSegMask.R

Used the original label value in the input image as the cell_id column in the geom_df instead of changing it to consecutive id.

Without the changes, this code snippet from the vignettes cannot successfully remove the background segment from the image since the segment_id was changed to a consecutive id from 1, 2, 3, ..., 89. So there was no segment_id with value 0.

repoDir <- system.file("extdata", package = "MoleculeExperiment")
segMask <- paste0(repoDir, "/BIDcell_segmask.tif")
boundaries(toyME, "BIDcell_segmentation") <- readSegMask(
  # use the molecule extent to define the boundary extent
  extent(toyME, assayName = "detected"),
  path = segMask, assayName = "BIDcell_segmentation",
  sample_id = "sample1", background_value = 0
)

toyME

Potentail risks

Demo plots

Here is a screenshot showing the BIDcell_segmentation boundaries and the input boundaries image before the changes.

Screenshot 2023-12-02 at 12 45 24 pm

And here is the same plot after the changes. toyME-in-situ