#Organoid figure manuscript #Figures Supplementary Figure 9 #Single-cell organoid data#Libraries to loadlibrary(SCpubr)library(Seurat)library(Signac)library(ggplot2)library(dplyr)library(UCell)library(AUCell)#Set to your working directory were your files are setwd("/home/ipaassen/ATRT_sc_atlas/")#Load organoidseurat objectorganoids<-readRDS("/data/projects/p868_CRISPR-RNA_TP53-RB1/irene/241113_organoids_enrichumapadded.RDS")#Set colours to use for theidents_colors_organoids<-c("SHH-intermediate"="#A4C2D6","IPC.like"="#be920e","OPC.like"="#0435c8", 'NPC.like'="#0466c8", "RG.like"="#0497c8")# Ready for visualization.#Figure Supplementary Figure 11#Panel Ado_DimPlot(sample, reduction ="umap", group.by ="Enrich.scores",colors.use =idents_colors_organoids)#Panel Bdo_DimPlot(sample, reduction ="wnn.umap", group.by ="Enrich.scores", colors.use =idents_colors_organoids)#Panel Cdo_BarPlot(organoids, group.by ="Enrich.scores", split.by ='sample1', position ='fill',colors.use =idents_colors_organoids)#Panel Ddo_FeaturePlot(sample, features ='RG.like_scaled', order =T, plot.title ="RG-like")#Panel Edo_FeaturePlot(sample, features ='OPC.like_scaled', order =T, plot.title ="OPC-like")#Panel Fdo_FeaturePlot(sample, features ='NPC.like_scaled', order =T, plot.title ="NPC-like")#Panel Gdo_FeaturePlot(sample, features ='IPC.like_scaled', order =T, plot.title ="IPC-like")#Calculate IPC percentage (only used in the text)ipc.05<-organoids$Enrich.scores[organoids$sample1=="ATRT05"]table(ipc.05)#from length of ipc.05ipc.04<-organoids$Enrich.scores[organoids$sample1=="ATRT04"]table(ipc.04)#from length of ipc.04ipc.15<-organoids$Enrich.scores[organoids$sample1=="ATRT15_ASG3"]table(ipc.15)#from length of ipc.15#Save tsv of RNA and ATAC datawrite.table(Seurat::GetAssayData(organoids, assay ="peaks", slot ="counts"), col.names =TRUE, row.names =TRUE, quote =FALSE, sep ="\t", file =gzfile("ATRT_organoids_ATAC_peaks_counts_raw.tsv.gz"))#Save umap coordinates and metadata filesdata<-sample@meta.data%>%tibble::rownames_to_column(var ="Cell")%>%dplyr::left_join(y =sample@reductions$umap_unintegrated@cell.embeddings%>%as.data.frame()%>%tibble::rownames_to_column(var ="Cell"), by ="Cell")%>%dplyr::left_join(y =sample@reductions$umap.harmony@cell.embeddings%>%as.data.frame()%>%tibble::rownames_to_column(var ="Cell"), by ="Cell")