Warning: package 'GenomicRanges' was built under R version 4.2.2
Warning: package 'GenomeInfoDb' was built under R version 4.2.2
1 Merging Visium Slides
9 different patients selected by a pathologist were selected for spatial analysis with the Visium kit, one of the patient had 3 different H&E slides analyzed.
3 of the patients were classified as \(MGC_{low}\), the remaining 6 were all \(MGC_{high}\)
#Function for reading the different visium slidesread_file <-function(Data){ Data <- Seurat::Load10X_Spatial(Data)}file_names <-list.files(path ="Raw_Visium/",full.names = F)for(file in file_names){assign(file, read_file(paste0("Raw_Visium/",file)))}
#Reading the spot IDs for manual annotation of MGC spots on the different slidesfile_names_2 <-list.files(path ="MGC_IDs/",full.names = F)for(file in file_names_2){assign(file, read.csv(paste0("MGC_IDs/",file)))}
#Merging different slidesVisium <-merge(Slide_A1, y =c(Slide_B1, Slide_C1, Slide_D1, Slide_E1, Slide_F1, Slide_G1, Slide_H1, Slide_I1, Slide_I2, Slide_I3))
Warning in CheckDuplicateCellNames(object.list = objects): Some cell names are
duplicated across objects provided. Renaming to enforce unique cell names.
1.2 Sequencing QC of Visium Slides
#Quality control of the dataSeurat::VlnPlot(Visium, features =c("nCount_Spatial", "nFeature_Spatial"), pt.size =0.1, ncol =2, log =T,group.by ='Batch') + Seurat::NoLegend()
NOTE: FeaturePlot_scCustom uses a specified `na_cutoff` when plotting to
color cells with no expression as background color separate from color scale.
Please ensure `na_cutoff` value is appropriate for feature being plotted.
Default setting is appropriate for use when plotting from 'RNA' assay.
When `na_cutoff` not appropriate (e.g., module scores) set to NULL to
plot all cells in gradient color palette.
-----This message will be shown once per session.-----
4 Focus on one slide - Enhancement with BayesSpace
BayesSpace clusters a low-dimensional representation of the gene expression matrix, incorporating a spatial prior to encourage neighboring spots to cluster together. The method can enhance the resolution of the low-dimensional representation into “sub-spots”, for which features such as gene expression or cell type composition can be imputed.
Slide_C1 <-readVisium("Slide_C1/")set.seed(102)Slide_C1 <-spatialPreprocess(Slide_C1, platform="Visium", n.PCs=10, n.HVGs=2000, log.normalize=T)Slide_C1 <-qTune(Slide_C1, qs=seq(2, 30), platform="Visium", d=7)qPlot(Slide_C1)set.seed(149)#q is set at the elbow of the previous plotSlide_C1 <-spatialCluster(Slide_C1, q=9, platform="Visium", d=7,init.method="mclust", model="t", gamma=2,nrep=1000, burn.in=100,save.chain=TRUE)Slide_C1.enhanced <-spatialEnhance(Slide_C1, q=9, platform="Visium", d=7,model="t", gamma=2,jitter_prior=0.3, jitter_scale=3.5,nrep=500, burn.in=100,save.chain=TRUE)