satijalab / seurat

R toolkit for single cell genomics
http://www.satijalab.org/seurat
Other
2.3k stars 918 forks source link

Potential Visual Artifact When Adjusting mols.size in ImageDimPlot #9496

Open sallyseullee-0821 opened 3 days ago

sallyseullee-0821 commented 3 days ago

Hello Seurat Team,

While generating image plots using the ImageDimPlot function, I noticed an unexpected behavior when adjusting the mols.size parameter, which controls the size of the red dots representing molecules.

When comparing two figures:

  1. First one generated with mols.size = 0.5
  2. Second one generated with mols.size = 1 The red dots became smaller as expected. However, upon closer inspection, I observed some points that seemed to have changed positions, or disappeared, or newly appeared.

HPAP-092 52 INS_molsize0 5 HPAP-092 52 INS_molsize1

This discrepancy is puzzling, as the molecule positions should remain consistent regardless of dot size. I suspect this might be a visual artifact caused by altering the mols.size parameter. It seems possible that changing the size modifies the layer visibility within the image, potentially causing some areas to be covered or newly revealed.

Here is the code I used to generate the plots:

ImageDimPlot(
  object = IF.sub,
  fov = "zoom1",
  cols = col,
  alpha = 0.3,
  molecules = i,
  crop = TRUE,
  axes = TRUE,
  dark.background = FALSE,
  mols.cols = "red",
  **mols.size = 0.5**,  # Adjusted parameter
  nmols = 20000,
  border.color = NA,
  coord.fixed = TRUE,
  size = 1,
  mols.alpha = 1
) + 
  theme_bw()

The only difference between the two plots was the mols.size parameter.

Is this behavior expected, or does it indicate a potential issue with how ImageDimPlot renders molecule dots at different sizes? If this is a known limitation, are there recommendations to ensure consistent visualization while adjusting dot sizes?

I appreciate any guidance or clarification regarding this matter. Thank you for your time and assistance!