Charting the transition from in vitro gliogenesis to the in vivo maturation of human glial progenitor cells transplanted into the hypomyelinated mouse brain.
26 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.
The 32 matches · 1 of them tie a paragraph to a whole file without given lines: a weak match, whose lines are not tinted
- [1] § Results › Context-dependent differentiation of human GPCs in callosal white matter ↔ Scripts/21_Invitro_Invivo_Analysis_withATAC.Rmd, lines 309 to 401 · score 0.96 · MYCN signaling, THRA signaling, TCF7L2, SOX11 signaling, EGR2 signaling, cell contact · block
oscr:b:H7YFWTZ2NJ9QW-D· Report a mismatch - [2] § Methods › Bulk CUT&Tag analysis ↔ Scripts/06_CUT&Tag_genomicCoverage.sh, lines 83 to 168 · score 0.90 · computeMatrix, plotHeatmap, H3K27ac, H3K27me3, H3K4me3, deeptools · block
oscr:b:74TTVSB2CH69B-G· Report a mismatch - [3] § Results › Resident mouse brain cells drive the specification and differentiation of human GPCs in vivo ↔ Scripts/25_NicheNet_Analysis_and_Figure.Rmd, lines 398 to 441 · score 0.90 · IL1A, IL1B, APOE, EBI3, ICAM1, MMP13 · block
oscr:b:QNBR5HMJVNHRA-U· Report a mismatch - [4] § Methods › Xenium processing and analysis ↔ Scripts/28_Xenium_Inital_Analysis.ipynb, lines 439 to 475 · score 0.89 · cross reactive genes, perfect human genes, negative score, composite score, human probe, penalize · Report a mismatch
- [5] § Methods › scATAC-seq of human GPCs ↔ Scripts/20_scATAC_Analysis.Rmd, lines 116 to 141 · score 0.85 · blacklist ratio, nucleosome signal, TSS enrichment, fragments, scATAC, log · block
oscr:b:FGGXBKFBDA360-6· Report a mismatch - [6] § Methods › Xenium processing and analysis ↔ Scripts/26_Process_MagicBlast_Output.Rmd, lines 27 to 56 · score 0.85 · Magic BLAST, mouse genome, human genome, composite score, human probe, alignment · block
oscr:b:E2X7CP1SQXRRT-2· Report a mismatch - [7] § Methods › Integration with external fetal scRNA-/snRNA-seq datasets ↔ Scripts/17_Invitro_Integration_van_Bruggen.Rmd, lines 156 to 211 · score 0.82 · van Bruggen, FindTransferAnchors, TransferData, RPCA, external, query · block
oscr:b:D0SXSZ5Q1B7H7-D· Report a mismatch - [8] § Methods › Bulk CUT & Tag of human PSCs or GPCs ↔ Scripts/06_CUT&Tag_genomicCoverage.sh, lines 83 to 168 · score 0.82 · CUT Tag, H3K27ac, H3K27me3, H3K4me3, chromatin, histone · block
oscr:b:74TTVSB2CH69B-G· Report a mismatch - [9] § Methods › Cell-cell interaction analysis ↔ Scripts/25_NicheNet_Analysis_and_Figure.Rmd, lines 96 to 160 · score 0.81 · niche de, sender cells, receiver cells, NicheNet, vitro GPC4, Seurat · block
oscr:b:WBP28QABFCXA3-Q· Report a mismatch - [10] § Methods › Bulk CUT&Tag analysis ↔ Scripts/05_CUT&Tag_scRNA_Intersection.Rmd, lines 78 to 163 · score 0.79 · GeneHancer, DiffBind, promoter region, log2fc, database, enhancers · block
oscr:b:JZAB3TCAV1JFA-1· Report a mismatch - [11] § Results › Context-dependent differentiation of human GPCs in callosal white matter ↔ Scripts/21_Invitro_Invivo_Analysis_withATAC.Rmd, lines 403 to 444 · score 0.78 · CAMK2N1, vivo GPC4, NNAT, DCX, FOS, JUNB · block
oscr:b:AY7NYAGCQ4H19-C· Report a mismatch - [12] § Results › hESC-derived hGPCs are transcriptionally analogous to fetal glial progenitors ↔ Scripts/18_Label_Transfer_Figure_Generation.R, the whole file · a weak match · score 0.77 · van Bruggen, wk GA, 17–41, IPCs, RG, Velmeshev · block
oscr:b:EH4JS8Q42XRX7-M· Report a mismatch - [13] § Methods › Integration with external fetal scRNA-/snRNA-seq datasets ↔ Scripts/15_Invitro_Integration_Ramos.Rmd, lines 256 to 307 · score 0.76 · FindTransferAnchors, TransferData, Ramos, RPCA, external, query · block
oscr:b:VMC0CS57JSD93-4· Report a mismatch - [14] § Results › Resident mouse brain cells drive the specification and differentiation of human GPCs in vivo ↔ Scripts/25_NicheNet_Analysis_and_Figure.Rmd, lines 648 to 714 · score 0.75 · ligand target networks, SULF2, BAMBI, CSPG4, CSPG5, TNR · block
oscr:b:3WT1PQ950DF1C-T· Report a mismatch - [15] § Methods › Cell-cell interaction analysis ↔ Scripts/25_NicheNet_Analysis_and_Figure.Rmd, lines 648 to 714 · score 0.74 · ligand target weights, NicheNet, ligand activity, niches, receiver, activation · block
oscr:b:3WT1PQ950DF1C-T· Report a mismatch - [16] § Results › hGPCs are comprised of distinct stage-defined subpopulations ↔ Scripts/25_NicheNet_Analysis_and_Figure.Rmd, lines 60 to 74 · score 0.70 · dual species, immature oligodendrocytes, maOL, imOL, cell · block
oscr:b:SEW8W2KKM2YRJ-D· Report a mismatch - [17] § Results › Human donor cells can be recovered from host brains as glia, without residual pluripotent stem cells ↔ Scripts/19_Invivo_Analysis.Rmd, lines 784 to 823 · score 0.66 · cGPC, imAstrocyte, cAPC, maOL, imOL, canonical · block
oscr:b:0NS5S0DXMBJFX-Z· Report a mismatch - [18] § Methods › Bulk CUT & Tag of human PSCs or GPCs ↔ Scripts/05_CUT&Tag_scRNA_Intersection.Rmd, lines 78 to 163 · score 0.66 · K4me3, CUT Tag, histone mark, chromatin, Bulk · block
oscr:b:JZAB3TCAV1JFA-1· Report a mismatch - [19] § Results › hESC-derived hGPCs are transcriptionally analogous to fetal glial progenitors ↔ Scripts/18_Label_Transfer_Figure_Generation.Rmd, lines 127 to 156 · score 0.64 · van Bruggen, wk GA, RG, OPC, fetal, 8–10 · block
oscr:b:NQJW6J6JE9H4G-5· Report a mismatch - [20] § Results › Transcriptionally-distinct cycling pools of bipotential and astrocyte-biased progenitors appear in vivo ↔ Scripts/19_Invivo_Analysis.Rmd, lines 910 to 940 · score 0.63 · cGPC, cAPC, Log2FC, NXPH1, PLLP, CNTN1 · block
oscr:b:G4Q5ZHCPGN0A3-M· Report a mismatch - [21] § Results › A distinct set of transcriptional regulators directs human astrocytic differentiation in vivo ↔ Scripts/29_Xenium_Figure_Construction.Rmd, lines 122 to 154 · score 0.59 · SLC1A3, SLC1A2, EGFR, AQP4, SOX9, OLIG2 · block
oscr:b:PDEYDY120Q1ZV-P· Report a mismatch - [22] § Methods › Identification of transcription factor regulons ↔ Scripts/21_Invitro_Invivo_Analysis_withATAC.Rmd, lines 535 to 667 · score 0.58 · pySCENIC, transcription factor, AUC, repressive, regulons, log2 · block
oscr:b:JRY7J8HD0K6GD-N· Report a mismatch - [23] § Results › Downstream regulators drive human oligodendrocytic maturation and myelination in vivo ↔ Scripts/19_Invivo_Analysis.Rmd, lines 329 to 388 · score 0.58 · regulon target, transcription factor, maOL, imOL, TF, networks · block
oscr:b:D6MJ4WCPRERPC-7· Report a mismatch - [24] § Methods › Pseudotime analysis ↔ Scripts/19_Invivo_Analysis.Rmd, lines 673 to 719 · score 0.58 · fitGAM, regulon activity, slingshot, pseudotime, Gene expression, Scores · block
oscr:b:262WSA6R3MECE-I· Report a mismatch - [25] § Results › Human donor cells can be recovered from host brains as glia, without residual pluripotent stem cells ↔ Scripts/19_Invivo_Analysis.Rmd, lines 970 to 1022 · score 0.57 · SLC1A2, cAPC, MOBP, MKI67, AQP4, BCAS1 · block
oscr:b:6DH7NMS037ES4-6· Report a mismatch - [26] § Results › In vitro GPC differentiation yields compositions free of pluripotent signatures ↔ Scripts/07_PSC_vs_GPC_Figure_Assembly.Rmd, lines 111 to 164 · score 0.57 · co expressed, LIN28A, POU5F1, PSCs, vitro, GPC · block
oscr:b:RFRXYEMKDB6B8-M· Report a mismatch - [27] § Results › In vitro GPC differentiation yields compositions free of pluripotent signatures ↔ Scripts/07_PSC_vs_GPC_Figure_Assembly.Rmd, lines 111 to 164 · score 0.56 · PSC stage, LIN28A, POU5F1, GPC stage, vitro, cells · block
oscr:b:RFRXYEMKDB6B8-M· Report a mismatch - [28] § Methods › Xenium processing and analysis ↔ Scripts/27_Xenium_Read_and_Crop.ipynb, lines 221 to 234 · score 0.55 · interactive session, engrafted human cells, napari, Xenium, WA09, subset · Report a mismatch
- [29] § Results › Predictive trajectory modeling of transplanted hGPC differentiation trajectories ↔ Scripts/14_Invitro_Analysis.Rmd, lines 496 to 506 · score 0.55 · BCL11B, mature NPCs, MEIS2, SYT1 · block
oscr:b:YK6YRBTY04C2Y-6· Report a mismatch - [30] § Methods › Alignment and preprocessing of scRNA-seq samples ↔ Scripts/24_NicheNet_Processing.Rmd, lines 193 to 242 · score 0.54 · dual species, Seurat, human genes, mouse, cell · block
oscr:b:K0F788PF916MD-9· Report a mismatch - [31] § Methods › FACS isolation of chimeric white matter cells for scRNA-Seq ↔ Scripts/01_Processing.Rmd, lines 29 to 67 · score 0.51 · tagged C27s, EGFP, mouse, human, cells · block
oscr:b:T0DV1A159SMJA-I· Report a mismatch - [32] § Methods › Pseudotime analysis ↔ Scripts/12_Invitro_Invivo_Processing.Rmd, lines 134 to 155 · score 0.51 · terminal cells, AGT, NSG2, DLX5, MOBP, palantir · block
oscr:b:93FF3ZXRB14M7-N· Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
R Markdown · 833 lines · 36 KB · MIT · 5 matches
- ---
- title: "Differential NicheNet Analysis of in vivo and in vitro hGPCs"
- author: "John Mariani"
- date: "3/6/2023"
- output: github_document
- ---
- ```{r setup, include=FALSE}
- knitr::opts_chunk$set(echo = TRUE)
- knitr::opts_knit$set(root.dir = rprojroot::find_rstudio_root_file())
- ```
- ## Load in Libraries
- ```{r}
- library(dplyr)
- library(Seurat)
- library(devtools)
- library(patchwork)
- library(dplyr)
- library(SeuratDisk)
- library(biomaRt)
- library(Matrix)
- library(nichenetr)
- library(RColorBrewer)
- library(scPlottingTools)
- library(data.table)
- options(future.globals.maxSize = 16000 * 1024^2)
- ```
- ## Read in Human and Mouse Counts
- ```{r}
- source("Scripts/HelperFunctions.r")
- dualSpecies <- readRDS("output/RDS/finalNiche.rds")
- ```
- ## Read in NicheNetV2 Databases
- ```{r}
- ligand_target_matrix = readRDS("data_for_import/NicheNet/ligand_target_matrix_nsga2r_final.rds")
- lr_network = readRDS("data_for_import/NicheNet/lr_network_human_21122021.rds")
- lr_network = lr_network %>% mutate(bonafide = ! database %in% c("ppi_prediction","ppi_prediction_go"))
- lr_network = lr_network %>% dplyr::rename(ligand = from, receptor = to) %>% distinct(ligand, receptor, bonafide)
- weighted_networks = readRDS("data_for_import/NicheNet/weighted_networks_nsga2r_final.rds")
- ```
- ## Make counts to edit
- ```{r}
- dualSpecies$stage2 <- dualSpecies$stage
- dualSpecies$stage2 <- gsub(x = dualSpecies$stage2, pattern = "In Vitro - GPC Stage", replacement = "In Vitro")
- unique(dualSpecies$stage2)
- dualSpecies$cellStage <- paste0(dualSpecies$stage2, " ", dualSpecies$cellType)
- dualSpecies$cellStage <- gsub(x = dualSpecies$cellStage, pattern = "Immature Oligodendrocyte", replacement = "imOL")
- dualSpecies$cellStage <- gsub(x = dualSpecies$cellStage, pattern = "Mature Oligodendrocyte", replacement = "maOL")
- table(dualSpecies$cellStage)
- ```
- ## Showing ligand differences between in vitro cell states
- ```{r}
- ligands <- unique(lr_network$ligand)
- GPC1 <- read.delim("output/DE/GPC1.vs.Rest.sig.txt")
- GPC2 <- read.delim("output/DE/GPC2.vs.Rest.sig.txt")
- GPC3 <- read.delim("output/DE/GPC3.vs.Rest.sig.txt")
- GPC4 <- read.delim("output/DE/GPC4.vs.Rest.sig.txt")
- NPC <- read.delim("output/DE/NPC.vs.Rest.sig.txt")
- invitroStateMarkers <- rbind(GPC1, GPC2, GPC3, GPC4, NPC)
- invitroStateLigands <- invitroStateMarkers[invitroStateMarkers$gene %in% ligands,]
- invitroStateLigands <- invitroStateLigands[!duplicated(invitroStateLigands$gene),]
- ```
- ```{r, warning=F}
- niches = list(
- "In Vivo" = list(
- "sender" = c("In Vivo Astrocyte","In Vivo imOL", "In Vivo maOL", "In Vivo Mouse Astrocyte", "In Vivo Mouse Endothelial", "In Vivo Mouse Ependymal", "In Vivo Mouse Macrophage", "In Vivo Mouse GPC", "In Vivo Mouse imOL", "In Vivo Mouse maOL", "In Vivo Mouse Microglia", "In Vivo Mouse NPC", "In Vivo Mouse Pericyte"),
- "receiver" = c("In Vivo GPC4")),
- "In Vitro" = list(
- "sender" = c("In Vitro GPC1","In Vitro GPC2", "In Vitro GPC3", "In Vitro NPC"),
- "receiver" = c("In Vitro GPC4"))
- )
- Idents(dualSpecies) <- dualSpecies$cellStage
- one2oneGenes <- read.csv("data_for_import/NicheNet/one2oneGenes.csv")
- #DE_sender = calculate_niche_de(seurat_obj = dualSpecies %>% subset(features = lr_network$ligand %>% intersect(one2oneGenes$x)), niches = niches, type = "sender", assay_oi = "RNA") # only ligands important for sender cell types
- #write.csv(DE_sender, "output/NicheNet/DE_sender.csv", quote = F, row.names = F)
- DE_sender <- read.csv("output/NicheNet/DE_sender.csv")
- DE_sender$sender <- gsub(x = DE_sender$sender, pattern = "Immature Oligodendrocyte", replacement = "imOL")
- DE_sender$sender_other_niche <- gsub(x = DE_sender$sender_other_niche, pattern = "Immature Oligodendrocyte", replacement = "imOL")
- DE_sender$sender <- gsub(x = DE_sender$sender, pattern = "Mature Oligodendrocyte", replacement = "maOL")
- DE_sender$sender_other_niche <- gsub(x = DE_sender$sender_other_niche, pattern = "Mature Oligodendrocyte", replacement = "maOL")
- DE_sender$sender <- gsub(x = DE_sender$sender, pattern = "Immature Oligo", replacement = "imOL")
- DE_sender$sender_other_niche <- gsub(x = DE_sender$sender_other_niche, pattern = "Immature Oligo", replacement = "imOL")
- DE_sender$sender <- gsub(x = DE_sender$sender, pattern = "Mature Oligo", replacement = "maOL")
- DE_sender$sender_other_niche <- gsub(x = DE_sender$sender_other_niche, pattern = "Mature Oligo", replacement = "maOL")
- deGPC4 <- read.delim("output/DE/Invivo.vs.Invitro.GPC4.txt")
- deGPC4.sig <- read.delim("output/DE/Invivo.vs.Invitro.GPC4.sig.txt")
- deGPC4 <- deGPC4[complete.cases(deGPC4),]
- deGPC4 <- rbind(deGPC4, deGPC4.sig[deGPC4.sig$gene %not in% deGPC4$gene,])
- #Format Prior Differential Expression for receiver cells
- pct.expr <- DotPlot(dualSpecies, features = deGPC4$gene, idents = c("In Vivo GPC4", "In Vitro GPC4"), group.by = "cellStage")$data
- pct.expr.invivo <- pct.expr[pct.expr$id == "In Vivo GPC4",]
- pct.expr.invitro <- pct.expr[pct.expr$id == "In Vitro GPC4",]
- DE_receiver_invivo <- data.frame(gene = deGPC4$gene, p_val = deGPC4$FDR, avg_log2FC = deGPC4$logFC, pct.1 = pct.expr.invivo$pct.exp, pct.2 = pct.expr.invitro$pct.exp, p_val_adj = deGPC4$FDR, receiver = "In Vivo GPC4", receiver_other_niche = "In Vitro GPC4")
- DE_receiver_invitro <- data.frame(gene = deGPC4$gene, p_val = deGPC4$FDR, avg_log2FC = (deGPC4$logFC*-1), pct.1 = pct.expr.invitro$pct.exp, pct.2 = pct.expr.invivo$pct.exp, p_val_adj = deGPC4$FDR, receiver = "In Vitro GPC4", receiver_other_niche = "In Vivo GPC4")
- DE_receiver <- rbind(DE_receiver_invivo, DE_receiver_invitro)
- DE_receiver_receptors <- DE_receiver[DE_receiver$gene %in% lr_network$receptor,]
- #DE_receiver = calculate_niche_de(seurat_obj = dualSpecies %>% subset(features = lr_network$receptor %>% unique()), niches = niches, type = "receiver", assay_oi = "RNA") # only receptors now, later on: DE analysis to find targets
- DE_sender = DE_sender %>% mutate(avg_log2FC = ifelse(avg_log2FC == Inf, max(avg_log2FC[is.finite(avg_log2FC)]), ifelse(avg_log2FC == -Inf, min(avg_log2FC[is.finite(avg_log2FC)]), avg_log2FC)))
- DE_receiver_receptors = DE_receiver_receptors %>% mutate(avg_log2FC = ifelse(avg_log2FC == Inf, max(avg_log2FC[is.finite(avg_log2FC)]), ifelse(avg_log2FC == -Inf, min(avg_log2FC[is.finite(avg_log2FC)]), avg_log2FC)))
- ```
- ```{r}
- expression_pct = 10
- DE_sender_processed = process_niche_de(DE_table = DE_sender, niches = niches, expression_pct = expression_pct, type = "sender")
- DE_receiver_processed = process_niche_de(DE_table = DE_receiver_receptors, niches = niches, expression_pct = expression_pct, type = "receiver")
- specificity_score_LR_pairs = "min_lfc"
- DE_sender_receiver = combine_sender_receiver_de(DE_sender_processed, DE_receiver_processed, lr_network, specificity_score = specificity_score_LR_pairs)
- ```
- ```{r}
- lfc_cutoff = 0.25 # recommended for 10x as min_lfc cutoff.
- specificity_score_targets = "min_lfc"
- #DE_receiver_targets = calculate_niche_de_targets(seurat_obj = dualSpecies, niches = niches, lfc_cutoff = lfc_cutoff, expression_pct = expression_pct, assay_oi = "RNA")
- DE_receiver_processed_targets = process_receiver_target_de(DE_receiver = DE_receiver, niches = niches, expression_pct = expression_pct, specificity_score = specificity_score_targets)
- background = DE_receiver_processed_targets %>% pull(target) %>% unique()
- geneset_InVivo = DE_receiver_processed_targets %>% filter(receiver == niches$`In Vivo`$receiver & target_score >= lfc_cutoff & target_significant == 1 & target_present == 1) %>% pull(target) %>% unique()
- geneset_Invitro = DE_receiver_processed_targets %>% filter(receiver == niches$`In Vitro`$receiver & target_score >= lfc_cutoff & target_significant == 1 & target_present == 1) %>% pull(target) %>% unique()
- geneset_InVivo %>% setdiff(rownames(ligand_target_matrix))
- geneset_Invitro %>% setdiff(rownames(ligand_target_matrix))
- ```
- ```{r, warning=F}
- top_n_target = 1000
- niche_geneset_list = list(
- "In_Vivo_niche" = list(
- "receiver" = "In Vivo GPC4",
- "geneset" = geneset_InVivo,
- "background" = background),
- "In_Vitro_niche" = list(
- "receiver" = "In Vitro GPC4",
- "geneset" = geneset_Invitro ,
- "background" = background))
- ligand_activities_targets = get_ligand_activities_targets(niche_geneset_list = niche_geneset_list, ligand_target_matrix = ligand_target_matrix, top_n_target = top_n_target)
- #write.table(ligand_activities_targets, "output/NicheNet/ligand_activities_targets.txt", sep = "\t", row.names = F, quote = F)
- ```
- ```{r}
- features_oi = union(lr_network$ligand, lr_network$receptor) %>% union(ligand_activities_targets$target) %>% setdiff(NA)
- dotplot = suppressWarnings(Seurat::DotPlot(dualSpecies %>% subset(idents = niches %>% unlist() %>% unique()), features = features_oi, assay = "RNA"))
- exprs_tbl = dotplot$data %>% as_tibble()
- exprs_tbl = exprs_tbl %>% dplyr::rename(celltype = id, gene = features.plot, expression = avg.exp, expression_scaled = avg.exp.scaled, fraction = pct.exp) %>%
- mutate(fraction = fraction/100) %>% as_tibble() %>% dplyr::select(celltype, gene, expression, expression_scaled, fraction) %>% distinct() %>% arrange(gene) %>% mutate(gene = as.character(gene))
- exprs_tbl_ligand = exprs_tbl %>% filter(gene %in% lr_network$ligand) %>% dplyr::rename(sender = celltype, ligand = gene, ligand_expression = expression, ligand_expression_scaled = expression_scaled, ligand_fraction = fraction)
- exprs_tbl_receptor = exprs_tbl %>% filter(gene %in% lr_network$receptor) %>% dplyr::rename(receiver = celltype, receptor = gene, receptor_expression = expression, receptor_expression_scaled = expression_scaled, receptor_fraction = fraction)
- exprs_tbl_target = exprs_tbl %>% filter(gene %in% ligand_activities_targets$target) %>% dplyr::rename(receiver = celltype, target = gene, target_expression = expression, target_expression_scaled = expression_scaled, target_fraction = fraction)
- exprs_tbl_ligand = exprs_tbl_ligand %>% mutate(scaled_ligand_expression_scaled = scale_quantile_adapted(ligand_expression_scaled)) %>% mutate(ligand_fraction_adapted = ligand_fraction) %>% mutate_cond(ligand_fraction >= expression_pct, ligand_fraction_adapted = expression_pct) %>% mutate(scaled_ligand_fraction_adapted = scale_quantile_adapted(ligand_fraction_adapted))
- exprs_tbl_receptor = exprs_tbl_receptor %>% mutate(scaled_receptor_expression_scaled = scale_quantile_adapted(receptor_expression_scaled)) %>% mutate(receptor_fraction_adapted = receptor_fraction) %>% mutate_cond(receptor_fraction >= expression_pct, receptor_fraction_adapted = expression_pct) %>% mutate(scaled_receptor_fraction_adapted = scale_quantile_adapted(receptor_fraction_adapted))
- ```
- ```{r}
- exprs_sender_receiver = lr_network %>%
- inner_join(exprs_tbl_ligand, by = c("ligand")) %>%
- inner_join(exprs_tbl_receptor, by = c("receptor")) %>% inner_join(DE_sender_receiver %>% distinct(niche, sender, receiver))
- ligand_scaled_receptor_expression_fraction_df = exprs_sender_receiver %>% group_by(ligand, receiver) %>% mutate(rank_receptor_expression = dense_rank(receptor_expression), rank_receptor_fraction = dense_rank(receptor_fraction)) %>% mutate(ligand_scaled_receptor_expression_fraction = 0.5*( (rank_receptor_fraction / max(rank_receptor_fraction)) + ((rank_receptor_expression / max(rank_receptor_expression))) ) ) %>% distinct(ligand, receptor, receiver, ligand_scaled_receptor_expression_fraction, bonafide) %>% distinct() %>% ungroup()
- # No Spatial info
- spatial_info = tibble(celltype_region_oi = NA, celltype_other_region = NA) %>% mutate(niche = niches %>% names() %>% head(1), celltype_type = "sender")
- ```
- ## No Spatial info
- ```{r}
- include_spatial_info_sender = F # if not spatial info to include: put this to false
- include_spatial_info_receiver = FALSE # if spatial info to include: put this to true
- if(include_spatial_info_sender == FALSE & include_spatial_info_receiver == FALSE){
- spatial_info = tibble(celltype_region_oi = NA, celltype_other_region = NA) %>% mutate(niche = niches %>% names() %>% head(1), celltype_type = "sender")
- }
- if(include_spatial_info_sender == TRUE){
- sender_spatial_DE = calculate_spatial_DE(seurat_obj = seurat_obj %>% subset(features = lr_network$ligand %>% unique()), spatial_info = spatial_info %>% filter(celltype_type == "sender"), assay_oi = assay_oi)
- sender_spatial_DE_processed = process_spatial_de(DE_table = sender_spatial_DE, type = "sender", lr_network = lr_network, expression_pct = expression_pct, specificity_score = specificity_score_spatial)
- # add a neutral spatial score for sender celltypes in which the spatial is not known / not of importance
- sender_spatial_DE_others = get_non_spatial_de(niches = niches, spatial_info = spatial_info, type = "sender", lr_network = lr_network)
- sender_spatial_DE_processed = sender_spatial_DE_processed %>% bind_rows(sender_spatial_DE_others)
- sender_spatial_DE_processed = sender_spatial_DE_processed %>% mutate(scaled_ligand_score_spatial = scale_quantile_adapted(ligand_score_spatial))
- } else {
- # # add a neutral spatial score for all sender celltypes (for none of them, spatial is relevant in this case)
- sender_spatial_DE_processed = get_non_spatial_de(niches = niches, spatial_info = spatial_info, type = "sender", lr_network = lr_network)
- sender_spatial_DE_processed = sender_spatial_DE_processed %>% mutate(scaled_ligand_score_spatial = scale_quantile_adapted(ligand_score_spatial))
- }
- if(include_spatial_info_receiver == TRUE){
- receiver_spatial_DE = calculate_spatial_DE(seurat_obj = seurat_obj %>% subset(features = lr_network$receptor %>% unique()), spatial_info = spatial_info %>% filter(celltype_type == "receiver"), assay_oi = assay_oi)
- receiver_spatial_DE_processed = process_spatial_de(DE_table = receiver_spatial_DE, type = "receiver", lr_network = lr_network, expression_pct = expression_pct, specificity_score = specificity_score_spatial)
- # add a neutral spatial score for receiver celltypes in which the spatial is not known / not of importance
- receiver_spatial_DE_others = get_non_spatial_de(niches = niches, spatial_info = spatial_info, type = "receiver", lr_network = lr_network)
- receiver_spatial_DE_processed = receiver_spatial_DE_processed %>% bind_rows(receiver_spatial_DE_others)
- receiver_spatial_DE_processed = receiver_spatial_DE_processed %>% mutate(scaled_receptor_score_spatial = scale_quantile_adapted(receptor_score_spatial))
- } else {
- # # add a neutral spatial score for all receiver celltypes (for none of them, spatial is relevant in this case)
- receiver_spatial_DE_processed = get_non_spatial_de(niches = niches, spatial_info = spatial_info, type = "receiver", lr_network = lr_network)
- receiver_spatial_DE_processed = receiver_spatial_DE_processed %>% mutate(scaled_receptor_score_spatial = scale_quantile_adapted(receptor_score_spatial))
- }
- ```
- ```{r}
- prioritizing_weights = c("scaled_ligand_score" = 5,
- "scaled_ligand_expression_scaled" = 1,
- "ligand_fraction" = 1,
- "scaled_ligand_score_spatial" = 0,
- "scaled_receptor_score" = 0.5,
- "scaled_receptor_expression_scaled" = 0.5,
- "receptor_fraction" = 1,
- "ligand_scaled_receptor_expression_fraction" = 1,
- "scaled_receptor_score_spatial" = 0,
- "scaled_activity" = 0,
- "scaled_activity_normalized" = 1,
- "bona_fide" = 1)
- output = list(DE_sender_receiver = DE_sender_receiver, ligand_scaled_receptor_expression_fraction_df = ligand_scaled_receptor_expression_fraction_df, sender_spatial_DE_processed = sender_spatial_DE_processed, receiver_spatial_DE_processed = receiver_spatial_DE_processed,
- ligand_activities_targets = ligand_activities_targets, DE_receiver_processed_targets = DE_receiver_processed_targets, exprs_tbl_ligand = exprs_tbl_ligand, exprs_tbl_receptor = exprs_tbl_receptor, exprs_tbl_target = exprs_tbl_target)
- prioritization_tables = get_prioritization_tables(output, prioritizing_weights)
- prioritization_tables$prioritization_tbl_ligand_receptor %>% filter(receiver == niches[[1]]$receiver) %>% head(10)
- prioritization_tables$prioritization_tbl_ligand_receptor %>% filter(receiver == niches[[2]]$receiver) %>% head(10)
- prioritization_tables$prioritization_tbl_ligand_receptor = prioritization_tables$prioritization_tbl_ligand_receptor %>% mutate(receiver = factor(receiver, levels = c("In Vivo GPC4", "In Vitro GPC4")), niche = factor(niche, levels = c("In Vivo","In Vitro")))
- prioritization_tables$prioritization_tbl_ligand_target = prioritization_tables$prioritization_tbl_ligand_target %>% mutate(receiver = factor(receiver, levels = c("In Vivo GPC4", "In Vitro GPC4")), niche = factor(niche, levels = c("In Vivo", "In Vitro")))
- ```
- ## Ligand Activities for picking targets
- ```{r}
- ligandActivities <- ligand_activities_targets[!duplicated(ligand_activities_targets[c("ligand", "receiver")]),]
- ligandActivities <- ligandActivities[,-c(4:5)]
- ligandActivitiesInVivo <- ligandActivities[ligandActivities$receiver == "In Vivo GPC4",]
- ligandActivitiesInVitro <- ligandActivities[ligandActivities$receiver == "In Vitro GPC4",]
- ligandActivitiesInVivo <- ligandActivitiesInVivo[,-4]
- ligandActivitiesInVitro <- ligandActivitiesInVitro[,-4]
- names(ligandActivitiesInVivo)[2:6] <- paste(names(ligandActivitiesInVivo)[2:6], "InVivo", sep = "_")
- names(ligandActivitiesInVitro)[2:6] <- paste(names(ligandActivitiesInVitro)[2:6], "InVitro", sep = "_")
- ligandActivities <- merge(ligandActivitiesInVivo, ligandActivitiesInVitro, by.x = 1, by.y = 1)
- ligandActivities <- ligandActivities[,c(1,2,7,3,8,4,9,5,10,6,11)]
- ligandActivities$activity_normalized_diff <- ligandActivities$activity_normalized_InVivo - ligandActivities$activity_normalized_InVitro
- ligandActivities$activity_normalized_div <- ligandActivities$activity_normalized_InVivo / ligandActivities$activity_normalized_InVitro
- # ligandActivities$aupr_corrected_diff <- ligandActivities$aupr_corrected_InVivo - ligandActivities$aupr_corrected_InVitro
- # ligandActivities$aupr_corrected_div <- ligandActivities$aupr_corrected_InVivo / ligandActivities$aupr_corrected_InVitro
- #
- # ligandActivities$activity_diff <- ligandActivities$activity_InVivo - ligandActivities$activity_InVitro
- # ligandActivities$activity_div <- ligandActivities$activity_InVivo / ligandActivities$activity_InVitro
- #
- #
- # ligandActivities$scaled_activity_normalized_diff <- ligandActivities$scaled_activity_normalized_InVivo - ligandActivities$scaled_activity_normalized_InVitro
- # ligandActivities$scaled_activity_normalized_div <- ligandActivities$scaled_activity_normalized_InVivo / ligandActivities$scaled_activity_normalized_InVitro
- ligandActivities <- ligandActivities[order(ligandActivities$activity_normalized_diff, decreasing = T),]
- pri <- prioritization_tables$prioritization_tbl_ligand_receptor
- priInvivo <- pri[pri$niche == "In Vivo",]
- priInvivo <- priInvivo[priInvivo$receptor_fraction > .1,]
- priInvivo <- priInvivo[priInvivo$ligand %in% ligandActivities[ligandActivities$activity_normalized_diff > 0.6,]$ligand,]
- priInvivo <- priInvivo[order(priInvivo$ligand_score, decreasing = T),]
- #priInvivo <- priInvivo[priInvivo$receptor %in% deGPC4[deGPC4$logFC > 0,]$gene,]
- ligandActivitiesInvivoReceptor <- ligandActivities[ligandActivities$ligand %in% priInvivo$ligand,]
- ligandActivitiesInvivoReceptor <- ligandActivitiesInvivoReceptor[ligandActivitiesInvivoReceptor$activity_normalized_diff > 0.6,]
- # Differentially regulated in vitro ligands
- ligandActivitiesInvivoReceptor[ligandActivitiesInvivoReceptor$ligand %in% invitroStateLigands$gene,]
- ```
- ## Ligand Activity and Expression for plots
- ```{r}
- plotting_tbl <- exprs_tbl
- plotting_tbl$stage <- ifelse(grepl("Vivo",plotting_tbl$celltype),"In Vivo","In Vitro")
- plotting_tbl$species <- ifelse(grepl("Mouse",plotting_tbl$celltype),"Mouse","Human")
- plotting_tbl$ct <- gsub(pattern = "In Vitro ", replacement = "", plotting_tbl$celltype)
- plotting_tbl$ct <- gsub(pattern = "In Vivo ", replacement = "", plotting_tbl$ct)
- plotting_tbl$ct <- gsub(pattern = "Mouse ", replacement = "", plotting_tbl$ct)
- unique(plotting_tbl$ct)
- temp <- unique(plotting_tbl$ct)
- temp
- names(temp) <- c("imOL", "maOL", "Astrocyte", "GPC1", "GPC2", "NPC", "GPC3", "GPC", "Microglia", "Ependymal", "Endothelial", "Pericyte", "Macrophage", "GPC4")
- temp
- plotting_tbl$ctRenamed <- plyr::mapvalues(plotting_tbl$ct, from = temp, to = names(temp))
- unique(plotting_tbl$ctRenamed)
- plotting_tbl$ctRenamed <- factor(plotting_tbl$ctRenamed, levels = c("GPC1", "GPC2", "GPC3", "GPC4", "GPC", "imOL", "maOL", "Astrocyte", "Microglia", "Macrophage", "NPC", "Ependymal", "Endothelial", "Pericyte"))
- write.table(plotting_tbl, "output/NicheNet/plotting_tbl.txt", row.names = F, quote = F, sep = "\t")
- ligandsCurated <- c("PDGFA", "OSM", "IL1A", "CSF1", "EGF", "TNF", "EBI3", "IL1B", "NOG", "SLITRK1", "TNFSF10", "GHRH", "TGFB1", "GAS6", "ICAM1", "EDN1", "CCN2", "DSCAM", "MMP13", "ADM", "APOE", "OCLN", "HBEGF", "FGF1")
- #ligandsCurated <- ligandActivitiesInvivoReceptor$ligand[81:95]
- # ligandsActivity <- c("SLITRK1", "PDGFA", "OSM", "LRRC4", "IL1A", "IFNK", "EGF", "EBI3", "CSF1", "CMTM8", "CLCF1",
- # "TNFSF10", "TNF", "NOG", "GAS6", "DSCAM", "DKK3", "BDNF")
- #
- # ligandsScore <- c("APOE", "CCN2", "DKK3", "EBI3", "GAS6", "ICAM1", "IL1A", "OCLN", "OSM", "PDGFA", "PGF", "TNFSF10", "FGF1",)
- #
- # ligandsCurated <- unique(c(ligandsActivity, ligandsScore))
- ```
- ```{r}
- ligandOrder <- rev(ligandActivities[ligandActivities$ligand %in% ligandsCurated,]$ligand)
- ligandPlot <- plotting_tbl[plotting_tbl$gene %in% ligandsCurated,]
- ligandPlot$gene <- factor(ligandPlot$gene, levels = ligandOrder)
- activityPlot <- ligandActivities[ligandActivities$ligand %in% ligandsCurated,]
- activityPlot$ligand <- factor(activityPlot$ligand, levels = ligandOrder)
- ```
- ## Ligand Activity and Expression plot
- ```{r,fig.width = 10.5, fig.height=10}
- ligandActivityGG <- ggplot(activityPlot, aes(x = "In Vivo", y = ligand, fill = scale(activity_normalized_diff))) +
- geom_tile(colour = "black") +
- viridis::scale_fill_viridis(option = "D", expand = c(0,0)) +
- scale_x_discrete(expand = c(0,0)) +
- scale_y_discrete(expand = c(0,0)) +
- theme_bw() +
- theme_manuscript +
- theme(axis.title = element_blank(), legend.title = element_blank(), legend.position = "left", axis.text.y = element_blank()) +
- labs(title = "Ligand Activity", tag = "C")
- ligandExpressionGG <- ggplot(ligandPlot, aes(x = ctRenamed, y = gene, colour = expression_scaled, size = ifelse(fraction==0, NA, fraction))) +
- geom_point() +
- viridis::scale_color_viridis(option = "D") +
- facet_grid(rows = ~species + stage, scales = "free", space = "free") +
- theme_bw() +
- theme_manuscript +
- theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = .5), legend.position = "bottom", axis.title = element_blank(), legend.title = element_blank()) +
- scale_size(range = c(0,4)) +
- labs(title = "Ligand Expression", tag = "D")
- (ligandActivityGG | ligandExpressionGG) + plot_layout(widths = c(.5,10))
- ```
- ## Circos
- ```{r}
- curatedCircos <- c("PDGFA", "IL1A", "OSM", "EBI3", "TGFB1", "TNF", "MMP13", "GAS6", "HBEGF", "ICAM1", "IL1B", "APOE", "EGF", "CSF1", "NOG", "ADM", "TNFSF10", "OCLN", "EDN1", "ADM")
- curatedCircos <- c("PDGFA", "OSM", "IL1A", "EBI3", "EGF", "CSF1", "TGFB1", "TNF", "ICAM1", "OCLN")
- tempPri <- prioritization_tables$prioritization_tbl_ligand_receptor
- tempPri <- tempPri[tempPri$sender %not in% c("In Vivo Mouse NPC", "In Vivo imOL", "In Vivo maOL", "In Vivo Mouse GPC", "In Vivo Mouse Ependymal", "In Vivo Astrocyte"),]
- tempPri <- tempPri[tempPri$niche == "In Vivo",]
- tempPri <- tempPri[tempPri$receptor_fraction > .1,]
- top_ligand_receptor_niche_df = tempPri %>% dplyr::select(niche, sender, receiver, ligand, receptor, prioritization_score) %>% group_by(ligand, receptor) %>% top_n(1, prioritization_score) %>% ungroup() %>% dplyr::select(ligand, receptor, niche)
- prioritized_tbl_oi = tempPri %>% dplyr::filter(ligand %in% curatedCircos) %>% dplyr::select(niche, sender, receiver, ligand, receptor, ligand_receptor, prioritization_score) %>% distinct() %>% inner_join(top_ligand_receptor_niche_df) %>% group_by(ligand) %>% dplyr::filter(receiver == "In Vivo GPC4") %>% top_n(2, prioritization_score) %>% ungroup()
- unique(prioritized_tbl_oi$sender)
- colors_sender <- c("#00BF7D","#D89000", "#E76BF3", "#00B0F6", "#00BFC4", "#39B600", "#A3A500")
- names(colors_sender) <- unique(prioritized_tbl_oi$sender)
- colors_receiver <- "turquoise"
- names(colors_receiver) <- unique(prioritized_tbl_oi$receiver)
- circos_output = make_circos_lr(prioritized_tbl_oi, colors_sender, colors_receiver)
- unique(prioritized_tbl_oi$sender)
- circos_output = make_circos_lr(prioritized_tbl_oi, colors_sender, colors_receiver)
- ```
- ## Receptors for Supp Table
- ```{r}
- receptorSup <- pri
- receptorSup <- receptorSup[,c(2,5,6,18,20)]
- receptorSup <- receptorSup[!duplicated(receptorSup),]
- receptorSup <- receptorSup[order(receptorSup$receptor, receptorSup$ligand),]
- #write.table(receptorSup, "output/NicheNet/receptorSuppTable.txt", quote = F, row.names = F, sep = "\t")
- ```
- ## Receptor Expression for plotting
- ```{r}
- ##
- tempDF <- pri[pri$ligand %in% ligandsCurated,]
- length(unique(tempDF$receptor))
- tempDF <- tempDF[,c(1, 4:6, 18:20)]
- tempDF <- tempDF[!duplicated(tempDF),]
- unique(tempDF$receptor)
- tempDF <- tempDF[tempDF$receptor %in% priInvivo$receptor,]
- tempDF$niche <- factor(tempDF$niche, levels = c("In Vivo", "In Vitro"))
- #activityPlot <- activityPlot[activityPlot$ligand %not in% ligandRemove,]
- #ligandPlot <- ligandPlot[ligandPlot$gene %not in% ligandRemove,]
- tempDF$ligand_receptor <- factor(tempDF$ligand_receptor, levels = unique(tempDF[order(tempDF$ligand, tempDF$receptor),]$ligand_receptor))
- tempDF$receptor_fraction <- tempDF$receptor_fraction * 100
- ```
- ## Receptor Plot
- ```{r, fig.width = 15, fig.height = 6}
- receptorGG <- ggplot(tempDF, aes(y = niche, x = ligand_receptor, fill = receptor_expression_scaled, size = ifelse(receptor_fraction==0, NA, receptor_fraction))) +
- geom_point(color = "black", pch = 21) +
- theme_bw() +
- theme_manuscript +
- scale_fill_gradientn(colors = PurpleAndYellow()) +
- theme(legend.position = "right", panel.spacing=unit(0, "lines"), axis.title = element_blank(), axis.text = element_text(angle = 90, hjust = 1)) +
- scale_size(range = c(0,20)) +
- labs(tag = "C", title = "In Vivo and In Vitro GPC Receptor Expression of Curated Ligands", size = "% Expressed", fill = "Scaled Expression") +
- guides(colour = guide_colorbar(title.position = "top", title.theme = element_text(size = axisTitleSize)),
- size = guide_legend(title.position = "top", title.theme = element_text(size = axisTitleSize)))
- receptorGG
- ```
- ## Combined Plots
- ```{r, fig.width = 8.5, fig.height = 11}
- mouse <- readRDS("output/RDS/mouse.rds")
- mouseDim <- DimPlotCustom(mouse, group.by = "cellType", label = T) + theme_bw() + theme_manuscript + theme(legend.position = "bottom") + labs(tag = "A")
- # This will limit which come from the next function
- mouseMarkers <- c("Pdgfra", "Ptprz1",
- "Gpr17", "Bcas1",
- "Nkx6-2", "Mog",
- "Gfap", "Aqp4",
- "P2ry12", "Itgam",
- "Cldn5", "Pecam1",
- "Acta2", "Des",
- "Dlx2", "Elavl4",
- "Pf4", "Cd163",
- "Tmem212", "Ccdc153")
- #You can extract percent expression from this seurat function... providing features makes it way faster. $data is what you want
- mouseDotPlot <- DotPlot(mouse, features = mouseMarkers)$data
- # For ordering in the plot
- mouseLevels <- c("GPC", "imOL", "maOL", "Astrocyte", "Microglia", "Endothelial", "Pericyte", "NPC", "Macrophage", "Ependymal")
- mouseDotPlot$id <- factor(mouseDotPlot$id , levels = rev(mouseLevels))
- figMouseB <- ggplot(mouseDotPlot, aes(size = pct.exp, color = avg.exp.scaled, y = id, x = features.plot)) +
- geom_point() +
- scale_size_area() +
- viridis::scale_color_viridis() +
- theme_bw() +
- theme_manuscript +
- theme(axis.title = element_blank(), axis.text.x = element_text(angle = 90, hjust = 1, vjust = .5), legend.position = "bottom") +
- labs(tag = "B", title = "Canonical Marker Expression", size = "% Expressed", colour = "Scaled Expression") +
- guides(colour = guide_colorbar(title.position = "top", title.theme = element_text(size = axisTitleSize)),
- size = guide_legend(title.position = "top", title.theme = element_text(size = axisTitleSize))) +
- scale_size(range = c(0,4))
- figMouseB
- top <- (mouseDim | figMouseB) + plot_layout(widths = c(1,1.5))
- middle <- (ligandActivityGG | ligandExpressionGG) + plot_layout(widths = c(.5,10))
- ```
- ```{r, fig.width = 17, fig.height = 26}
- (top / middle / receptorGG )
- #ggsave("output/Figures/Nichenet/nichenet_figure.pdf", width = 8.5, height = 12)
- ```
- ## Ligand, receptor, target Network construction
- ```{r}
- invivoNetwork <- ligand_activities_targets[ligand_activities_targets$ligand %in% tempDF$ligand,]
- invivoNetwork <- invivoNetwork[invivoNetwork$receiver == "In Vivo GPC4",]
- sigRegulons <- read.csv("output/DE/sigRegulons.csv")
- sigRegulons <- sigRegulons[sigRegulons$Gene_Log2FC >0 & sigRegulons$AUC_Log2FC > 0,]
- oligoTargets <- c("KLF6", "CCND1", "MBP", "CSPG4", "SULF2", "PCDH9", "BCAS1", "GPR17", "SEMA3E", "CA10", "OMG", "PLP1", "BAMBI", "CSPG5", "S100B", "APOD", "NRXN1", "TNR", "PLLP", "CNP", "CNTN1", "SOX10", "OLIG1", "OLIG2", "NKX2-2","PTPRZ1", "LUZP2" )
- regulonEdges <- invivoNetwork[invivoNetwork$target %in% sigRegulons$Gene,]
- regulonEdges$type <- "Regulon"
- regulonEdges$tempLigand <- paste0(regulonEdges$ligand, "_", regulonEdges$type)
- regulonEdges$tempTarget <- paste0(regulonEdges$target, "_", regulonEdges$type)
- regulonNodes <- data.frame(node = unique(c(regulonEdges$ligand, regulonEdges$target)),
- network = "Regulon")
- oligoEdges <- invivoNetwork[invivoNetwork$target %in% oligoTargets,]
- oligoEdges$type <- "Oligo"
- oligoEdges$tempLigand <- paste0(oligoEdges$ligand, "_", oligoEdges$type)
- oligoEdges$tempTarget <- paste0(oligoEdges$target, "_", oligoEdges$type)
- oligoNodes <- data.frame(node = unique(c(oligoEdges$ligand, oligoEdges$target)),
- network = "Oligo")
- receptorEdges <- invivoNetwork[invivoNetwork$target %in% tempDF$receptor,]
- receptorEdges$type <- "Receptor"
- receptorEdges$tempLigand <- paste0(receptorEdges$ligand, "_", receptorEdges$type)
- receptorEdges$tempTarget <- paste0(receptorEdges$target, "_", receptorEdges$type)
- receptorNodes <- data.frame(node = unique(c(receptorEdges$ligand, receptorEdges$target)),
- network = "Receptor")
- invivoNetworkFilt <- rbindlist(list(regulonEdges, oligoEdges, receptorEdges))
- invivoNetworkFilt <- invivoNetworkFilt[invivoNetworkFilt$ligand_target_weight > 0.05,]
- invivoNodes <- rbindlist(list(regulonNodes, oligoNodes, receptorNodes))
- invivoNodes$type <- "Gene Target"
- invivoNodes$type <- ifelse(invivoNodes$node %in% tempDF$receptor, "Receptor", invivoNodes$type)
- invivoNodes$type <- ifelse(invivoNodes$node %in% tempDF$ligand, "Ligand", invivoNodes$type)
- invivoNodes$type <- ifelse(invivoNodes$node %in% sigRegulons$Gene, "Regulon", invivoNodes$type)
- invivoNodes <- merge(invivoNodes, deGPC4.sig, by.x = "node", by.y = "gene", all.x = T)
- invivoNodes <- invivoNodes[,c(1,2,3,6)]
- invivoNodes$tempNode <- paste0(invivoNodes$node, "_", invivoNodes$network)
- invivoNodes
- TF_Functions <- read.csv("data_for_import/TF_Functions.csv")
- invivoNodes[invivoNodes$type == "Regulon" & invivoNodes$node %not in% c(TF_Functions$Activators, TF_Functions$Repressors),]
- invivoNodes <- invivoNodes[invivoNodes$node %not in% TF_Functions$Repressors,]
- invivoNetworkFilt <- invivoNetworkFilt[invivoNetworkFilt$target %not in% TF_Functions$Repressors,]
- #write.table(invivoNetworkFilt, "output/Networks/NicheNet/invivoNetworkNichenet.txt", sep = "\t", quote = F, row.names = F)
- #write.table(invivoNodes, "output/Networks/NicheNet/invivoNodesNichenet.txt", sep = "\t", quote = F, row.names = F)
- ```
- # Supplementary
- ```{r}
- dimLeidenFig <- DimPlotCustom(mouse, group.by = "leidenClusters", ncol = 1, label = T, pt.size = 3) & theme_bw() & theme_manuscript & NoLegend() & ggtitle("In Vivo Mouse Leiden Clusters") & labs(tag = "A")
- dimLeidenFig
- ```
- ## Leiden Markers
- ```{r, fig.width = 11, fig.height = 10.5}
- DefaultAssay(mouse) <- "RNA"
- canonicalMarkers <- c("Pdgfra", "Ptprz1",
- "Gpr17", "Bcas1",
- "Nkx6-2", "Mog",
- "Gfap", "Aqp4",
- "P2ry12", "Itgam",
- "Cldn5", "Pecam1",
- "Acta2", "Des",
- "Dlx2", "Elavl4",
- "Pf4", "Cd163",
- "Tmem212", "Ccdc153")
- markerDotPlotSupp <- DotPlot(mouse, features = canonicalMarkers, group.by = "leidenClusters")$data
- leidenTemp <- c("0" = "maOL",
- "1" = "maOL",
- "2" = "maOL",
- "3" = "maOL",
- "4" = "maOL",
- "5" = "maOL",
- "6" = "maOL",
- "7" = "Endothelial",
- "8" = "maOL",
- "9" = "maOL",
- "10" = "maOL",
- "11" = "maOL",
- "12" = "maOL",
- "13" = "Microglia",
- "14" = "imOL",
- "15" = "GPC",
- "16" = "Astrocyte",
- "17" = "NPC",
- "18" = "Ependymal",
- "19" = "Pericyte",
- "20" = "Macrophage")
- leidenTemp <- paste0(0:20, " - ", leidenTemp)
- names(leidenTemp) <- 0:20
- markerDotPlotSupp$id <- plyr::mapvalues(as.character(markerDotPlotSupp$id), from = names(leidenTemp), to = leidenTemp)
- markerDotPlotSupp$id <- factor(markerDotPlotSupp$id, levels = rev(c("15 - GPC",
- "14 - imOL",
- "5 - maOL",
- "0 - maOL",
- "1 - maOL",
- "2 - maOL",
- "3 - maOL",
- "4 - maOL",
- "6 - maOL",
- "8 - maOL",
- "9 - maOL",
- "10 - maOL",
- "11 - maOL",
- "12 - maOL",
- "16 - Astrocyte",
- "13 - Microglia",
- "7 - Endothelial",
- "19 - Pericyte",
- "17 - NPC",
- "20 - Macrophage",
- "18 - Ependymal")))
- figSuppMarkerPlot<- ggplot(markerDotPlotSupp, aes(size = pct.exp, fill = avg.exp.scaled, y = id, x = features.plot)) +
- geom_point(color = "black", pch = 21) +
- scale_size_area(max_size = 15) +
- scale_fill_gradientn(colors = PurpleAndYellow()) +
- theme_bw() +
- theme_manuscript +
- theme(axis.title = element_blank(), axis.text.x = element_text(angle = 90, hjust = 1, vjust = .5), legend.position = "right", panel.spacing=unit(0, "lines")) +
- labs(tag = "B", title = "Canonical Marker Expression", size = "% Expressed", fill = "Scaled Expression") +
- guides(colour = guide_colorbar(title.position = "top", title.theme = element_text(size = axisTitleSize)),
- size = guide_legend(title.position = "top", title.theme = element_text(size = axisTitleSize)))
- figSuppMarkerPlot
- ```
- ## Piece together
- ```{r, fig.width=30, fig.height = 20}
- ((dimLeidenFig | figSuppMarkerPlot) / receptorGG) + plot_layout(heights = c(1,.25))
- #ggsave("output/Figures/Nichenet/nichenetSupplement.pdf", width = 30, height = 20)
- ```
- ```{r}
- sessionInfo()
- ```
25_NicheNet_Analysis_and_Figure.Rmd at commit 760cd2f, under MIT · at the source
Overview
- Center for Translational Neuromedicine, University of Rochester Medical Center,Rochester, NY USA
- Center for Translational Neuromedicine, University of Copenhagen Faculty of Health,Copenhagen, Denmark
Abstract
The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.
Repository
Its files are read in the Code ↔ Paper reader above, with 32 matches between paragraphs and lines of code.
CTNGoldmanLab/Glial_Chimera_Maturation
760cd2f41c90ccfb279b633e2943e03526a0c510, 12 November 2025Availability: 1 check, the latest on 29 September 2026: the link answers
- 29 September 2026: the link answers
34 files
- Scripts/
01_Processing.Rmd , R, 153 lines, 1 match - Scripts/
02_Pluripotent_GPC_scVI_ , Jupyter, 191 linesintegration.ipynb - Scripts/
03_PSC_vs_GPC_scRNA_Anal , R, 153 linesysis.Rmd - Scripts/
04_CUT& , R, 162 linesTag_DiffBind_peakAnnotat ion.Rmd - Scripts/
05_CUT& , R, 438 lines, 2 matchesTag_scRNA_Intersection.R md - Scripts/
06_CUT& , Shell, 169 lines, 2 matchesTag_genomicCoverage.sh - Scripts/
07_PSC_vs_GPC_Figure_Ass , R, 210 lines, 2 matchesembly.Rmd - Scripts/
08_Invivo_scVI_integrati , Jupyter, 214 lineson.ipynb - Scripts/
10_Invivo_Processing.Rmd , R, 163 lines - Scripts/
11_Invitro_Invivo_scVI_I , Jupyter, 211 linesntegration.ipynb - Scripts/
12_Invitro_Invivo_Proces , R, 166 lines, 1 matchsing.Rmd - Scripts/
13_Invitro_Invivo_Palant , Jupyter, 210 linesir.ipynb - Scripts/
14_Invitro_Analysis.Rmd , R, 659 lines, 1 match - Scripts/
15_Invitro_Integration_R , R, 318 lines, 1 matchamos.Rmd - Scripts/
16_Invitro_Integration_V , R, 387 lineselmeshev.Rmd - Scripts/
17_Invitro_Integration_v , R, 252 lines, 1 matchan_Bruggen.Rmd - Scripts/
18_Label_Transfer_Figure , R, 61 lines, 1 match_Generation.R - Scripts/
18_Label_Transfer_Figure , R, 172 lines, 1 match_Generation.Rmd - Scripts/
19_Invivo_Analysis.Rmd , R, 1,121 lines, 5 matches - Scripts/
20_scATAC_Analysis.Rmd , R, 549 lines, 1 match - Scripts/
21_Invitro_Invivo_Analys , R, 746 lines, 3 matchesis_withATAC.Rmd - Scripts/
22_Mouse_scVI_integratio , Jupyter, 169 linesn.ipynb - Scripts/
23_Mouse_Analysis.Rmd , R, 225 lines - Scripts/
24_NicheNet_Processing.R , R, 257 lines, 1 matchmd - Scripts/
25_NicheNet_Analysis_and , R, 833 lines, 5 matches_Figure.Rmd - Scripts/
26_Process_MagicBlast_Ou , R, 171 lines, 1 matchtput.Rmd - Scripts/
27_Xenium_Read_and_Crop. , Jupyter, 826 lines, 1 matchipynb - Scripts/
28_Xenium_Inital_Analysi , Jupyter, 1,227 lines, 1 matchs.ipynb - Scripts/
29_Xenium_Figure_Constru , R, 379 lines, 1 matchction.Rmd - Scripts/
Generate_Sup_Tables.Rmd , R, 533 lines - Scripts/
HelperFunctions.R , R, 122 lines - Scripts/
StyleSettings.R , R, 51 lines - LICENSE, License, 21 lines
- README.md, Text, 42 lines
Code availability statement
The paper has a code availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- it points to the authors' code: CTNGoldmanLab/
Glial_Chimera_Maturation
Read it in the paper: doi.org/10.1038/s41467-026-71803-3.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 32 scripts, each with its path and the digest of its content;
- 32 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
Datasets cited
- geo:GSE217511, at NCBI GEO; found in “Data availability”
- github.com/
castelo-branco-lab/ , at github.com; found in “Data availability”humandevolg
Code and data availability statement
The paper has a code and data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- it points to 2 datasets: github.com/
castelo-branco-lab/ , NCBI GEO GSE217511humandevolg - it points to the authors' code: CTNGoldmanLab/
Glial_Chimera_Maturation - it says that the data are available on request
Read it in the paper: doi.org/10.1038/s41467-026-71803-3.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 29 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 9 authors, 5 keywords, 12 MeSH terms, 2 funders, 132 references.
Cite
This paper
Mariani, J. N., Schanz, S. J., Mansky, B., Wei, X., Long, C. C., Chandler-Militello, D., Aichelman, H. E., Huynh, N. P. T., & Goldman, S. A. (2026). Charting the transition from in vitro gliogenesis to the in vivo maturation of human glial progenitor cells transplanted into the hypomyelinated mouse brain. Nature communications, 17(1), 5609. https://
BibTeX
@article{mariani2026char
author = {Mariani, John N. and Schanz, Steven J. and Mansky, Benjamin and Wei, Xiaolu and Long, Carter C. and Chandler-Militello, Devin and Aichelman, Hannah E. and Huynh, Nguyen P. T. and Goldman, Steven A.},
title = {{Charting the transition from in vitro gliogenesis to the in vivo maturation of human glial progenitor cells transplanted into the hypomyelinated mouse brain}},
journal = {Nature communications},
year = {2026},
month = apr,
volume = {17},
number = {1},
pages = {5609},
publisher = {Nature Publishing Group},
issn = {2041-1723},
doi = {10.1038/
url = {https://
pmid = {42026046},
pmcid = {PMC13315746}
}
RIS
TY - JOUR
AU - Mariani, John N.
AU - Schanz, Steven J.
AU - Mansky, Benjamin
AU - Wei, Xiaolu
AU - Long, Carter C.
AU - Chandler-Militello, Devin
AU - Aichelman, Hannah E.
AU - Huynh, Nguyen P. T.
AU - Goldman, Steven A.
TI - Charting the transition from in vitro gliogenesis to the in vivo maturation of human glial progenitor cells transplanted into the hypomyelinated mouse brain
T2 - Nature communications
J2 - Nat Commun
PY - 2026
DA - 2026/
VL - 17
IS - 1
SP - 5609
SN - 2041-1723
PB - Nature Publishing Group
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"type": "article-journal",
"title": "Charting the transition from in vitro gliogenesis to the in vivo maturation of human glial progenitor cells transplanted into the hypomyelinated mouse brain",
"container-title": "Nature communications",
"author": [
{
"family": "Mariani",
"given": "John N."
},
{
"family": "Schanz",
"given": "Steven J."
},
{
"family": "Mansky",
"given": "Benjamin"
},
{
"family": "Wei",
"given": "Xiaolu"
},
{
"family": "Long",
"given": "Carter C."
},
{
"family": "Chandler-Militello",
"given": "Devin"
},
{
"family": "Aichelman",
"given": "Hannah E."
},
{
"family": "Huynh",
"given": "Nguyen P. T."
},
{
"family": "Goldman",
"given": "Steven A."
}
],
"container-title-short":
"volume": "17",
"issue": "1",
"page": "5609",
"DOI": "10.1038/
"PMID": "42026046",
"PMCID": "PMC13315746",
"ISSN": "2041-1723",
"publisher": "Nature Publishing Group",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
23
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1038/s41587-023-01798-5 [code]
- Young glial progenitor cells competitively replace aged and diseased human glia in the adult chimeric mouse brain.Journal: Nature biotechnologyIn common: anndata, Scanpy, Seurat, 8 other tools, mouse, cellular / molecular, 16 references, 2 authors
- [2] doi:10.1002/glia.24291
- Glial progenitor cells of the adult human white and grey matter are contextually distinct.Journal: GliaIn common: mouse, cellular / molecular, 20 references, 2 authors
- [3] doi:10.1038/s41593-026-02208-0 [code]
- Single-nucleus epigenomic profiling of the adult human central nervous system unveils epigenetic memory of developmental programs.Journal: Nature neuroscienceIn common: deepTools, reticulate, BEDTools, 15 other tools, genetics / omics, 12 references
- [4] doi:10.1016/j.celrep.2024.115149 [code]
- Single-nucleus and spatial landscape of the sub-ventricular zone in human glioblastoma.Journal: Cell reportsIn common: Squidpy, reticulate, SAMtools, 21 other tools, cellular / molecular, 2 references
- [5] doi:10.1186/s13059-026-04177-w [code]
- Genomic sequence evolution underlying human neocortical interareal diversification.Journal: Genome biologyIn common: Squidpy, reticulate, BEDTools, 16 other tools, genetics / omics, mouse, cellular / molecular, 7 references
- [6] doi:10.1038/s41467-023-41033-y [code]
- Divergent single cell transcriptome and epigenome alterations in ALS and FTD patients with C9orf72 mutation.Journal: Nature communicationsIn common: deepTools, BEDTools, SAMtools, 16 other tools, genetics / omics, cellular / molecular, 7 references
- [7] doi:10.1038/s41592-023-01938-4 [code]
- SCENIC+: single-cell multiomic inference of enhancers and gene regulatory networks.Journal: Nature methodsIn common: BEDTools, anndata, Scanpy, 16 other tools, genetics / omics, mouse, cellular / molecular, 5 references
- [8] doi:10.1038/s41586-025-09083-y [code]
- Single-cell transcriptomic and chromatin dynamics of the human brain in PTSD.Journal: NatureIn common: Squidpy, reticulate, BEDTools, 16 other tools, genetics / omics, cellular / molecular, 4 references
- [9] doi:10.1073/pnas.2303647120 [code]
- Quantifying common and distinct information in single-cell multimodal data with Tilted Canonical Correlation Analysis.Journal: Proceedings of the National Academy of Sciences of the United States of AmericaIn common: deepTools, reticulate, BEDTools, 17 other tools, genetics / omics, cellular / molecular, 2 references
- [10] doi:10.1038/s42003-025-08859-2 [code]
- Single-cell DNA methylation analysis tool Amethyst resolves distinct non-CG methylation patterns in human astrocytes and oligodendrocytes.Journal: Communications biologyIn common: BEDTools, anndata, Scanpy, 16 other tools, genetics / omics, cellular / molecular, 5 references
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 32 scripts, and 32 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:c99f1efb17dcf3ce…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.1038/s41467-026-71803-3)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1038/s41467-026-71803-3.svg
:target: https://openscicode.org/badge/doi/10.1038/s41467-026-71803-3
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1038/s41467-026-71803-3"><img src="https://openscicode.org/badge/doi/10.1038/s41467-026-71803-3.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".
If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
