Skip to content

Add remaining text to BANKSY notebook#1010

Merged
sjspielman merged 13 commits into
masterfrom
sjspielman/more-banksy-text
Jun 1, 2026
Merged

Add remaining text to BANKSY notebook#1010
sjspielman merged 13 commits into
masterfrom
sjspielman/more-banksy-text

Conversation

@sjspielman
Copy link
Copy Markdown
Member

Closes #993

This PR adds in remaining text to the BANKSY notebook.

I also modified a plot to be able to more easily see spots when interpreting expression.
However, I also am leaning towards removing the heatmap since I think it's just annoying to interpret and the expression plots do just as well. Wanted to get a second opinion though before I ripped it out though - let me know what you think!

02-spatial_clustering.nb.html

@sjspielman sjspielman requested a review from jashapiro May 27, 2026 15:56
Copy link
Copy Markdown
Member

@jashapiro jashapiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks good; most of my comments are small, and the ones that are a bit larger you probably knew to expect... care about over-interpretation and a bias toward questions not conclustions.

Other than that, my biggest "major edit" is consistency in how we style "BANKSY" when we are not referring to code. I would say we should not put it in code style most of the time when we referring to the approach/algorithm, not the package. When we do refer to the package, we should probably be styling it Banksy, as that is how it appears in code.

Comment thread spatial/02-spatial_clustering.Rmd Outdated
Comment thread spatial/02-spatial_clustering.Rmd Outdated
Comment thread spatial/02-spatial_clustering.Rmd Outdated
Comment thread spatial/02-spatial_clustering.Rmd Outdated
Comment thread spatial/02-spatial_clustering.Rmd Outdated
Comment thread spatial/02-spatial_clustering.Rmd Outdated
Comment thread spatial/02-spatial_clustering.Rmd Outdated
For example, we can see from the coordinate plots that non-spatial clusters 3 and 5 correspond to spots likely dominated by tumor cells, which has been split into several BANKSY AGF clusters including at least 3, 5, and 7.
The heatmap helps us see how non-spatial clusters map onto the finer AGF cluster structure.
For example, we can see from the coordinate plots that non-spatial clusters 3 and 5 contain spots that are likely dominated by tumor cells.
These clusters have been split into several `BANKSY` AGF clusters, suggesting that AGF is resolving finer spatial structure within regions that expression-only clustering treated as a single domain.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you know this is spatial structure and not over-clustering? I would be cautious with the claims here. As before, I would lean toward questions rather than statements. I would include in those statements something about the AGF1 cluster, which doesn't really seem to me to be anything except "top right".

Comment thread spatial/02-spatial_clustering.Rmd Outdated

# plot heatmap:
# non-spatial clusters are rows, and BANKSY with AGF clusters are columns
# non-spatial clusters are columns, and BANKSY with AGF clusters are rows
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be very helpful to add axis labels with this information. Unfortunately, this is hard with pheatmap. As a workaround, you might add to the cluster labels so they are not just integers... e.g.. AGF1 AGF2, etc.

Comment thread spatial/02-spatial_clustering.Rmd Outdated
Comment thread spatial/02-spatial_clustering.Rmd Outdated
patchwork::wrap_plots(plot_list, nrow = 2)
```

Do these patterns match your expectations from the coordinate plots showing clusters on the H&E?
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like we could use a bit more here? Personally, I'm not sure I have any expectations about a single gene in the context of clusters, and both seem to have gradients of expression...

sjspielman and others added 2 commits May 29, 2026 12:43
@sjspielman
Copy link
Copy Markdown
Member Author

Other than that, my biggest "major edit" is consistency in how we style "BANKSY" when we are not referring to code. I would say we should not put it in code style most of the time when we referring to the approach/algorithm, not the package. When we do refer to the package, we should probably be styling it Banksy, as that is how it appears in code.

Look, they don't even know what to do: https://prabhakarlab.github.io/Banksy/
Screenshot 2026-05-29 at 12 49 11 PM

I'm a bit tempted to just always call it Banksy since that's the actual package name, and that gets hard to remember with the all-caps styling

@jashapiro
Copy link
Copy Markdown
Member

Look, they don't even know what to do: https://prabhakarlab.github.io/Banksy/
Screenshot 2026-05-29 at 12 49 11 PM

Oh my.

@sjspielman
Copy link
Copy Markdown
Member Author

I went ahead and swapped all around to Banksy (apologies for all the review clutter this introduces...), updated the heatmap, and took a stab at some rephrasings. I don't hate my rephrasings, but I also don't love them, and you should feel more than welcome to suggest big changes!

Copying the updated heatmap in here for review vs the whole notebook
image

@sjspielman sjspielman requested a review from jashapiro May 29, 2026 18:11
Copy link
Copy Markdown
Member

@jashapiro jashapiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay almost there! all the various edits mean that I get to revisit where we refer to the package vs. functions, which is minor, but there was one major thing:

The text still says we are not filtering to hvgs in this notebook, but we are! Sorry that I missed that in the last edit!

Comment thread spatial/02-spatial_clustering.Rmd Outdated
Comment thread spatial/02-spatial_clustering.Rmd Outdated
Comment thread spatial/02-spatial_clustering.Rmd Outdated
Comment thread spatial/02-spatial_clustering.Rmd Outdated

`Banksy` first creates single matrix that is a weighted combination of the normalized expression in `logcounts` and the `Banksy` neighborhood matrix (`H0` or `H0` and `H1` if AGF is on).
(Note that `Banksy` will consider all genes present in the SPE when calculating the PCA; it does not subset to only the most variable genes.
We could perform this ourselves by subsetting the SPE before running `Banksy`, but for this notebook we will proceed with the full object.)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, I thought we were filtering?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed!!

Comment thread spatial/02-spatial_clustering.Rmd Outdated
sjspielman and others added 3 commits June 1, 2026 07:57
Co-authored-by: Joshua Shapiro <josh.shapiro@ccdatalab.org>
Co-authored-by: Joshua Shapiro <josh.shapiro@ccdatalab.org>
@sjspielman sjspielman requested a review from jashapiro June 1, 2026 12:12
Copy link
Copy Markdown
Member

@jashapiro jashapiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (though one period was lost in the edit)

Comment thread spatial/02-spatial_clustering.Rmd Outdated
sjspielman and others added 2 commits June 1, 2026 10:35
@sjspielman sjspielman merged commit c5128b8 into master Jun 1, 2026
5 checks passed
@sjspielman sjspielman deleted the sjspielman/more-banksy-text branch June 1, 2026 15:27
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

Successfully merging this pull request may close these issues.

Expand text in BANKSY notebook

2 participants