LieberInstitute / spatialDLPFC

spatialDLPFC project involving Visium (n = 30), Visium SPG (n = 4) and snRNA-seq (n = 19) samples
http://research.libd.org/spatialDLPFC/
16 stars 3 forks source link

Update Visium and Visium IF shiny apps with deconvolution results #98

Closed lcolladotor closed 1 year ago

lcolladotor commented 2 years ago

This means adding the cell counts for each cell type to each SPE object (the versions that will be uploaded to shiny + #76). This could be done directly on the app.R scripts (if so, update the deploy.R script to also upload the CSV file(s) containing the spot deconvolution results) or in a prep shiny script.

It'll depend on which spot deconvolution methods we ran for the n = 4 and n = 30 samples.

lcolladotor commented 1 year ago

These ones I believe are going to be spatialLIBD apps.

lcolladotor commented 1 year ago

@Nick-Eagles can explain to you where the deconvolution results he has so far are. The results will change, but you can start setting up and checking that you can update the spatialLIBD apps with these results.

Nick-Eagles commented 1 year ago

The updated object with all the counts is here: /dcs04/lieber/lcolladotor/spatialDLPFC_LIBD4035/spatialDLPFC/processed-data/spot_deconvo/05-shared_utilities/IF/spe.rds. As Leo said, some results (specifically the CART_* columns other than CART_counts in colData(spe)) will change, but the others (for tangram, cell2location, and SPOTlight) should be final.

lcolladotor commented 1 year ago

@heenadivecha, notice that I changed the title and URL at https://github.com/LieberInstitute/spatialDLPFC/commit/95a0b8e06cb2eadf761914391909dc0772dcf430, similar to https://github.com/LieberInstitute/DLPFC_snRNAseq/commit/abfb4bdb3baaab214870ad2c895dde977f93a375

@Nick-Eagles, we'll need to create an object following similar code to the one from https://github.com/LieberInstitute/spatialDLPFC/blob/main/code/analysis/01_build_spe/03_add_deconvolution.R. Note how I had to fix some variables and all that.

We'll also need to update this one with custom documentation files, like for the k09 and k16 apps. The same docs can be used actually (if the variables stay the same). Aka, we can softlink the www dir to the one from k09.

heenadivecha commented 1 year ago

I updated the spatialLIBD app for Visium_IF data with updated title and URL.

lcolladotor commented 1 year ago

This is mostly done, though I know that @Nick-Eagles will either make a new spe.rds for the IF data or update the README docs we are using in the spatialLIBD shiny apps to document the column names used (aka, update https://github.com/LieberInstitute/spatialDLPFC/blob/main/code/deploy_app_k09/www/documentation_spe.md#common-options).

Nick also needs to talk with Heena about any changes to what variables are displayed. Aka https://github.com/LieberInstitute/spatialDLPFC/blob/1b4d8e7161be2310af87b88ed8e167ffedb99098/code/analysis_IF/03_spatialLIBD_app/app.R#L28-L38.

Nick-Eagles commented 1 year ago

The IF SPE has been updated to what should be the final version, and is located here here("processed-data", "spot_deconvo", "05-shared_utilities", "IF", "spe.rds"). I updated some names in colnames(colData(spe)) to match the n = 30 Visium shiny app. @heenadivecha, this code should work in place of lines 32-38 Leo linked above to match the columns you want:

spe_continuous_vars = c( 
    vars[grep("^(broad|layer|cart)_", vars)], 
    "sum_umi", 
    "sum_gene", 
    "expr_chrM", 
    "expr_chrM_ratio",
    "VistoSeg_count_deprecated",
    "cellpose_count"
),

Also, I updated the documentation to explain the new cart_* and cellpose_count columns.

lcolladotor commented 1 year ago

@heenadivecha & @Nick-Eagles do you have updates on this?

Thanks!