drieslab / Giotto

Spatial omics analysis toolbox
https://drieslab.github.io/Giotto_website/
Other
258 stars 98 forks source link

sign_matrix for runSpatialDeconv #99

Closed Jennifer-Foltz closed 3 years ago

Jennifer-Foltz commented 3 years ago

Good afternoon,

Thank you for the nice package. We are excited to try runSpatialDeconv with DWLS; however, I am unable to find document on what the format should be for the sign_matrix. What should the sign_matrix look like?

Thank you!

Jennifer

ndelrossi7 commented 3 years ago

Hi @JenniferWUSTL! Have you used the function makeSignMatrixDWLS? The input is the Giotto object, signature genes, and cell types. This will create the correct format for the signature matrix. Let me know if this works or if you have any other questions!

Jennifer-Foltz commented 3 years ago

Hi @ndelrossi7 ! Thank you so much for your quick response! I have not used that function. Our reference dataset is a Seurat object, is there an alternative method you would suggest? Can we generate the signmatrix from raw data from our reference (e.g. export the rawdata from Seurat as a matrix)?

ndelrossi7 commented 3 years ago

Hi @JenniferWUSTL - yes you can make your own matrix! The format is the columns are cell_types and the rows are the genes. I've attached a screen shot of an example here:

Screen Shot 2021-06-07 at 3 55 53 PM

Let me know if you have any other questions!

Jennifer-Foltz commented 3 years ago

Hi @ndelrossi7 ! Great! Just one more question- are the numbers the average gene expression in each cell type? If so, is this logged or unlogged?

Thank you!

ndelrossi7 commented 3 years ago

Hi @JenniferWUSTL! It's unlogged average gene expression for each cell type/spot. Hope this helps!

Jennifer-Foltz commented 3 years ago

@ndelrossi7 , thank you, that helps! I'm able to get the function to run now without error; however, I cannot locate the result output. I tried to find it using pDataDT() and fDataDT(), this was the code I used to run the deconvolution.

object <- runSpatialDeconv(gobject = object, deconv_method = "DWLS", expression_values = "normalized", logbase = 2, cluster_column = "leiden_clus_0.6", sign_matrix = sign_matrix, n_cell = 10, cutoff = 2).

Can you point me to how to access the deconvolution results? Thank you!!

RubD commented 3 years ago

hi @JenniferWUSTL I might be able to help you find the results. At the moment the easiest way to get to your results is like this: object@spatial_enrichment[["DWLS"]]. Let us know if this doesn't work.

Jennifer-Foltz commented 3 years ago

@RubD this works! Thank you so much! Just to confirm, the numbers in this df correspond to the proportion of a cell type in each spot?

RubD commented 3 years ago

@JenniferWUSTL I think they should. Do they add up to 1 (or 100) in each row (=spot)? @ndelrossi7 can probably say with more certainty.

ndelrossi7 commented 3 years ago

@JenniferWUSTL yes that's correct! The values should sum up to 1.

Jennifer-Foltz commented 3 years ago

@RubD @ndelrossi7 thank you! They do sum to 1 :) . What is the significance of negative values for some cell types?

ndelrossi7 commented 3 years ago

@JenniferWUSTL The negative values should be adjusted to 0 - we're looking into making this adjustment. Thanks for bringing it to our attention!

Jennifer-Foltz commented 3 years ago

You're welcome :).

Thank you both for the help! You've been amazing in getting this up and running, and really appreciate the prompt support!