scverse / squidpy_notebooks

Tutorials for Squidpy
https://squidpy.readthedocs.io/en/stable/
MIT License
30 stars 18 forks source link

prepare nanostring data and analysis #91

Closed dineshpalli closed 2 years ago

dineshpalli commented 2 years ago

Tutorial to load the Nanostring data, filter, normalize and to do analysis.

review-notebook-app[bot] commented 2 years ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-24T10:00:54Z ----------------------------------------------------------------

Line #1.    !pip install scikit-misc

move it down and add a comment on why you need it (seurat_v3 high var genes)

review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-24T10:24:54Z ----------------------------------------------------------------

  • either use for total_counts etc. or simply rewrite to "calculate qc metrics"
  • use size of titles to define sections


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-24T10:24:55Z ----------------------------------------------------------------

  • principal component analysis
  • remove topology


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-24T10:24:56Z ----------------------------------------------------------------

Line #1.    adata.raw = adata
  • remove raw
  • adata.layers["counts"] = adata.X.copy()
  • remove resolution from leiden, just use default

review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-24T10:24:57Z ----------------------------------------------------------------

  • remove topology
  • the fov (which are the technical batches ) mixes well in the umap, which means that the batch effect is potentially low.
  • remove leiden clustered subgroups -> leiden clusters


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-24T10:24:57Z ----------------------------------------------------------------

leiden grouping -> leiden clusters


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-24T10:24:58Z ----------------------------------------------------------------

  • use squidpy.pl.spatial_segment
  • in this section, show capabilities of scatter functionality.
  • plot all 26 slides
  • plot a subset of 2 slides
  • plot a single slide cropped with contour argument so to show boundaries of segmentation masks


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-24T10:24:59Z ----------------------------------------------------------------

fine to show subgrouping as feature of the spatial plot, do the same but with segments


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-24T10:24:59Z ----------------------------------------------------------------

don't write anndata ever, and don't read it again


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-24T10:25:00Z ----------------------------------------------------------------

now it starts the section on spatial statiscs, so create a new title and kind of separate this sectin from the qc before.


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-24T10:25:01Z ----------------------------------------------------------------

  • here you are computing spatial graph for the first time, use it to explain how e.g. generic + radius works compared to generic + delaunay
  • in this case you can use the library_key argument in spatial_neighbors to show that the spatial graph is computed for each slide separately


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-24T10:25:01Z ----------------------------------------------------------------

in general makes smaller plots


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-24T10:25:02Z ----------------------------------------------------------------

this function doesn't use spatial_connectivities but uses distances. This means that it should be computed on each FOV separately. For the purpose of the tutorial, here, before computing the co-occurrence score, create a subset of anndata

adata_subset = adata[adata.obs.fov=="0"].copy()
sq.gr.co_occurrence(adata_subset)

review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-24T10:25:03Z ----------------------------------------------------------------

remove, interaction matrix redundant cause nhood enrichment is better


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-24T10:25:04Z ----------------------------------------------------------------

if you set this upstream once, use it in the notebook

root = Path("/tutorial_data/nanostring_data/")

review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-24T10:25:05Z ----------------------------------------------------------------

no need to recreate a spatial neighbors again.


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-24T10:25:05Z ----------------------------------------------------------------

this function understand that block diagonal rperesentation of spatial_connectivities so it could be a nice way to show how nhood_enrichment looks like for the full adata or the adata_subset


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-24T10:25:06Z ----------------------------------------------------------------

Line #1.    sq.pl.nhood_enrichment(adata, cluster_key="leiden")

nhood enrichment accepts axis

fig, ax = plt.subplots(1,2,figsize=(5,5))
sq.pl.nhood_enrichment(adata, cluster_key="leiden", ax=ax[0])
sq.pl.nhood_enrichment(adata_subset, cluster_key="leiden", ax=ax[1])


giovp commented 2 years ago

move the notebook inside this folde https://github.com/scverse/squidpy_notebooks/tree/main/docs/source/external_tutorials and call it analysis_nanostring.ipynb

do couple of image analysis example as well, on the adata_subset

review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-31T10:25:47Z ----------------------------------------------------------------

remove this,


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-31T10:25:48Z ----------------------------------------------------------------

don't plot panCK nbut something else e.g. area or else in adata.obs


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-31T10:25:48Z ----------------------------------------------------------------

remove references to grid since it's not a grid. Also remove referecens to visium.


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-31T10:25:49Z ----------------------------------------------------------------

pelase remove, don't show any grid reference


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-31T10:25:50Z ----------------------------------------------------------------

here plot side by side how delaunay and knn makes a different graph, so edges are different, yet nodes are the same?


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-31T10:25:51Z ----------------------------------------------------------------

put it next to co_occurrence ,

also here you can consider to remove the img


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-31T10:25:52Z ----------------------------------------------------------------

show sq.pl.spatial_segment so people can directly understand how nhood enrichment relates to spatial organization.


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-31T10:25:53Z ----------------------------------------------------------------

remove this ripley, just use L


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-31T10:25:54Z ----------------------------------------------------------------

remove


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-31T10:25:54Z ----------------------------------------------------------------

plot 3 and use 2 for top 10 (so krt19 an another one) and then col1a fine


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-31T10:25:55Z ----------------------------------------------------------------

keep is as description but don't show. Move this description up.


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-05-31T10:25:56Z ----------------------------------------------------------------

do this analysis for adata_subset (skipping the segmentation part since you ahve it already)

https://squidpy.readthedocs.io/en/latest/auto_tutorials/tutorial_visium_fluo.html

https://squidpy.readthedocs.io/en/latest/auto_tutorials/tutorial_mibitof.html


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-06-08T07:50:05Z ----------------------------------------------------------------

remove this part and rewirte as mentioned in the vizgen tutorial


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-06-08T07:50:06Z ----------------------------------------------------------------

remove the square grid reference in this text


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-06-08T07:50:06Z ----------------------------------------------------------------

renove this, doesn't amke sense.


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-06-08T07:50:07Z ----------------------------------------------------------------

here you are showing how radius work, please plot the same set of points as above showing how it looks like now.


review-notebook-app[bot] commented 2 years ago

View / edit / reply to this conversation on ReviewNB

giovp commented on 2022-06-08T07:50:08Z ----------------------------------------------------------------

here ripley show it only for subset and modify text