Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add cell types to deconvoluted 10x Visium data? #57

Open
532at opened this issue Jun 5, 2024 · 3 comments
Open

How to add cell types to deconvoluted 10x Visium data? #57

532at opened this issue Jun 5, 2024 · 3 comments

Comments

@532at
Copy link

532at commented Jun 5, 2024

Hi,

I went through the whole tutorial (https://github.com/JEFworks-Lab/STdeconvolve/blob/devel/docs/visium_10x.md) with my data. Was wondering how to add these pixel groups of certain cell types as below:

Zrzut ekranu 2024-06-5 o 13 42 00

This part is not covered in the tutorial, but is I think the most important for the results.

Best,
Adrian

@bmill3r
Copy link
Collaborator

bmill3r commented Jun 7, 2024

Hi @532at,

If I understand correctly, you would like to better visualize which pixels belong the 5 different cell type groups? Actually, these are already visualized in the plot. The groups color the boundaries/lines of the scatter pies, whereas the topic colors fill the scatter pies. The plotting function is essentially a wrapper around ggplot2. You can add another layer to the plot to change the sizes of the scatter pie lines if they are too small for your liking.

Hope this helps,
Brendan

@532at
Copy link
Author

532at commented Jun 10, 2024

Hi @bmill3r,

not really, I put this image as an example what I would like to have after following your tutorial for Visium 10x Genomics (https://github.com/JEFworks-Lab/STdeconvolve/blob/devel/docs/visium_10x.md). If you click this link you will see that it creates different figure (below), without cell type groups. My question is how I can add these cell types groups to that pipeline.

Zrzut ekranu 2024-06-10 o 09 28 01

Thanks,
Adrian

@bmill3r
Copy link
Collaborator

bmill3r commented Jun 30, 2024

Hi @532at ,

If you look at the code chunk to generate that figure about:

plt <- vizAllTopics(theta = deconProp,
                   pos = pos,
                   r = 45,
                   lwd = 0,
                   showLegend = TRUE,
                   plotTitle = NA) +
  ggplot2::guides(fill=ggplot2::guide_legend(ncol=2)) +
  
  ## outer border
  ggplot2::geom_rect(data = data.frame(pos),
            ggplot2::aes(xmin = min(x)-90, xmax = max(x)+90,
                         ymin = min(y)-90, ymax = max(y)+90),
            fill = NA, color = "black", linetype = "solid", size = 0.5) +
  
  ggplot2::theme(
    plot.background = ggplot2::element_blank()
  ) +
  
  ## remove the pixel "groups", which is the color aesthetic for the pixel borders
  ggplot2::guides(colour = "none")

you'll see the last line:

 ## remove the pixel "groups", which is the color aesthetic for the pixel borders
  ggplot2::guides(colour = "none")

This is added on in this particular tutorial to remove the cell type groups. Just run the code but do not use this line and vizAllTopics should plot both the Topics and cell type Groups.

Hope this helps,
Brendan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants