Skip to content

Conversation

@sjspielman
Copy link
Member

Towards #882

This PR contains a draft notebook for day 1 of the spatial workshop we are developing. As noted in #882, depending on discussion this PR may or may not end up being merged, but we'll at a minimum use the PR for communicating feedback and discussion.

This notebook goes through processing for a Visium dataset, using a sample from SCPCP000006, with sections as follows. My goal was to get enough drafted material here to inspire discussion, with some potentially for both paring down and expanding in various areas.

  • import and intro to viz
  • filtering with spotsweeper (includes a little motivator about why local outlier detection might be better than global)
    • (a small thought that seemed like it might be taking it too far so I didn't include, but we could directly compare which spots would be removed if we were to choose global thresholds, vs which get removed from local outliers)
  • normalization
  • dimension reduction & non-spatial clustering
  • marker gene viz & exploration
    • this section tries to introduce some concepts in spatial thinking, using global & local Moran's I as a descriptive statistic for the main demonstration of the concepts. I could see some/all of this content living elsewhere too, but for our first round I liked the idea of using it early in the workshop to build intuition about how we think about spatial data but tried to implement it such that it wouldn't cause excessive cognitive overload - let me know if you think I achieved that! This section could also be a good candidate for reducing content by e.g. focusing more on spatial thinking conceptually rather than with specific stats.

Rendered draft: 01-processing_visium.nb.html

To run the code

  • get R 4.5 if you don't have it already
  • use the existing renv environment (uses bioc 3.22)
  • add the data/ (it's ok if the summary report and metadata json are also present, e.g. if you download from the portal as I did) as:
data
└── SCPCS000190
    └── SCPCL000429_spatial
        ├── filtered_feature_bc_matrix
        ├── raw_feature_bc_matrix
        └── spatial

Goals for reviewing

  • Are we ok proceeding with this dataset?
  • What aspects of overall structure need to change (bearing in mind the text is all placeholder at the moment)?
    • Any additional content/sections to include?
    • Which content/sections to remove or reduce?
  • Did this draft notebook inspire you to think of other directions, either complementary or different?
  • Did this draft notebook inspire you with concepts for an associated exercise?
    • Maybe analogous tasks on a Visium HD dataset, and along the way emphasize a) differences from spot-based and b) influence of binning choice (e.g. compare certain results at 8 um vs 16 um) and mention segmentation as a thing. (Worth noting, Space Ranger v4 includes segmentation with a modified implementation of StarDist, which we could/should use for neighborhood analyses currently potentially slotted for day 4 https://github.com/AlexsLemonade/training-admin/issues/1453)

Based on review, we can determine whether to proceed with this draft version, or whether a bigger pivot is needed. In the event of proceeding, I'd anticipate a several more stacked PRs to flesh out each section. But, I think it will make more sense to outline an accompanying exercise and/or different day's notebook before taking the effort to formalize a draft.

*Miscellaneous note for future us: these Visium plots are big. We need to make sure to use custom fig.width settings to ensure the rendered HTML doesn't get too big (some plots are currently squished, but this is a draft!).

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.

1 participant