OSCR

A multi-center cross-platform single-cell multimodal atlas of the mouse cerebral cortex.

Code ↔ Paper

19 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 19 matches
  1. [1] § Methods › Gene activity scoring of scATAC-seq data ↔ ATAC-code.R, lines 56–103 · score 0.94 · gene activity matrix, FindTransferAnchors, TransferData, NormalizeData, RunPCA, ScaleData
  2. [2] § Methods › scATAC-seq data processing ↔ ATAC-code.R, lines 1–54 · score 0.94 · peak region fragments, blacklist ratio, FindTopFeatures, min.cutoff, Quality control, SVD
  3. [3] § Methods › Chromatin co-accessibility analysis ↔ ATAC-code.R, lines 443–483 · score 0.89 · generate_ccans, run_cicero, sample_num, co accessibility, target genes, genome
  4. [4] § Methods › RNA-seq data preprocessing and integration ↔ RNA-code.R, lines 48–90 · score 0.89 · LogNormalize, scale.factor, FindVariableFeatures, ScaleData, log normalization, vst
  5. [5] § Methods › RNA-seq data preprocessing and integration ↔ RNA-code.R, lines 92–134 · score 0.81 · min.dist, FindClusters, FindNeighbors, RunUMAP, resolution, dims
  6. [6] § Data Records ↔ RNA-code.R, lines 1–46 · score 0.76 · nCount_RNA, HB_percent, nFeature_RNA, percent.mt, quality control, genes
  7. [7] § Methods › Identification of cell-type-specific regulatory regions ↔ ATAC-code.R, lines 338–391 · score 0.76 · ClosestFeature, CoveragePlot, FindAllMarkers, LR, threshold, assay
  8. [8] § Methods › scATAC-seq cell-type annotation ↔ ATAC-code.R, lines 56–103 · score 0.76 · FindTransferAnchors, TransferData, scRNA, query, prediction, LSI
  9. [9] § Methods › RNA-seq data preprocessing and integration ↔ ATAC-code.R, lines 1–54 · score 0.73 · FindClusters, FindNeighbors, RunUMAP, algorithm, resolution, dims
  10. [10] § Technical Validation ↔ RNA-code.R, lines 1–46 · score 0.71 · nCount_RNA, HB_percent, nFeature_RNA, percent.mt, Quality control, genes
  11. [11] § Data Records ↔ ATAC-code.R, lines 566–603 · score 0.67 · nCount_peaks, orig.ident, TSS enrichment, pct, atac
  12. [12] § Methods › Differential expression and enrichment analysis ↔ RNA-code.R, lines 136–183 · score 0.67 · clusterProfiler, GO terms, db, simplification, mm, enrichment
  13. [13] § Technical Validation ↔ ATAC-code.R, lines 240–272 · score 0.60 · microglial cells, inhibitory neurons, excitatory neurons, astrocytes, oligodendrocytes
  14. [14] § Methods › RNA-seq data preprocessing and integration ↔ RNA-code.R, lines 48–90 · score 0.59 · RunPCA, Harmony integration, Elbow, variable, RNA, cell
  15. [15] § Technical Validation ↔ RNA-code.R, lines 244–300 · score 0.57 · inhibitory neurons, excitatory neurons, divergence, evolutionary, humans, species
  16. [16] § Technical Validation ↔ ATAC-code.R, lines 240–272 · score 0.55 · oligodendrocyte precursor cells, excitatory neurons, probability, inhibitory, astrocytes
  17. [17] § Methods › scATAC-seq cell-type annotation ↔ ATAC-code.R, lines 206–238 · score 0.55 · probability matrix, annotation transition, row, Dropsn, Dropsc
  18. [18] § Technical Validation ↔ RNA-code.R, lines 244–300 · score 0.53 · inhibitory neurons, excitatory neurons, classic, species, astrocytes, oligodendrocytes
  19. [19] § Methods › Cell type annotation and cross-dataset cross-validation ↔ RNA-code.R, lines 136–183 · score 0.51 · AggregateExpression, CPM, enriched, assay, matrices, RNA

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: 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

  1. #Quality Control----
  2. brain <- NucleosomeSignal(object = brain)
  3. head(brain)
  4. brain$nucleosome_group <- ifelse(brain$nucleosome_signal > 4, 'NS > 4', 'NS < 4')
  5. FragmentHistogram(object = brain, group.by = 'nucleosome_group', region = 'chr1-1-10000000')
  6. brain <- TSSEnrichment(brain)
  7. head(brain)
  8. brain$pct_reads_in_peaks <- brain$peak_region_fragments / brain$passed_filters * 100
  9. brain$blacklist_ratio <- brain$blacklist_region_fragments / brain$peak_region_fragments
  10. VlnPlot(
  11. object = brain,
  12. features = c('pct_reads_in_peaks', 'peak_region_fragments',
  13. 'TSS.enrichment', 'blacklist_ratio', 'nucleosome_signal'),
  14. pt.size = 0.1,
  15. ncol = 5
  16. )
  17. brain <- subset(
  18. x = brain,
  19. subset =
  20. peak_region_fragments > 3000 &
  21. peak_region_fragments < 100000 &
  22. pct_reads_in_peaks > 40 &
  23. blacklist_ratio < 0.025
  24. )
  25. #Normalization----
  26. brain <- RunTFIDF(brain)
  27. brain <- FindTopFeatures(brain, min.cutoff = 'q0')
  28. brain <- RunSVD(object = brain)
  29. pdf("LSI_component.pdf")
  30. DepthCor(brain)
  31. dev.off()
  32. #Clustering----
  33. brain <- RunUMAP(
  34. object = brain,
  35. reduction = 'lsi',
  36. dims = 2:30
  37. )
  38. brain <- FindNeighbors(
  39. object = brain,
  40. reduction = 'lsi',
  41. dims = 2:30
  42. )
  43. brain <- FindClusters(
  44. object = brain,
  45. algorithm = 3,
  46. resolution = 1.2,
  47. verbose = FALSE
  48. )
  49. DimPlot(object = brain, label = TRUE) + NoLegend()
  50. #Create Gene Activity Matrix----
  51. DefaultAssay(brain) <- "peaks"
  52. gene.activities <- GeneActivity(brain, features = VariableFeatures(pbmc.rna))
  53. brain[['RNA']] <- CreateAssayObject(counts = gene.activities)
  54. DefaultAssay(brain) <- 'RNA'
  55. brain <- NormalizeData(
  56. object = brain,
  57. assay = 'RNA',
  58. )
  59. brain <- FindVariableFeatures(brain, selection.method = "vst", nfeatures = 2000)
  60. brain <- ScaleData(brain, features = rownames(brain))
  61. brain <- RunPCA(brain)
  62. FeaturePlot(
  63. object = brain,
  64. features = c('Sst','Pvalb',"Gad2","Neurod6","Rorb","Syt6"),
  65. pt.size = 0.1,
  66. max.cutoff = 'q95',
  67. ncol = 3
  68. )
  69. #scRNA-seq Annotation----
  70. setwd("~/R/cortex_total/dropsc")
  71. setwd("~/R/cortex_total/ATAC")
  72. pbmc.rna <- readRDS("merge_scRNAlist.rds")
  73. table(pbmc.rna$sub.cluster)
  74. p1 <- DimPlot(pbmc.rna, group.by = "sub.cluster", label = TRUE) + NoLegend() + ggtitle("RNA")
  75. p2 <- DimPlot(brain, group.by = "orig.ident", label = FALSE) + NoLegend() + ggtitle("ATAC")
  76. p1 + p2
  77. DefaultAssay(brain) <- "RNA"
  78. transfer.anchors <- FindTransferAnchors(reference = pbmc.rna,
  79. query = brain,
  80. reference.reduction = "pca",
  81. dims = 1:30)
  82. predicted.labels <- TransferData(
  83. anchorset = transfer.anchors,
  84. refdata = pbmc.rna$sub.cluster,
  85. weight.reduction = brain[["lsi"]],
  86. dims = 2:30
  87. )
  88. brain <- AddMetaData(object = brain, metadata = predicted.labels)
  89. table(brain$predicted.id)
  90. brain$'dropsc' <- brain$predicted.id
  91. head(brain)
  92. table(brain$'10xsc', brain$dropsn, brain$'10xsn')
  93. #Filtering----
  94. Idents(brain) = "dropsc"
  95. brain <- subset(brain, idents = setdiff(unique(Idents(brain)), c("Pericytes","endothelial cells")))
  96. #Save Data----
  97. setwd("~/R/cortex_total/ATAC/filtered_analysis")
  98. setwd("~/R/cortex_total/ATAC")
  99. brain <- readRDS("brain.rds")
  100. saveRDS(brain, "brain.rds")
  101. #Annotation Comparison Plot----
  102. data <- data.frame(
  103. dropsn = brain$dropsn,
  104. dropsc = brain$dropsc,
  105. X10xsc = brain$`10xsc`,
  106. X10xsn = brain$`10xsn`,
  107. brain@reductions$[email hidden]
  108. )
  109. head(data)
  110. library(ggplot2)
  111. library(ggforce)
  112. library(dplyr)
  113. library(tidyr)
  114. library(patchwork)
  115. library(ggsci)
  116. methods <- c("dropsn","dropsc","X10xsc","X10xsn")
  117. all_celltypes <- unique(unlist(data[c("dropsn", "dropsc", "X10xsc", "X10xsn")]))
  118. color_palette <- viridis::viridis_pal(option = "plasma")(length(all_celltypes))
  119. names(color_palette) <- all_celltypes
  120. plots <- list()
  121. for (method in methods) {
  122. method_data <- data %>%
  123. mutate(cell_id = rownames(data)) %>%
  124. select(umap_1, umap_2, celltype = !!method, cell_id)
  125. method_centroids <- method_data %>%
  126. group_by(celltype) %>%
  127. summarise(
  128. centroid_x = median(umap_1),
  129. centroid_y = median(umap_2),
  130. .groups = "drop"
  131. )
  132. other_annotations <- data %>%
  133. mutate(cell_id = rownames(data)) %>%
  134. select(cell_id, all_of(methods)) %>%
  135. pivot_longer(cols = -cell_id, names_to = "annotation_method", values_to = "annotated_celltype") %>%
  136. filter(annotation_method != method)
  137. conflict_data <- method_data %>%
  138. left_join(other_annotations, by = "cell_id") %>%
  139. filter(celltype != annotated_celltype)
  140. sample_size_per_group <- conflict_data %>%
  141. group_by(annotated_celltype) %>%
  142. summarise(n = n(), .groups = "drop") %>%
  143. mutate(sample_n = pmin(100, n))
  144. connection_data <- conflict_data %>%
  145. group_by(annotated_celltype) %>%
  146. sample_n(size = min(100, n()), replace = FALSE) %>%
  147. ungroup() %>%
  148. left_join(method_centroids, by = c("annotated_celltype" = "celltype"))
  149. p <- ggplot() +
  150. geom_point(
  151. data = method_data,
  152. aes(x = umap_1, y = umap_2, color = celltype),
  153. size = 0.4, alpha = 0.6
  154. ) +
  155. geom_segment(
  156. data = connection_data,
  157. aes(x = umap_1, y = umap_2,
  158. xend = centroid_x, yend = centroid_y,
  159. color = annotated_celltype),
  160. linewidth = 0.3, alpha = 0.5
  161. ) +
  162. geom_point(
  163. data = method_centroids,
  164. aes(x = centroid_x, y = centroid_y, fill = celltype),
  165. shape = 23, size = 4, color = "black", stroke = 0.8
  166. ) +
  167. scale_color_manual(values = color_palette, name = "Celltype") +
  168. scale_fill_manual(values = color_palette, name = "Celltype") +
  169. labs(title = paste("Method:", method)) +
  170. theme_void() +
  171. theme(
  172. plot.title = element_text(hjust = 0.5, face = "bold")
  173. )
  174. plots[[method]] <- p
  175. }
  176. pdf("annotation_comparison.pdf", width = 16, height = 12)
  177. combined_plot <- plots[[1]] + plots[[2]] + plots[[3]] + plots[[4]] +
  178. plot_layout(ncol = 2, guides = "collect") +
  179. plot_annotation(theme = theme(plot.title = element_text(hjust = 0.5, face = "bold")))
  180. print(combined_plot)
  181. dev.off()
  182. #Probability Matrix----
  183. calculate_annotation_transition_matrix <- function(data) {
  184. methods <- c("dropsn", "dropsc", "X10xsc", "X10xsn")
  185. all_celltypes <- unique(unlist(data[methods]))
  186. transition_matrix <- matrix(0, nrow = length(all_celltypes), ncol = length(all_celltypes))
  187. rownames(transition_matrix) <- all_celltypes
  188. colnames(transition_matrix) <- all_celltypes
  189. data$true_celltype <- apply(data[methods], 1, function(x) {
  190. tbl <- table(x)
  191. names(tbl)[which.max(tbl)]
  192. })
  193. for (i in 1:nrow(data)) {
  194. true_type <- data$true_celltype[i]
  195. annotations <- unlist(data[i, methods])
  196. annotation_counts <- table(annotations)
  197. for (annotated_type in names(annotation_counts)) {
  198. if (annotated_type %in% all_celltypes) {
  199. transition_matrix[true_type, annotated_type] <- transition_matrix[true_type, annotated_type] + annotation_counts[annotated_type]
  200. }
  201. }
  202. }
  203. probability_matrix <- transition_matrix / rowSums(transition_matrix)
  204. return(list(
  205. count_matrix = transition_matrix,
  206. probability_matrix = probability_matrix
  207. ))
  208. }
  209. transition_results <- calculate_annotation_transition_matrix(data)
  210. transition_results[[2]]
  211. library(ComplexHeatmap)
  212. library(circlize)
  213. prob_matrix <- transition_results[[2]]
  214. new_order <- c("Excitatory neurons", "Inhibitory neurons",
  215. "Astrocytes", "Oligodendrocytes", "Oligodendrocyte Precursor Cells",
  216. "Microglial cells")
  217. prob_matrix <- prob_matrix[new_order, new_order]
  218. col_fun <- colorRamp2(c(0, 0.5, 1), viridis::viridis_pal(option = "plasma")(3))
  219. pdf("probability_heatmap.pdf")
  220. Heatmap(prob_matrix,
  221. name = "probability",
  222. col = col_fun,
  223. cluster_rows = F,
  224. cluster_columns = F,
  225. row_names_side = "left",
  226. column_names_side = "top",
  227. row_names_gp = gpar(fontsize = 10),
  228. column_names_gp = gpar(fontsize = 10),
  229. cell_fun = function(j, i, x, y, width, height, fill) {
  230. if(prob_matrix[i, j] >= 0.01) {
  231. grid.text(sprintf("%.1f%%", prob_matrix[i, j] * 100), x, y,
  232. gp = gpar(fontsize = 8))
  233. }
  234. },
  235. heatmap_legend_param = list(legend_height = unit(4, "cm")),
  236. column_title_side = "bottom")
  237. dev.off()
  238. #UMAP Visualization----
  239. library(Seurat)
  240. library(tidyverse)
  241. library(ggrepel)
  242. library(scattermore)
  243. pbmc <- brain
  244. head([email hidden])
  245. dim(pbmc)
  246. umap = pbmc@reductions$[email hidden] %>%
  247. as.data.frame() %>%
  248. cbind(cell_type = [email hidden]$final_annotation)
  249. umap$UMAP_1 <- umap$umap_1
  250. umap$UMAP_2 <- umap$umap_2
  251. allcolour = viridis::viridis_pal(option = "plasma")(6)
  252. p <- ggplot(umap, aes(x = UMAP_1, y = UMAP_2, color = cell_type)) +
  253. geom_point(size = 0.1, alpha = 1) + scale_color_manual(values = allcolour)
  254. p2 <- p +
  255. theme(panel.grid.major = element_blank(),
  256. panel.grid.minor = element_blank(),
  257. panel.border = element_blank(),
  258. axis.title = element_blank(),
  259. axis.text = element_blank(),
  260. axis.ticks = element_blank(),
  261. panel.background = element_rect(fill = 'white'),
  262. plot.background = element_rect(fill = "white"))
  263. p3 <- p2 +
  264. theme(
  265. legend.title = element_blank(),
  266. legend.key = element_rect(fill = 'white'),
  267. legend.text = element_text(size = 20),
  268. legend.key.size = unit(1, 'cm')
  269. ) +
  270. guides(color = guide_legend(override.aes = list(size = 5)))
  271. p4 <- p3 +
  272. geom_segment(aes(x = min(umap$UMAP_1), y = min(umap$UMAP_2),
  273. xend = min(umap$UMAP_1) + 3, yend = min(umap$UMAP_2)),
  274. colour = "black", size = 1, arrow = arrow(length = unit(0.3, "cm"))) +
  275. geom_segment(aes(x = min(umap$UMAP_1), y = min(umap$UMAP_2),
  276. xend = min(umap$UMAP_1), yend = min(umap$UMAP_2) + 3),
  277. colour = "black", size = 1, arrow = arrow(length = unit(0.3, "cm"))) +
  278. annotate("text", x = min(umap$UMAP_1) + 1.5, y = min(umap$UMAP_2) - 1, label = "UMAP_1",
  279. color = "black", size = 3, fontface = "bold") +
  280. annotate("text", x = min(umap$UMAP_1) - 1, y = min(umap$UMAP_2) + 1.5, label = "UMAP_2",
  281. color = "black", size = 3, fontface = "bold", angle = 90) +
  282. theme(legend.position = "none")
  283. cell_type_med <- aggregate(cbind(UMAP_1, UMAP_2) ~ cell_type,
  284. data = umap,
  285. FUN = median)
  286. p5 <- p3 +
  287. geom_label_repel(aes(label = cell_type), fontface = "bold", data = cell_type_med, size = 2,
  288. point.padding = unit(0.5, "lines")) +
  289. theme(legend.position = "none")
  290. pdf("umap_cell.pdf", width = 5, height = 5)
  291. p5
  292. dev.off()
  293. #Specific Gene Peak Visualization----
  294. library(ArchR)
  295. library(reshape2)
  296. head(brain)
  297. Idents(brain) <- "final_annotation"
  298. idents.plot <- names(which(table(Idents(brain)) > 50))
  299. brain <- SortIdents(brain)
  300. DefaultAssay(brain) <- "peaks"
  301. pdf("gene_peaks.pdf")
  302. CoveragePlot(
  303. object = brain,
  304. region = c("Neurod6", "Gad2"),
  305. idents = idents.plot,
  306. extend.upstream = 1000,
  307. extend.downstream = 1000,
  308. ncol = 1)
  309. dev.off()
  310. #Differentially Accessible Regions Analysis----
  311. DefaultAssay(brain) <- "peaks"
  312. Idents(brain) <- "predicted.id"
  313. cellType_DARs <- FindAllMarkers(
  314. object = brain,
  315. test.use = "LR",
  316. logfc.threshold = 0.25,
  317. min.pct = 0.25,
  318. verbose = FALSE
  319. )
  320. head(cellType_DARs)
  321. cellType_DARs <- cellType_DARs %>%
  322. dplyr::filter(p_val_adj <= 0.05 | avg_log2FC > 0.8) %>%
  323. dplyr::group_by(cluster) %>%
  324. dplyr::top_n(n = 100, wt = avg_log2FC) %>%
  325. dplyr::ungroup()
  326. cellType_DARs$peak_id <- rownames(cellType_DARs)
  327. cf <- ClosestFeature(
  328. object = brain,
  329. regions = cellType_DARs$peak_id
  330. )
  331. cellType_DARs <- cellType_DARs %>%
  332. left_join(
  333. dplyr::select(as.data.frame(cf), peak_id = query_region, gene_name, gene_biotype, type, distance),
  334. by = "peak_id"
  335. )
  336. cat("Significant DARs by cell type:", nrow(cellType_DARs), "\n")
  337. #Gene Average Accessibility Heatmap----
  338. library(ggh4x)
  339. mouse_genes <- unique(cellType_DARs$gene_name)[1]
  340. object <- brain
  341. Stack_CoveragePlot <- function(object, mouse_genes, cols, extend = 1000) {
  342. gene_peaks <- cellType_DARs %>%
  343. dplyr::filter(gene_name %in% mouse_genes) %>%
  344. dplyr::group_by(gene_name) %>%
  345. top_n(1, wt = avg_log2FC) %>%
  346. pull(peak_id)
  347. p_list <- lapply(gene_peaks, function(p) {
  348. CoveragePlot(
  349. object = object,
  350. region = p,
  351. extend.upstream = extend,
  352. extend.downstream = extend,
  353. group.by = "predicted.id",
  354. cols = cols,
  355. verbose = FALSE,
  356. annotation = FALSE,
  357. peaks = FALSE
  358. )[[1]]$data %>%
  359. mutate(peak = p)
  360. })
  361. df <- do.call(rbind, p_list)
  362. df <- df %>%
  363. left_join(
  364. dplyr::select(cellType_DARs, peak = peak_id, gene_name),
  365. by = "peak"
  366. )
  367. pdf("stack_coverage.pdf")
  368. ggplot(df, aes(x = position, y = coverage, fill = assay_group)) +
  369. geom_area(show.legend = TRUE) +
  370. geom_vline(xintercept = 0, linetype = "dashed", color = "red", alpha = 0.7) +
  371. facet_grid2(assay_group ~ gene_name, switch = "y", scales = "free_x", independent = "x") +
  372. theme_bw() +
  373. theme(
  374. panel.spacing.x = unit(0.2, "mm"),
  375. panel.spacing.y = unit(-0.1, "mm"),
  376. axis.text.x = element_text(size = 6),
  377. axis.text.y = element_blank(),
  378. axis.title = element_blank(),
  379. panel.grid = element_blank(),
  380. strip.background = element_blank(),
  381. strip.text.y.left = element_text(angle = 0, hjust = 1, size = 7),
  382. legend.position = "bottom"
  383. ) +
  384. scale_fill_manual(values = cols, name = "Mouse Cell Type") +
  385. labs(caption = "Red dashed line: TSS")
  386. dev.off()
  387. }
  388. mouse_target_genes <- c("Cd3d", "Thy1", "Cd74", "Mitf", "Pecam1", "Tpm1", "Flt4", "Krt5")
  389. Stack_CoveragePlot(
  390. object = brain,
  391. mouse_genes = mouse_target_genes,
  392. cols = cols,
  393. extend = 1000
  394. )
  395. #Co-accessibility Analysis----
  396. setwd("~/R/cortex_total/ATAC/coaccessibility_analysis")
  397. library(Signac)
  398. library(Seurat)
  399. library(SeuratWrappers)
  400. library(ggplot2)
  401. library(patchwork)
  402. library(cicero)
  403. library(monocle3)
  404. save_monocle_objects(cds = cicero_cds,
  405. directory_path = "coaccessibility_analysis/",
  406. comment = "Cicero analysis intermediate results")
  407. cicero_cds <- load_monocle_objects(directory_path = "coaccessibility_analysis/")
  408. bone <- readRDS("brain.rds")
  409. DefaultAssay(bone) <- "peaks"
  410. bone.cds <- as.cell_data_set(x = bone)
  411. umap_coords <- reducedDims(bone.cds)$UMAP
  412. cicero_cds <- make_cicero_cds(bone.cds, reduced_coordinates = umap_coords)
  413. class(cicero_cds)
  414. genome <- seqlengths(bone)
  415. genome.df <- data.frame("chr" = names(genome), "length" = genome)
  416. conns <- run_cicero(cicero_cds, genomic_coords = genome.df, sample_num = 100)
  417. saveRDS(conns, "conns.rds")
  418. conns <- readRDS("conns.rds")
  419. ccans <- generate_ccans(conns)
  420. head(ccans)
  421. links <- ConnectionsToLinks(conns = conns, ccans = ccans)
  422. Links(bone) <- links
  423. saveRDS(bone, "~/R/cortex_total/ATAC/filtered_analysis/brain.rds")
  424. #Network Visualization----
  425. library(igraph)
  426. library(ggplot2)
  427. library(ggraph)
  428. library(tidygraph)
  429. group <- unique(ccans[, c(2, 3)])
  430. network_data <- group[, c("CCAN", "gene")]
  431. edges <- data.frame()
  432. unique_ccans <- unique(network_data$CCAN)
  433. for (ccan in unique_ccans) {
  434. genes_in_ccan <- network_data$gene[network_data$CCAN == ccan]
  435. if (length(genes_in_ccan) > 1) {
  436. gene_pairs <- t(combn(genes_in_ccan, 2))
  437. edges <- rbind(edges, data.frame(
  438. from = gene_pairs[, 1],
  439. to = gene_pairs[, 2],
  440. CCAN = ccan
  441. ))
  442. }
  443. }
  444. edges$weight <- 1
  445. unique_genes <- unique(c(edges$from, edges$to))
  446. nodes <- data.frame(
  447. id = 1:length(unique_genes),
  448. label = unique_genes
  449. )
  450. edges <- edges %>%
  451. left_join(nodes, by = c("from" = "label")) %>%
  452. rename(from_to = id)
  453. edges <- edges %>%
  454. left_join(nodes, by = c("to" = "label")) %>%
  455. rename(to_to = id)
  456. edges <- dplyr::select(edges, from_to, to_to, weight)
  457. net.tidy <- tbl_graph(
  458. nodes = nodes, edges = edges, directed = F
  459. )
  460. net.tidy
  461. net.tidy <- net.tidy %>%
  462. dplyr::filter(group_components() == which.max(table(group_components())))
  463. net_with_centrality <- net.tidy %>%
  464. activate(nodes) %>%
  465. mutate(
  466. degree = centrality_degree(),
  467. betweenness = centrality_betweenness(),
  468. closeness = centrality_closeness(),
  469. pagerank = centrality_pagerank()
  470. )
  471. pdf("network.pdf", width = 8, height = 6)
  472. plasma_colors <- viridis::viridis_pal(option = "plasma")(6)
  473. ggraph(net_with_centrality, layout = "fr") +
  474. geom_edge_link(width = 0.3,
  475. color = "grey70",
  476. alpha = 0.6, show.legend = FALSE) +
  477. geom_node_point(aes(size = betweenness, color = betweenness),
  478. alpha = 0.8) +
  479. geom_node_text(aes(label = ifelse(betweenness > quantile(betweenness, 0.8), label, "")),
  480. repel = TRUE, size = 4) +
  481. scale_size_continuous(range = c(3, 10), name = "Betweenness") +
  482. scale_color_gradientn(colors = plasma_colors, name = "Betweenness") +
  483. theme_void() +
  484. theme(plot.margin = margin(20, 20, 20, 20))
  485. dev.off()
  486. important_genes <- net_with_centrality %>%
  487. as_tibble() %>%
  488. dplyr::filter(betweenness > quantile(betweenness, 0.8)) %>%
  489. dplyr::select(label, degree, betweenness, closeness, pagerank) %>%
  490. arrange(desc(betweenness))
  491. print(important_genes$label)
  492. head(important_genes)
  493. saveRDS(important_genes, "important_genes.rds")
  494. #Quality Control Metrics----
  495. head(brain)
  496. library(ggplot2)
  497. library(tidyr)
  498. library(dplyr)
  499. atac_data_long <- [email hidden] %>%
  500. dplyr::select(orig.ident, nCount_peaks, TSS.enrichment, pct_reads_in_peaks) %>%
  501. pivot_longer(
  502. cols = c(nCount_peaks, TSS.enrichment, pct_reads_in_peaks),
  503. names_to = "metric",
  504. values_to = "value"
  505. )
  506. metric_labels <- c(
  507. "nCount_peaks" = "nCount_peaks",
  508. "TSS.enrichment" = "TSS.enrichment",
  509. "pct_reads_in_peaks" = "FRiP"
  510. )
  511. pdf("ATAC_QC_metrics.pdf", width = 8, height = 3)
  512. p1 <- ggplot(atac_data_long, aes(x = orig.ident, y = value, fill = orig.ident)) +
  513. geom_boxplot(outlier.size = 0.5, alpha = 0.9) +
  514. facet_wrap(~ metric, scales = "free_y", ncol = 3,
  515. labeller = labeller(metric = metric_labels)) +
  516. scale_fill_manual(values = colorRampPalette(c("#5F9EA0"))(12)) +
  517. labs(x = NULL, y = NULL) +
  518. theme_bw() +
  519. theme(
  520. axis.text.x = element_text(angle = 45, hjust = 1),
  521. axis.title.y = element_blank(),
  522. legend.position = "none",
  523. plot.title = element_text(hjust = 0.5),
  524. panel.grid = element_blank(),
  525. strip.text = element_text(size = 12)
  526. )
  527. print(p1)
  528. dev.off()

ATAC-code.R, under CC-BY-4.0 · at the source

Overview

Authors: Xuefeng Shi1, Zhihui Qi1, Hong Huang2, Zhiming Ye2, Yumin Wu1, Kahei Chan1, Maojin Yao3, Zhongxing Wang1
  1. The First Affiliated Hospital of Sun Yat-sen University, Department of Anesthesia, Guangzhou, Guangdong 510080 China
  2. 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
  3. 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
Journal: Scientific data, volume 13, issue 1, article 1072
Dates: received 24 November 2025; accepted 31 March 2026; published online 11 May 2026
Type: Data paper · Language: English
License: CC BY-NC-ND
Identifiers: DOI 10.1038/s41597-026-07185-4 · PMID 42115229 · PMCID PMC13381758 · OpenAlex W7160844135
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: genetics / omics (modality), mouse (organism), methods / tools (subfield)
Methods: Statistics, Smoothing, state filtering, decompositions, Machine learning, Graphs, Spectral & time-frequency
MeSH: Cerebral Cortex*, Single-Cell Analysis*, Animals, Mice, Sequence Analysis, RNA (* major topic)
Topic: Single-cell and spatial transcriptomics (Molecular Biology, Biochemistry, Genetics and Molecular Biology), according to OpenAlex
Funding: the Basic and Applied Basic Research Foundation of Guangdong Province (Grant Nos. 2021A1515220042); National Natural Science Foundation of China (Grant Nos.82272224); Guangzhou National Laboratory - State Key Laboratory of Respiratory Disease (Guangzhou Medical University) Joint Funding Project 2024, "Study on the Mechanisms and Intervention Strategies for Small Cell Lung Cancer Development", Project No. GZNL2024B01004 (Grant Nos.GZNL2024B01004); National Natural Science Foundation of China, General Program, "Mechanism of Airway GFAP+ Glial Cells in Promoting Epithelial Barrier Repair Following Viral Infection" (Grant Nos.32470888); Natural Science Foundation of Guangdong Province (Grant Nos. 2022A1515012475)
Citations: cited by 1 paper (Europe PMC); 51 references in the paper

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

