satijalab / seurat

R toolkit for single cell genomics
http://www.satijalab.org/seurat
Other
2.26k stars 904 forks source link

Visualise Proportions of Integrated Data #7337

Closed AnjaK88 closed 1 year ago

AnjaK88 commented 1 year ago

Hi Team,

I am working with the following setup:

I performed Spatial Transcriptomic Sequencing on 10 different brain regions, all from the same brain. For comparison, I merged and integrated the 10 objects into one large object. Next, I integrated the Allen Brain single cell RNA dataset into this object, to project different cell types onto my spatial regions. I followed the "standard" Seurat tutorial and the information is stored under "predictions".

Visualisation of the different features (eg astrocytes) works very well with the 'SpatialFeaturePlot' for instance.

Now, I would like to pull out the following information: What is the proportion of brain cell types (eg astrocytes, neurons..) in each of the region? To then visualise this as a ggplot.

Is it possible to pull this specific data, or to visualise this straight from my object?

Thank you very much for any possible suggestions or help!

saketkc commented 1 year ago

Hi @AnjaK88, you can extract all the metadata using object@meta.data which returns a dataframe. You can also use FetchData to extract basically anything (features/PCs/any column in metadata).

AnjaK88 commented 1 year ago

Thanks for your reply Saket! I know I can get the information from the Mata.data. The problem is however that after integration no new column is created which stores the information “cell types”. The information seems to be there, though. So my questions is actually where specifically can I see this information in my metadata? My apologies that it was not clear enough.

saketkc commented 1 year ago

If your allen brain sdataset has a column say 'mycelltype', the integrated objects should also have it. All the metadata is in the obj.integrated@meta.data.

AnjaK88 commented 1 year ago

That’s what I assumed, my new integrated object should have the meta data column that I integrate from the Allen Brain data. Unfortunately it is not, yet can I plot the cell types as if it was. Good to know, I will re-run the script. Thank you Saket!