A multi-center cross-platform single-cell multimodal atlas of the mouse cerebral cortex.
12 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 19 matches
- [1] § Methods › Gene activity scoring of scATAC-seq data ↔ ATAC-code.R, lines 56 to 103 · score 0.94 · gene activity matrix, FindTransferAnchors, TransferData, NormalizeData, RunPCA, ScaleData · block
oscr:b:Z8D2S2HVT6J67-L· Report a mismatch - [2] § Methods › scATAC-seq data processing ↔ ATAC-code.R, lines 1 to 54 · score 0.94 · peak region fragments, blacklist ratio, FindTopFeatures, min.cutoff, Quality control, SVD · block
oscr:b:GCXS6HSD97KSE-F· Report a mismatch - [3] § Methods › Chromatin co-accessibility analysis ↔ ATAC-code.R, lines 443 to 483 · score 0.89 · generate_ccans, run_cicero, sample_num, co accessibility, target genes, genome · block
oscr:b:REXE0DY39P138-P· Report a mismatch - [4] § Methods › RNA-seq data preprocessing and integration ↔ RNA-code.R, lines 48 to 90 · score 0.89 · LogNormalize, scale.factor, FindVariableFeatures, ScaleData, log normalization, vst · block
oscr:b:9FV7ZY0DX65P4-Y· Report a mismatch - [5] § Methods › RNA-seq data preprocessing and integration ↔ RNA-code.R, lines 92 to 134 · score 0.81 · min.dist, FindClusters, FindNeighbors, RunUMAP, resolution, dims · block
oscr:b:X3231WVQTVBKH-9· Report a mismatch - [6] § Data Records ↔ RNA-code.R, lines 1 to 46 · score 0.76 · nCount_RNA, HB_percent, nFeature_RNA, percent.mt, quality control, genes · block
oscr:b:727YRT6XAECV3-7· Report a mismatch - [7] § Methods › Identification of cell-type-specific regulatory regions ↔ ATAC-code.R, lines 338 to 391 · score 0.76 · ClosestFeature, CoveragePlot, FindAllMarkers, LR, threshold, assay · block
oscr:b:0YEC9CZQ313HQ-O· Report a mismatch - [8] § Methods › scATAC-seq cell-type annotation ↔ ATAC-code.R, lines 56 to 103 · score 0.76 · FindTransferAnchors, TransferData, scRNA, query, prediction, LSI · block
oscr:b:Z8D2S2HVT6J67-L· Report a mismatch - [9] § Methods › RNA-seq data preprocessing and integration ↔ ATAC-code.R, lines 1 to 54 · score 0.73 · FindClusters, FindNeighbors, RunUMAP, algorithm, resolution, dims · block
oscr:b:GCXS6HSD97KSE-F· Report a mismatch - [10] § Technical Validation ↔ RNA-code.R, lines 1 to 46 · score 0.71 · nCount_RNA, HB_percent, nFeature_RNA, percent.mt, Quality control, genes · block
oscr:b:727YRT6XAECV3-7· Report a mismatch - [11] § Data Records ↔ ATAC-code.R, lines 566 to 603 · score 0.67 · nCount_peaks, orig.ident, TSS enrichment, pct, atac · block
oscr:b:YGCTH3BDNHFM9-S· Report a mismatch - [12] § Methods › Differential expression and enrichment analysis ↔ RNA-code.R, lines 136 to 183 · score 0.67 · clusterProfiler, GO terms, db, simplification, mm, enrichment · block
oscr:b:HK0DTWTJ580C8-4· Report a mismatch - [13] § Technical Validation ↔ ATAC-code.R, lines 240 to 272 · score 0.60 · microglial cells, inhibitory neurons, excitatory neurons, astrocytes, oligodendrocytes · block
oscr:b:KBQMM9GDJR011-W· Report a mismatch - [14] § Methods › RNA-seq data preprocessing and integration ↔ RNA-code.R, lines 48 to 90 · score 0.59 · RunPCA, Harmony integration, Elbow, variable, RNA, cell · block
oscr:b:9FV7ZY0DX65P4-Y· Report a mismatch - [15] § Technical Validation ↔ RNA-code.R, lines 244 to 300 · score 0.57 · inhibitory neurons, excitatory neurons, divergence, evolutionary, humans, species · block
oscr:b:E0E54D3MPHNXR-R· Report a mismatch - [16] § Technical Validation ↔ ATAC-code.R, lines 240 to 272 · score 0.55 · oligodendrocyte precursor cells, excitatory neurons, probability, inhibitory, astrocytes · block
oscr:b:KBQMM9GDJR011-W· Report a mismatch - [17] § Methods › scATAC-seq cell-type annotation ↔ ATAC-code.R, lines 206 to 238 · score 0.55 · probability matrix, annotation transition, row, Dropsn, Dropsc · block
oscr:b:FMEFMWBZ1KPP4-B· Report a mismatch - [18] § Technical Validation ↔ RNA-code.R, lines 244 to 300 · score 0.53 · inhibitory neurons, excitatory neurons, classic, species, astrocytes, oligodendrocytes · block
oscr:b:E0E54D3MPHNXR-R· Report a mismatch - [19] § Methods › Cell type annotation and cross-dataset cross-validation ↔ RNA-code.R, lines 136 to 183 · score 0.51 · AggregateExpression, CPM, enriched, assay, matrices, RNA · block
oscr:b:HK0DTWTJ580C8-4· 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 · 603 lines · 18 KB · CC-BY-4.0 · 10 matches
- #Quality Control----
- brain <- NucleosomeSignal(object = brain)
- head(brain)
- brain$nucleosome_group <- ifelse(brain$nucleosome_signal > 4, 'NS > 4', 'NS < 4')
- FragmentHistogram(object = brain, group.by = 'nucleosome_group', region = 'chr1-1-10000000')
- brain <- TSSEnrichment(brain)
- head(brain)
- brain$pct_reads_in_peaks <- brain$peak_region_fragments / brain$passed_filters * 100
- brain$blacklist_ratio <- brain$blacklist_region_fragments / brain$peak_region_fragments
- VlnPlot(
- object = brain,
- features = c('pct_reads_in_peaks', 'peak_region_fragments',
- 'TSS.enrichment', 'blacklist_ratio', 'nucleosome_signal'),
- pt.size = 0.1,
- ncol = 5
- )
- brain <- subset(
- x = brain,
- subset =
- peak_region_fragments > 3000 &
- peak_region_fragments < 100000 &
- pct_reads_in_peaks > 40 &
- blacklist_ratio < 0.025
- )
- #Normalization----
- brain <- RunTFIDF(brain)
- brain <- FindTopFeatures(brain, min.cutoff = 'q0')
- brain <- RunSVD(object = brain)
- pdf("LSI_component.pdf")
- DepthCor(brain)
- dev.off()
- #Clustering----
- brain <- RunUMAP(
- object = brain,
- reduction = 'lsi',
- dims = 2:30
- )
- brain <- FindNeighbors(
- object = brain,
- reduction = 'lsi',
- dims = 2:30
- )
- brain <- FindClusters(
- object = brain,
- algorithm = 3,
- resolution = 1.2,
- verbose = FALSE
- )
- DimPlot(object = brain, label = TRUE) + NoLegend()
- #Create Gene Activity Matrix----
- DefaultAssay(brain) <- "peaks"
- gene.activities <- GeneActivity(brain, features = VariableFeatures(pbmc.rna))
- brain[['RNA']] <- CreateAssayObject(counts = gene.activities)
- DefaultAssay(brain) <- 'RNA'
- brain <- NormalizeData(
- object = brain,
- assay = 'RNA',
- )
- brain <- FindVariableFeatures(brain, selection.method = "vst", nfeatures = 2000)
- brain <- ScaleData(brain, features = rownames(brain))
- brain <- RunPCA(brain)
- FeaturePlot(
- object = brain,
- features = c('Sst','Pvalb',"Gad2","Neurod6","Rorb","Syt6"),
- pt.size = 0.1,
- max.cutoff = 'q95',
- ncol = 3
- )
- #scRNA-seq Annotation----
- setwd("~/R/cortex_total/dropsc")
- setwd("~/R/cortex_total/ATAC")
- pbmc.rna <- readRDS("merge_scRNAlist.rds")
- table(pbmc.rna$sub.cluster)
- p1 <- DimPlot(pbmc.rna, group.by = "sub.cluster", label = TRUE) + NoLegend() + ggtitle("RNA")
- p2 <- DimPlot(brain, group.by = "orig.ident", label = FALSE) + NoLegend() + ggtitle("ATAC")
- p1 + p2
- DefaultAssay(brain) <- "RNA"
- transfer.anchors <- FindTransferAnchors(reference = pbmc.rna,
- query = brain,
- reference.reduction = "pca",
- dims = 1:30)
- predicted.labels <- TransferData(
- anchorset = transfer.anchors,
- refdata = pbmc.rna$sub.cluster,
- weight.reduction = brain[["lsi"]],
- dims = 2:30
- )
- brain <- AddMetaData(object = brain, metadata = predicted.labels)
- table(brain$predicted.id)
- brain$'dropsc' <- brain$predicted.id
- head(brain)
- table(brain$'10xsc', brain$dropsn, brain$'10xsn')
- #Filtering----
- Idents(brain) = "dropsc"
- brain <- subset(brain, idents = setdiff(unique(Idents(brain)), c("Pericytes","endothelial cells")))
- #Save Data----
- setwd("~/R/cortex_total/ATAC/filtered_analysis")
- setwd("~/R/cortex_total/ATAC")
- brain <- readRDS("brain.rds")
- saveRDS(brain, "brain.rds")
- #Annotation Comparison Plot----
- data <- data.frame(
- dropsn = brain$dropsn,
- dropsc = brain$dropsc,
- X10xsc = brain$`10xsc`,
- X10xsn = brain$`10xsn`,
- brain@reductions$[email hidden]
- )
- head(data)
- library(ggplot2)
- library(ggforce)
- library(dplyr)
- library(tidyr)
- library(patchwork)
- library(ggsci)
- methods <- c("dropsn","dropsc","X10xsc","X10xsn")
- all_celltypes <- unique(unlist(data[c("dropsn", "dropsc", "X10xsc", "X10xsn")]))
- color_palette <- viridis::viridis_pal(option = "plasma")(length(all_celltypes))
- names(color_palette) <- all_celltypes
- plots <- list()
- for (method in methods) {
- method_data <- data %>%
- mutate(cell_id = rownames(data)) %>%
- select(umap_1, umap_2, celltype = !!method, cell_id)
- method_centroids <- method_data %>%
- group_by(celltype) %>%
- summarise(
- centroid_x = median(umap_1),
- centroid_y = median(umap_2),
- .groups = "drop"
- )
- other_annotations <- data %>%
- mutate(cell_id = rownames(data)) %>%
- select(cell_id, all_of(methods)) %>%
- pivot_longer(cols = -cell_id, names_to = "annotation_method", values_to = "annotated_celltype") %>%
- filter(annotation_method != method)
- conflict_data <- method_data %>%
- left_join(other_annotations, by = "cell_id") %>%
- filter(celltype != annotated_celltype)
- sample_size_per_group <- conflict_data %>%
- group_by(annotated_celltype) %>%
- summarise(n = n(), .groups = "drop") %>%
- mutate(sample_n = pmin(100, n))
- connection_data <- conflict_data %>%
- group_by(annotated_celltype) %>%
- sample_n(size = min(100, n()), replace = FALSE) %>%
- ungroup() %>%
- left_join(method_centroids, by = c("annotated_celltype" = "celltype"))
- p <- ggplot() +
- geom_point(
- data = method_data,
- aes(x = umap_1, y = umap_2, color = celltype),
- size = 0.4, alpha = 0.6
- ) +
- geom_segment(
- data = connection_data,
- aes(x = umap_1, y = umap_2,
- xend = centroid_x, yend = centroid_y,
- color = annotated_celltype),
- linewidth = 0.3, alpha = 0.5
- ) +
- geom_point(
- data = method_centroids,
- aes(x = centroid_x, y = centroid_y, fill = celltype),
- shape = 23, size = 4, color = "black", stroke = 0.8
- ) +
- scale_color_manual(values = color_palette, name = "Celltype") +
- scale_fill_manual(values = color_palette, name = "Celltype") +
- labs(title = paste("Method:", method)) +
- theme_void() +
- theme(
- plot.title = element_text(hjust = 0.5, face = "bold")
- )
- plots[[method]] <- p
- }
- pdf("annotation_comparison.pdf", width = 16, height = 12)
- combined_plot <- plots[[1]] + plots[[2]] + plots[[3]] + plots[[4]] +
- plot_layout(ncol = 2, guides = "collect") +
- plot_annotation(theme = theme(plot.title = element_text(hjust = 0.5, face = "bold")))
- print(combined_plot)
- dev.off()
- #Probability Matrix----
- calculate_annotation_transition_matrix <- function(data) {
- methods <- c("dropsn", "dropsc", "X10xsc", "X10xsn")
- all_celltypes <- unique(unlist(data[methods]))
- transition_matrix <- matrix(0, nrow = length(all_celltypes), ncol = length(all_celltypes))
- rownames(transition_matrix) <- all_celltypes
- colnames(transition_matrix) <- all_celltypes
- data$true_celltype <- apply(data[methods], 1, function(x) {
- tbl <- table(x)
- names(tbl)[which.max(tbl)]
- })
- for (i in 1:nrow(data)) {
- true_type <- data$true_celltype[i]
- annotations <- unlist(data[i, methods])
- annotation_counts <- table(annotations)
- for (annotated_type in names(annotation_counts)) {
- if (annotated_type %in% all_celltypes) {
- transition_matrix[true_type, annotated_type] <- transition_matrix[true_type, annotated_type] + annotation_counts[annotated_type]
- }
- }
- }
- probability_matrix <- transition_matrix / rowSums(transition_matrix)
- return(list(
- count_matrix = transition_matrix,
- probability_matrix = probability_matrix
- ))
- }
- transition_results <- calculate_annotation_transition_matrix(data)
- transition_results[[2]]
- library(ComplexHeatmap)
- library(circlize)
- prob_matrix <- transition_results[[2]]
- new_order <- c("Excitatory neurons", "Inhibitory neurons",
- "Astrocytes", "Oligodendrocytes", "Oligodendrocyte Precursor Cells",
- "Microglial cells")
- prob_matrix <- prob_matrix[new_order, new_order]
- col_fun <- colorRamp2(c(0, 0.5, 1), viridis::viridis_pal(option = "plasma")(3))
- pdf("probability_heatmap.pdf")
- Heatmap(prob_matrix,
- name = "probability",
- col = col_fun,
- cluster_rows = F,
- cluster_columns = F,
- row_names_side = "left",
- column_names_side = "top",
- row_names_gp = gpar(fontsize = 10),
- column_names_gp = gpar(fontsize = 10),
- cell_fun = function(j, i, x, y, width, height, fill) {
- if(prob_matrix[i, j] >= 0.01) {
- grid.text(sprintf("%.1f%%", prob_matrix[i, j] * 100), x, y,
- gp = gpar(fontsize = 8))
- }
- },
- heatmap_legend_param = list(legend_height = unit(4, "cm")),
- column_title_side = "bottom")
- dev.off()
- #UMAP Visualization----
- library(Seurat)
- library(tidyverse)
- library(ggrepel)
- library(scattermore)
- pbmc <- brain
- head([email hidden])
- dim(pbmc)
- umap = pbmc@reductions$[email hidden] %>%
- as.data.frame() %>%
- cbind(cell_type = [email hidden]$final_annotation)
- umap$UMAP_1 <- umap$umap_1
- umap$UMAP_2 <- umap$umap_2
- allcolour = viridis::viridis_pal(option = "plasma")(6)
- p <- ggplot(umap, aes(x = UMAP_1, y = UMAP_2, color = cell_type)) +
- geom_point(size = 0.1, alpha = 1) + scale_color_manual(values = allcolour)
- p2 <- p +
- theme(panel.grid.major = element_blank(),
- panel.grid.minor = element_blank(),
- panel.border = element_blank(),
- axis.title = element_blank(),
- axis.text = element_blank(),
- axis.ticks = element_blank(),
- panel.background = element_rect(fill = 'white'),
- plot.background = element_rect(fill = "white"))
- p3 <- p2 +
- theme(
- legend.title = element_blank(),
- legend.key = element_rect(fill = 'white'),
- legend.text = element_text(size = 20),
- legend.key.size = unit(1, 'cm')
- ) +
- guides(color = guide_legend(override.aes = list(size = 5)))
- p4 <- p3 +
- geom_segment(aes(x = min(umap$UMAP_1), y = min(umap$UMAP_2),
- xend = min(umap$UMAP_1) + 3, yend = min(umap$UMAP_2)),
- colour = "black", size = 1, arrow = arrow(length = unit(0.3, "cm"))) +
- geom_segment(aes(x = min(umap$UMAP_1), y = min(umap$UMAP_2),
- xend = min(umap$UMAP_1), yend = min(umap$UMAP_2) + 3),
- colour = "black", size = 1, arrow = arrow(length = unit(0.3, "cm"))) +
- annotate("text", x = min(umap$UMAP_1) + 1.5, y = min(umap$UMAP_2) - 1, label = "UMAP_1",
- color = "black", size = 3, fontface = "bold") +
- annotate("text", x = min(umap$UMAP_1) - 1, y = min(umap$UMAP_2) + 1.5, label = "UMAP_2",
- color = "black", size = 3, fontface = "bold", angle = 90) +
- theme(legend.position = "none")
- cell_type_med <- aggregate(cbind(UMAP_1, UMAP_2) ~ cell_type,
- data = umap,
- FUN = median)
- p5 <- p3 +
- geom_label_repel(aes(label = cell_type), fontface = "bold", data = cell_type_med, size = 2,
- point.padding = unit(0.5, "lines")) +
- theme(legend.position = "none")
- pdf("umap_cell.pdf", width = 5, height = 5)
- p5
- dev.off()
- #Specific Gene Peak Visualization----
- library(ArchR)
- library(reshape2)
- head(brain)
- Idents(brain) <- "final_annotation"
- idents.plot <- names(which(table(Idents(brain)) > 50))
- brain <- SortIdents(brain)
- DefaultAssay(brain) <- "peaks"
- pdf("gene_peaks.pdf")
- CoveragePlot(
- object = brain,
- region = c("Neurod6", "Gad2"),
- idents = idents.plot,
- extend.upstream = 1000,
- extend.downstream = 1000,
- ncol = 1)
- dev.off()
- #Differentially Accessible Regions Analysis----
- DefaultAssay(brain) <- "peaks"
- Idents(brain) <- "predicted.id"
- cellType_DARs <- FindAllMarkers(
- object = brain,
- test.use = "LR",
- logfc.threshold = 0.25,
- min.pct = 0.25,
- verbose = FALSE
- )
- head(cellType_DARs)
- cellType_DARs <- cellType_DARs %>%
- dplyr::filter(p_val_adj <= 0.05 | avg_log2FC > 0.8) %>%
- dplyr::group_by(cluster) %>%
- dplyr::top_n(n = 100, wt = avg_log2FC) %>%
- dplyr::ungroup()
- cellType_DARs$peak_id <- rownames(cellType_DARs)
- cf <- ClosestFeature(
- object = brain,
- regions = cellType_DARs$peak_id
- )
- cellType_DARs <- cellType_DARs %>%
- left_join(
- dplyr::select(as.data.frame(cf), peak_id = query_region, gene_name, gene_biotype, type, distance),
- by = "peak_id"
- )
- cat("Significant DARs by cell type:", nrow(cellType_DARs), "\n")
- #Gene Average Accessibility Heatmap----
- library(ggh4x)
- mouse_genes <- unique(cellType_DARs$gene_name)[1]
- object <- brain
- Stack_CoveragePlot <- function(object, mouse_genes, cols, extend = 1000) {
- gene_peaks <- cellType_DARs %>%
- dplyr::filter(gene_name %in% mouse_genes) %>%
- dplyr::group_by(gene_name) %>%
- top_n(1, wt = avg_log2FC) %>%
- pull(peak_id)
- p_list <- lapply(gene_peaks, function(p) {
- CoveragePlot(
- object = object,
- region = p,
- extend.upstream = extend,
- extend.downstream = extend,
- group.by = "predicted.id",
- cols = cols,
- verbose = FALSE,
- annotation = FALSE,
- peaks = FALSE
- )[[1]]$data %>%
- mutate(peak = p)
- })
- df <- do.call(rbind, p_list)
- df <- df %>%
- left_join(
- dplyr::select(cellType_DARs, peak = peak_id, gene_name),
- by = "peak"
- )
- pdf("stack_coverage.pdf")
- ggplot(df, aes(x = position, y = coverage, fill = assay_group)) +
- geom_area(show.legend = TRUE) +
- geom_vline(xintercept = 0, linetype = "dashed", color = "red", alpha = 0.7) +
- facet_grid2(assay_group ~ gene_name, switch = "y", scales = "free_x", independent = "x") +
- theme_bw() +
- theme(
- panel.spacing.x = unit(0.2, "mm"),
- panel.spacing.y = unit(-0.1, "mm"),
- axis.text.x = element_text(size = 6),
- axis.text.y = element_blank(),
- axis.title = element_blank(),
- panel.grid = element_blank(),
- strip.background = element_blank(),
- strip.text.y.left = element_text(angle = 0, hjust = 1, size = 7),
- legend.position = "bottom"
- ) +
- scale_fill_manual(values = cols, name = "Mouse Cell Type") +
- labs(caption = "Red dashed line: TSS")
- dev.off()
- }
- mouse_target_genes <- c("Cd3d", "Thy1", "Cd74", "Mitf", "Pecam1", "Tpm1", "Flt4", "Krt5")
- Stack_CoveragePlot(
- object = brain,
- mouse_genes = mouse_target_genes,
- cols = cols,
- extend = 1000
- )
- #Co-accessibility Analysis----
- setwd("~/R/cortex_total/ATAC/coaccessibility_analysis")
- library(Signac)
- library(Seurat)
- library(SeuratWrappers)
- library(ggplot2)
- library(patchwork)
- library(cicero)
- library(monocle3)
- save_monocle_objects(cds = cicero_cds,
- directory_path = "coaccessibility_analysis/",
- comment = "Cicero analysis intermediate results")
- cicero_cds <- load_monocle_objects(directory_path = "coaccessibility_analysis/")
- bone <- readRDS("brain.rds")
- DefaultAssay(bone) <- "peaks"
- bone.cds <- as.cell_data_set(x = bone)
- umap_coords <- reducedDims(bone.cds)$UMAP
- cicero_cds <- make_cicero_cds(bone.cds, reduced_coordinates = umap_coords)
- class(cicero_cds)
- genome <- seqlengths(bone)
- genome.df <- data.frame("chr" = names(genome), "length" = genome)
- conns <- run_cicero(cicero_cds, genomic_coords = genome.df, sample_num = 100)
- saveRDS(conns, "conns.rds")
- conns <- readRDS("conns.rds")
- ccans <- generate_ccans(conns)
- head(ccans)
- links <- ConnectionsToLinks(conns = conns, ccans = ccans)
- Links(bone) <- links
- saveRDS(bone, "~/R/cortex_total/ATAC/filtered_analysis/brain.rds")
- #Network Visualization----
- library(igraph)
- library(ggplot2)
- library(ggraph)
- library(tidygraph)
- group <- unique(ccans[, c(2, 3)])
- network_data <- group[, c("CCAN", "gene")]
- edges <- data.frame()
- unique_ccans <- unique(network_data$CCAN)
- for (ccan in unique_ccans) {
- genes_in_ccan <- network_data$gene[network_data$CCAN == ccan]
- if (length(genes_in_ccan) > 1) {
- gene_pairs <- t(combn(genes_in_ccan, 2))
- edges <- rbind(edges, data.frame(
- from = gene_pairs[, 1],
- to = gene_pairs[, 2],
- CCAN = ccan
- ))
- }
- }
- edges$weight <- 1
- unique_genes <- unique(c(edges$from, edges$to))
- nodes <- data.frame(
- id = 1:length(unique_genes),
- label = unique_genes
- )
- edges <- edges %>%
- left_join(nodes, by = c("from" = "label")) %>%
- rename(from_to = id)
- edges <- edges %>%
- left_join(nodes, by = c("to" = "label")) %>%
- rename(to_to = id)
- edges <- dplyr::select(edges, from_to, to_to, weight)
- net.tidy <- tbl_graph(
- nodes = nodes, edges = edges, directed = F
- )
- net.tidy
- net.tidy <- net.tidy %>%
- dplyr::filter(group_components() == which.max(table(group_components())))
- net_with_centrality <- net.tidy %>%
- activate(nodes) %>%
- mutate(
- degree = centrality_degree(),
- betweenness = centrality_betweenness(),
- closeness = centrality_closeness(),
- pagerank = centrality_pagerank()
- )
- pdf("network.pdf", width = 8, height = 6)
- plasma_colors <- viridis::viridis_pal(option = "plasma")(6)
- ggraph(net_with_centrality, layout = "fr") +
- geom_edge_link(width = 0.3,
- color = "grey70",
- alpha = 0.6, show.legend = FALSE) +
- geom_node_point(aes(size = betweenness, color = betweenness),
- alpha = 0.8) +
- geom_node_text(aes(label = ifelse(betweenness > quantile(betweenness, 0.8), label, "")),
- repel = TRUE, size = 4) +
- scale_size_continuous(range = c(3, 10), name = "Betweenness") +
- scale_color_gradientn(colors = plasma_colors, name = "Betweenness") +
- theme_void() +
- theme(plot.margin = margin(20, 20, 20, 20))
- dev.off()
- important_genes <- net_with_centrality %>%
- as_tibble() %>%
- dplyr::filter(betweenness > quantile(betweenness, 0.8)) %>%
- dplyr::select(label, degree, betweenness, closeness, pagerank) %>%
- arrange(desc(betweenness))
- print(important_genes$label)
- head(important_genes)
- saveRDS(important_genes, "important_genes.rds")
- #Quality Control Metrics----
- head(brain)
- library(ggplot2)
- library(tidyr)
- library(dplyr)
- atac_data_long <- [email hidden] %>%
- dplyr::select(orig.ident, nCount_peaks, TSS.enrichment, pct_reads_in_peaks) %>%
- pivot_longer(
- cols = c(nCount_peaks, TSS.enrichment, pct_reads_in_peaks),
- names_to = "metric",
- values_to = "value"
- )
- metric_labels <- c(
- "nCount_peaks" = "nCount_peaks",
- "TSS.enrichment" = "TSS.enrichment",
- "pct_reads_in_peaks" = "FRiP"
- )
- pdf("ATAC_QC_metrics.pdf", width = 8, height = 3)
- p1 <- ggplot(atac_data_long, aes(x = orig.ident, y = value, fill = orig.ident)) +
- geom_boxplot(outlier.size = 0.5, alpha = 0.9) +
- facet_wrap(~ metric, scales = "free_y", ncol = 3,
- labeller = labeller(metric = metric_labels)) +
- scale_fill_manual(values = colorRampPalette(c("#5F9EA0"))(12)) +
- labs(x = NULL, y = NULL) +
- theme_bw() +
- theme(
- axis.text.x = element_text(angle = 45, hjust = 1),
- axis.title.y = element_blank(),
- legend.position = "none",
- plot.title = element_text(hjust = 0.5),
- panel.grid = element_blank(),
- strip.text = element_text(size = 12)
- )
- print(p1)
- dev.off()
ATAC-code.R, under CC-BY-4.0 · at the source
Overview
- The First Affiliated Hospital of Sun Yat-sen University, Department of Anesthesia, Guangzhou, Guangdong 510080 China
- Department of Thoracic Surgery and Oncology, the First Affiliated Hospital of Guangzhou Medical University, State Key Laboratory of Respiratory Disease & National Clinical Research Center for Respiratory Disease, Guangzhou, 510120 China
- Brain Research Center, Sun Yat-Sen Memorial Hospital, Sun Yat-Sen University, Guangzhou 510120, China, Department of Neurology, Sun Yat-Sen Memorial Hospital, Sun Yat-Sen University, Guangzhou, 510120 China
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 19 matches between paragraphs and lines of code.
figshare 30672836
Availability: 1 check, the latest on 28 September 2026: the link answers (HTTP 200)
- 28 September 2026: the link answers (HTTP 200)
2 files
- ATAC-code.R, R, 603 lines, 10 matches
- RNA-code.R, R, 300 lines, 9 matches
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: figshare 30672836
Read it in the paper: doi.org/10.1038/s41597-026-07185-4.
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;
- 2 scripts, each with its path and the digest of its content;
- 19 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:GSE255405, at NCBI GEO; found in the resources table
Other data links
- ncbi.nlm.nih.gov/
geo , NCBI; found in the text, “RNA-seq data preprocessing and integration”
Data availability statement
The paper has a data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- no repository, dataset or request procedure was recognized in it
Read it in the paper: doi.org/10.1038/s41597-026-07185-4.
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, 28 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 8 authors, 5 MeSH terms, 5 funders, 50 references.
Cite
This paper
Shi, X., Qi, Z., Huang, H., Ye, Z., Wu, Y., Chan, K., Yao, M., & Wang, Z. (2026). A multi-center cross-platform single-cell multimodal atlas of the mouse cerebral cortex. Scientific data, 13(1), 1072. https://
BibTeX
@article{shi2026multi,
author = {Shi, Xuefeng and Qi, Zhihui and Huang, Hong and Ye, Zhiming and Wu, Yumin and Chan, Kahei and Yao, Maojin and Wang, Zhongxing},
title = {{A multi-center cross-platform single-cell multimodal atlas of the mouse cerebral cortex}},
journal = {Scientific data},
year = {2026},
month = may,
volume = {13},
number = {1},
pages = {1072},
publisher = {Nature Publishing Group},
issn = {2052-4463},
doi = {10.1038/
url = {https://
pmid = {42115229},
pmcid = {PMC13381758}
}
RIS
TY - JOUR
AU - Shi, Xuefeng
AU - Qi, Zhihui
AU - Huang, Hong
AU - Ye, Zhiming
AU - Wu, Yumin
AU - Chan, Kahei
AU - Yao, Maojin
AU - Wang, Zhongxing
TI - A multi-center cross-platform single-cell multimodal atlas of the mouse cerebral cortex
T2 - Scientific data
J2 - Sci Data
PY - 2026
DA - 2026/
VL - 13
IS - 1
SP - 1072
SN - 2052-4463
PB - Nature Publishing Group
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"type": "article-journal",
"title": "A multi-center cross-platform single-cell multimodal atlas of the mouse cerebral cortex",
"container-title": "Scientific data",
"author": [
{
"family": "Shi",
"given": "Xuefeng"
},
{
"family": "Qi",
"given": "Zhihui"
},
{
"family": "Huang",
"given": "Hong"
},
{
"family": "Ye",
"given": "Zhiming"
},
{
"family": "Wu",
"given": "Yumin"
},
{
"family": "Chan",
"given": "Kahei"
},
{
"family": "Yao",
"given": "Maojin"
},
{
"family": "Wang",
"given": "Zhongxing"
}
],
"container-title-short":
"volume": "13",
"issue": "1",
"page": "1072",
"DOI": "10.1038/
"PMID": "42115229",
"PMCID": "PMC13381758",
"ISSN": "2052-4463",
"publisher": "Nature Publishing Group",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
11
]
]
}
}
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/s41593-021-01002-4 [code]
- Multimodal profiling of the transcriptional regulatory landscape of the developing mouse cortex identifies Neurog2 as a key epigenome remodeler.Journal: Nature neuroscienceIn common: Monocle 3, Harmony, edgeR, 11 other tools, genetics / omics, mouse, 5 references
- [2] doi:10.1016/j.xcrm.2026.102766 [code]
- A longitudinal single-cell and spatial multiomic atlas of pediatric high-grade glioma.Journal: Cell reports. MedicineIn common: Monocle 3, Harmony, edgeR, 11 other tools, genetics / omics, 5 references
- [3] doi:10.1038/s41467-025-57027-x [code]
- Topological identification and interpretation for single-cell epigenetic regulation elucidation in multi-tasks using scAGDE.Journal: Nature communicationsIn common: Monocle 3, Harmony, edgeR, 11 other tools, genetics / omics, 3 references
- [4] doi:10.1016/j.isci.2022.105279 [code]
- A multi-omics approach to visualize early neuronal differentiation from hESCs in 4D.Journal: iScienceIn common: Harmony, edgeR, circlize, 10 other tools, genetics / omics, 5 references
- [5] doi:10.1038/s41593-026-02367-0 [code]
- A reproducible three-dimensional model of human brain tissue to investigate physiological and disease-associated microglia phenotypes.Journal: Nature neuroscienceIn common: Monocle 3, Harmony, edgeR, 11 other tools, 3 references
- [6] doi:10.1016/j.crmeth.2023.100498 [code]
- hdWGCNA identifies co-expression networks in high-dimensional transcriptomics data.Journal: Cell reports methodsIn common: Monocle 3, Harmony, edgeR, 7 other tools, genetics / omics, 8 references
- [7] doi:10.1038/s41588-024-01961-x [code]
- Spatial and single-nucleus transcriptomic analysis of genetic and sporadic forms of Alzheimer's disease.Journal: Nature geneticsIn common: Monocle 3, Harmony, edgeR, 9 other tools, genetics / omics, mouse, 4 references
- [8] doi:10.1038/s41586-024-08351-7 [code]
- Molecular and cellular dynamics of the developing human neocortex.Journal: NatureIn common: edgeR, circlize, clusterProfiler, 8 other tools, genetics / omics, 6 references
- [9] doi:10.1016/j.isci.2026.114674 [code]
- Single-cell transcriptomics revealed molecular vulnerability in a human midbrain-like organoid model of Parkinson's disease.Journal: iScienceIn common: Monocle 3, Harmony, circlize, 10 other tools, genetics / omics, 3 references
- [10] doi:10.1038/s41587-024-02241-z [code]
- Tracking single-cell evolution using clock-like chromatin accessibility loci.Journal: Nature biotechnologyIn common: Monocle 3, edgeR, circlize, 8 other tools, genetics / omics, mouse, 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, 2 scripts, and 19 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:18f9fb2cde30d75a…
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/s41597-026-07185-4)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1038/s41597-026-07185-4.svg
:target: https://openscicode.org/badge/doi/10.1038/s41597-026-07185-4
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1038/s41597-026-07185-4"><img src="https://openscicode.org/badge/doi/10.1038/s41597-026-07185-4.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->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)
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