License: CC-BY-4.0
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Languages: R (2)
Size: 8 files, 2 scripts
Software Heritage: not checked
Found in: “Code availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: circlize (2 files), ComplexHeatmap (2 files), ggplot2 (2 files), patchwork (2 files), Seurat (2 files), tidyverse (2 files), clusterProfiler (1 file), cowplot (1 file), data.table (1 file), edgeR (1 file), Harmony (1 file), igraph (1 file), Monocle 3 (1 file), reshape2 (1 file)
Availability: 1 check, the latest on 28 September 2026: the link answers (HTTP 200)
  • 28 September 2026: the link answers (HTTP 200)
2 files
At the source:

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

Other data links

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://doi.org/10.1038/s41597-026-07185-4

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/s41597-026-07185-4},
url = {https://doi.org/10.1038/s41597-026-07185-4},
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/05/11
VL - 13
IS - 1
SP - 1072
SN - 2052-4463
PB - Nature Publishing Group
DO - 10.1038/s41597-026-07185-4
UR - https://doi.org/10.1038/s41597-026-07185-4
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41597-026-07185-4",
"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": "Sci Data",
"volume": "13",
"issue": "1",
"page": "1072",
"DOI": "10.1038/s41597-026-07185-4",
"PMID": "42115229",
"PMCID": "PMC13381758",
"ISSN": "2052-4463",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41597-026-07185-4",
"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.1016/j.xcrm.2026.102766 [code]
A longitudinal single-cell and spatial multiomic atlas of pediatric high-grade glioma.
Journal: Cell reports. Medicine
In common: Monocle 3, Harmony, edgeR, 11 other tools, genetics / omics, 5 references
[2] 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 neuroscience
In common: Monocle 3, Harmony, edgeR, 11 other tools, 3 references
[3] doi:10.1002/imt2.70163 [code]
Spatial multi-omics unveils sphingolipid metabolic reprogramming within the retinal pathological niche.
Journal: iMeta
In common: Monocle 3, Harmony, edgeR, 11 other tools, genetics / omics, mouse
[4] doi:10.1038/s41586-026-10214-2 [code]
Multidimensional profiling of heterogeneity in supratentorial ependymomas.
Journal: Nature
In common: Monocle 3, Harmony, edgeR, 11 other tools, genetics / omics, mouse
[5] doi:10.1101/gr.281113.125 [code]
Single-nucleus multiomic profiling of the aging mouse substantia nigra reveals conserved gene alterations linked to Parkinson's disease.
Journal: Genome research
In common: Monocle 3, edgeR, circlize, 9 other tools, genetics / omics, mouse, 2 references
[6] doi:10.1073/pnas.2523130123 [code]
FABP7 controls radial glial scaffold stability during human cortical development.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: Harmony, edgeR, igraph, 10 other tools, mouse, 1 reference
[7] doi:10.1038/s41398-026-04200-5 [code]
Postmortem brain single-nucleus and bulk gene expression analyses identify shared and distinct abnormalities in bipolar disorder and major depressive disorder.
Journal: Translational psychiatry
In common: Harmony, edgeR, igraph, 8 other tools, genetics / omics, 4 references
[8] doi:10.1038/s41467-026-69944-6 [code]
Multi-modal dissection of cell-type specific TDP-43 pathology in the motor cortex.
Journal: Nature communications
In common: Monocle 3, igraph, circlize, 8 other tools, genetics / omics, 3 references
[9] doi:10.1038/s41380-026-03629-w [code]
Maternal fasting during early gestation induces epigenetic alterations and schizophrenia-related phenotypes.
Journal: Molecular psychiatry
In common: Harmony, igraph, circlize, 8 other tools, genetics / omics, mouse, 3 references
[10] doi:10.1186/s12967-026-08266-z [code]
Single-cell multi-omic integration analysis prioritizes druggable genes and reveals cell-type-specific causal effects in glioblastomagenesis.
Journal: Journal of translational medicine
In common: Monocle 3, edgeR, igraph, 10 other tools, genetics / omics

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.

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: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.