Conversation
jashapiro
left a comment
There was a problem hiding this comment.
Overall this looks good. I mostly have some comments about the gene list and how to handle getting it. It would be nice to provide the code to look up the gene ids from gene names (even better if that is already in the Space Ranger-derived rowData, but I don't remember if it is right now). But I would only use a vector after plotting a couple of individual genes (not pulling them from the vector). Or if you do use a named vector, use the names!
spatial/01-spatial_intro.Rmd
Outdated
| goi_list <- c( | ||
| "WT1" = "ENSG00000184937", | ||
| "SIX1" = "ENSG00000126778", | ||
| "MYCN" = "ENSG00000134323", | ||
| "NCAM1" = "ENSG00000149294", | ||
| "COL1A1" = "ENSG00000108821", | ||
| "TAGLN" = "ENSG00000149591", | ||
| "PECAM1" = "ENSG00000261371" | ||
| ) |
There was a problem hiding this comment.
I do think this is overkill. Just show the two genes. If you want to get fancy, maybe show them how to look up the gene symbol for a gene of interest, rather than providing a named vector (which is not a list, so don't name it that!)
spatial/01-spatial_intro.Rmd
Outdated
| We have a few more genes listed in the table, take a moment to plot one (or more!) below. | ||
| Do you see any spatial structure that seems consistent with the H&E? | ||
| Different from the H&E? | ||
| Are there regions of shared expression among genes, and would you expect that based on WT biology? |
There was a problem hiding this comment.
I won't go quietly.
| Are there regions of shared expression among genes, and would you expect that based on WT biology? | |
| Are there regions of shared expression among genes, and would you expect that based on Wilms tumor biology? |
spatial/01-spatial_intro.Rmd
Outdated
|
|
||
| **OR** | ||
|
|
||
| Let's use some `purrr` magic to plot this all at once! |
There was a problem hiding this comment.
On the other hand, I'm not too mad at this. But I'd still want to start with just a list of gene names and get the ensembl ids programmatically rather than providing them together.
spatial/01-spatial_intro.Rmd
Outdated
| gene_index <- 1 | ||
|
|
||
| wt1_plot <- ggspavis::plotCoords( | ||
| norm_spe, | ||
| # name of variable to color by | ||
| annotate = goi_list[gene_index], | ||
| # counts are plotted by default, so we need to override this | ||
| assay = "logcounts", | ||
| point_size = 1 | ||
| ) + | ||
| ggplot2::scale_color_viridis_c() + | ||
| ggplot2::labs(title = names(goi_list[gene_index])) |
There was a problem hiding this comment.
If you do decide you want to use the vector of genes, don't make a named vector and then not take advantage of it!
| gene_index <- 1 | |
| wt1_plot <- ggspavis::plotCoords( | |
| norm_spe, | |
| # name of variable to color by | |
| annotate = goi_list[gene_index], | |
| # counts are plotted by default, so we need to override this | |
| assay = "logcounts", | |
| point_size = 1 | |
| ) + | |
| ggplot2::scale_color_viridis_c() + | |
| ggplot2::labs(title = names(goi_list[gene_index])) | |
| gene_name <- "WT1" | |
| wt1_plot <- ggspavis::plotCoords( | |
| norm_spe, | |
| # name of variable to color by | |
| annotate = goi_list[gene_name], | |
| # counts are plotted by default, so we need to override this | |
| assay = "logcounts", | |
| point_size = 1 | |
| ) + | |
| ggplot2::scale_color_viridis_c() + | |
| ggplot2::labs(title = gene_name) |
|
I think what I would like to do is:
|
allyhawkins
left a comment
There was a problem hiding this comment.
Just noting that I don't have any additional comments at this time beyond what's been posted and agree with the plan to look at two genes individually and then plot the vector of genes.
|
Updated as discussed! Current version: 01-spatial_intro.nb.html |
allyhawkins
left a comment
There was a problem hiding this comment.
This looks good to me. My only comment is that I think the section showing the rowData and the two ensembl gene Ids is a little overkill and I would probably just remove it.
|
|
||
| We'll need to provide the gene's corresponding row name, which is its Ensembl gene id, to `ggpsavis::plotCoords()` so let's go ahead and find those first. | ||
|
|
||
| The `rowData` slot helpfully provides a gene symbol/Ensembl id mapping, if you haven't memorized all the ids yet: |
|
|
||
|
|
||
| ```{r get-ensembl, live = TRUE} | ||
| # define gene symbols |
There was a problem hiding this comment.
I agree that it can be helpful to show examples of grabbing information from the SPE, but I don't know that it's totally necessary here. Given the length of this notebook, I might favor skipping this and the next chunk.
There was a problem hiding this comment.
Maybe put something like this in the exercise instead to demo for them? (with solution = TRUE)
I have a panel of plots in the exercise outline too so this could be ready to go.
Closes #923
Closes #924
This PR adds the remaining sections to the first spatial notebook draft. I aimed to keep these sections pretty short since we have a lot already!
plotCoords()here, sinceplotVisium()with overlaid colored spots is a wild adventure to interpret. Does anyone want to advocate for showing it (even if only to show "gee I can't read this")?Rendered notebook:
knitted.nb.html