OSCR

Expanding canonical cortical cell type markers in the era of single-cell transcriptomics.

Code ↔ Paper

15 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 15 matches · 5 of them tie a paragraph to a whole file, not to given lines: weak matches, whose lines are not tinted
  1. [1] § Methods › Marker validation methods/generalizability › Single-cell leave-one-out clustering cross validation ↔ validation_scripts/LOO_cluster_subtype_dlPFC_canonical.R, the whole file · a weak match · score 0.93 · collapse duplicate edges, cluster_louvain, adjustedRandIndex, community detection, igraph, membership
  2. [2] § Methods › Marker validation methods/generalizability › Single-cell leave-one-out clustering cross validation ↔ validation_scripts/LOO_cluster_subtype_dlPFC_putative.R, the whole file · a weak match · score 0.93 · collapse duplicate edges, cluster_louvain, adjustedRandIndex, community detection, igraph, membership
  3. [3] § Methods › Adjusted rand index ↔ Figure 1/Figure - 1A - plot - canonical DESeq2 heatmap.Rmd, lines 150–173 · score 0.86 · ward.D2, adjustedRandIndex, distance matrix, matrix columns, cutree, euclidean
  4. [4] § Methods › Adjusted rand index ↔ Figure 2 - Putative Marker Facts/Figure - 2B, D.Rmd, lines 111–136 · score 0.84 · ward.D2, adjustedRandIndex, distance matrix, matrix columns, cutree, euclidean
  5. [5] § Methods › Gene-Ontology enrichment ↔ Figure 3 - Validations/Figure 3C - Markerlist GO analysis.Rmd, lines 16–72 · score 0.83 · enrichGO, pvalueCutoff, qvalueCutoff, Biological Processes, Ontology, enrichment
  6. [6] § Results › Regional variability of canonical cell type marker expression in the human brain ↔ CortexMapper V4/app.R, lines 2–76 · score 0.75 · CAMK2A, SLC1A2, SLC4A4, excitatory neurons, inhibitory neuron, MBP
  7. [7] § Methods › Single-cell leave-one-out classification cross validation ↔ validation_scripts/LOO_classification_canonical.R, lines 43–117 · score 0.73 · cv.glmnet, macro F1, logistic, lambda, precision, recall
  8. [8] § Results › Regional variability of canonical cell type marker expression in the human brain ↔ Figure 1/Step - 0.1. canonical marker hash generator.R, the whole file · a weak match · score 0.73 · APBB1IP, CSF1R, SLC4A4, AIF1, AQP4, MOG
  9. [9] § Results › Regional variability of canonical cell type marker expression in the human brain ↔ Figure 1/Step - 0.1. canonical marker hash generator.R, the whole file · a weak match · score 0.72 · SLC1A2, SLC4A4, CAMK2A, MBP, PCDH15, PLP1
  10. [10] § Results › Regional variability of canonical cell type marker expression in the human brain ↔ CortexMapper V4/app.R, lines 2–76 · score 0.68 · APBB1IP, CSF1R, SLC4A4, AQP4, PDGFRA, AIF1
  11. [11] § Methods › Single-cell leave-one-out classification cross validation ↔ validation_scripts/LOO_classification_dlPFC_canonical.R, the whole file · a weak match · score 0.66 · cv.glmnet, macro F1, lambda, multinomial, classify, predict
  12. [12] § Results › Calculated marker set is generalizable across regions in classification and clustering tasks ↔ validation_scripts/LOO_classification_canonical.R, lines 43–117 · score 0.66 · multinomial logistic, macro F1, precision, recall, class, held
  13. [13] § Results › Calculated marker set is generalizable across regions in classification and clustering tasks ↔ validation_scripts/LOO_classification_putative.R, lines 1–56 · score 0.54 · multinomial logistic, macro F1, classification, trained, accuracy, validated
  14. [14] § Methods › Pseudo-bulk DE marker list generation framework › Global Cohen distance calculation ↔ CortexMapper V4/app.R, lines 157–216 · score 0.52 · Cohen distance, background thresholds, filtering, fidelity, metrics, canonical
  15. [15] § Methods › Pseudo-bulk DE marker list generation framework › Global Cohen distance calculation ↔ Figure 2 - Putative Marker Facts/baseline.R, lines 103–188 · score 0.52 · background thresholds, log2FoldChange, Cohen, filtering, global, fidelity

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 · 594 lines · 20 KB · no license · 3 matches

  1. options(shiny.fullstacktrace = TRUE)
  2. options(shiny.maxRequestSize = 160*1024^2)
  3. options(shiny.error = traceback)
  4. suppressMessages(suppressWarnings(library(data.table)))
  5. suppressMessages(suppressWarnings(library(RColorBrewer)))
  6. suppressMessages(suppressWarnings(library(mclust)))
  7. suppressMessages(suppressWarnings(library(cluster)))
  8. suppressMessages(suppressWarnings(library(dendextend)))
  9. suppressMessages(suppressWarnings(library(Matrix)))
  10. suppressMessages(suppressWarnings(library(pheatmap)))
  11. suppressMessages(suppressWarnings(library(DT)))
  12. suppressMessages(suppressWarnings(library(Seurat)))
  13. suppressMessages(suppressWarnings(library(readxl)))
  14. suppressMessages(suppressWarnings(library(grid)))
  15. suppressMessages(suppressWarnings(library(gridExtra)))
  16. suppressMessages(suppressWarnings(library(cowplot)))
  17. suppressMessages(suppressWarnings(library(ggplot2)))
  18. suppressMessages(suppressWarnings(library(shiny)))
  19. suppressMessages(suppressWarnings(library(dplyr)))
  20. cell_names <- c("Astro", "Excite", "Inhibit", "Micro", "Oligo", "OPC")
  21. regions_to_avoid <- c("ACCK", "ACCV", "M1")
  22. # Define the UI (User Interface)
  23. ui <- fluidPage(
  24. titlePanel("Yi lab marker generator"),
  25. sidebarLayout(
  26. sidebarPanel(
  27. sliderInput("pvalue", "Maximum Adjusted p-value", min = 0, max = 0.25, value = 1, step = 0.01),
  28. sliderInput("FC", "Minimum Fold Change", min = 0, max = 4, value = 0, step = 0.1),
  29. sliderInput("spec", "Minimum Specificity value", min = 0, max = 1, value = 0, step = 0.01),
  30. textInput("Astro_markers", "Your choice of canonical Astrocyte markers", value = c("ALDH1L1, AQP4, GFAP, GJA1, SLC1A2, SLC4A4"), placeholder = "AQP4"),
  31. textInput("Excite_markers", "Your choice of canonical Excitatory Neuron markers", value = c("CAMK2A, SLC17A7, SATB2"), placeholder = "CAMK2A"),
  32. textInput("Inhibit_markers", "Your choice of canonical Inhibitory Neuron markers", value = c("GAD1, GAD2"), placeholder = "GAD1"),
  33. textInput("Micro_markers", "Your choice of canonical Microglia markers", value = c("AIF1, APBB1IP, CSF1R, CX3CR1, DOCK8, HLA-DRA, P2RY12, PTPRC, TYROBP"), placeholder = "APBB1IP"),
  34. textInput("Oligo_markers", "Your choice of canonical Oligodendrocyte markers", value = c("MBP, MOBP, MOG, OPALIN, PLP1, ST18"), placeholder = "MBP"),
  35. textInput("OPC_markers", "Your choice of canonical OPC markers", value = c("CSPG4, PCDH15, PDGFRA, VCAN"), placeholder = "PDGFRA"),
  36. numericInput("Frequency", "The number of times genes were observed", value = 5, min = 0),
  37. DTOutput("my_datatable"),
  38. actionButton("go",label = "Plot Data"),
  39. uiOutput("radio_matrix")
  40. ),
  41. mainPanel(
  42. tabsetPanel(
  43. tabPanel("Heatmap",
  44. uiOutput("plotContainer")),
  45. tabPanel("Marker lists",
  46. div(
  47. class = "table-container",
  48. DTOutput("gene_table")
  49. )),
  50. tabPanel("PCA plots",
  51. div(
  52. class = "table-container",
  53. # Adding a text input for the user to enter markers:
  54. textInput("markersText", "Enter markers (comma separated):",
  55. value = "GAD1, GAD2"),
  56. plotOutput("PCAplot", width = "300px", height = "300px")
  57. )),
  58. tabPanel("Regional gene rank",
  59. div(
  60. class = "table-container",
  61. textInput("rank_genes", "Gene", value = "PDGFRA", placeholder = "PDGFRA"),
  62. textInput("rank_cell_type", "Cell Type", value = "OPC", placeholder = "OPC"),
  63. DTOutput("ranking_table")
  64. ))
  65. )
  66. )
  67. )
  68. )
  69. # Define the server logic
  70. server <- function(input, output, session) {
  71. pct_metrics <- reactive({
  72. readRDS("source/all_pct_metrics_RN012.rds")
  73. })
  74. cell_counts <- reactive({
  75. read_excel("source/Supplementary Table 2B - postQC.xlsx")
  76. })
  77. filtered_DESeq_matrix <- reactive({
  78. readRDS("source/DESeq2_normalized_counts.rds")
  79. })
  80. df_merged <- reactive({
  81. readRDS("source/merged_gene_info.rds")
  82. })
  83. all_canonical_gene_list <- reactive({
  84. readRDS("source/pan_canonical_marker_list.rds")
  85. })
  86. vst_mat <- reactive({
  87. readRDS("source/vst_mat.rds")
  88. })
  89. PCA_seurat <- reactive({
  90. readRDS("source/final_seurat_object_RN012.rds")
  91. })
  92. v <- reactiveValues(data = {
  93. df <- data.frame(
  94. Astrocyte = c(80, 15, 2.25),
  95. Inhibitory = c(80, 15, 0),
  96. Excitatory = c(90, 5, 2),
  97. Microglia = c(95, 5, 4.5),
  98. Oligodendrocyte = c(95, 10, 1),
  99. OPC = c(90, 5, 2)
  100. )
  101. # fidelity_thresh <- list(80 , 80, 90 , 95 , 95, 90)
  102. # background_thresh <- list(15 , 15, 5 , 5 , 10, 5)
  103. # cohen_d_thresh <- list(2.25 , 0, 2 , 4.5, 1 , 2)
  104. row.names(df) <- c("Fidelity", "Background", "Cohen distance")
  105. df
  106. })
  107. #output the datatable based on the dataframe (and make it editable)
  108. output$my_datatable <- renderDT({
  109. DT::datatable(v$data, editable = TRUE)
  110. })
  111. # Define a reactive expression that returns multiple input values as a list
  112. user_inputs <- reactive({
  113. specificity_vector = input$spec
  114. log2FC_thresh = input$FC
  115. padj_thresh = input$pvalue
  116. frequency = input$Frequency
  117. Astro_markers = as.character(tstrsplit(input$Astro_markers, ", "))
  118. Excite_markers = as.character(tstrsplit(input$Excite_markers, ", "))
  119. Inhibit_markers = as.character(tstrsplit(input$Inhibit_markers, ", "))
  120. Micro_markers = as.character(tstrsplit(input$Micro_markers, ", "))
  121. Oligo_markers = as.character(tstrsplit(input$Oligo_markers, ", "))
  122. OPC_markers = as.character(tstrsplit(input$OPC_markers, ", "))
  123. rank_genes = input$rank_genes
  124. rank_cell_type = input$rank_cell_type
  125. all_canonical_gene_list = list(Astro_markers, Excite_markers, Inhibit_markers, Micro_markers, Oligo_markers, OPC_markers)
  126. names(all_canonical_gene_list) = cell_names
  127. #print(as.character(tstrsplit(input$Astro_markers, ", ")))
  128. fidelity_thresh = v$data["Fidelity", ]
  129. background_thresh = v$data["Background", ]
  130. cohen_d_thresh = v$data["Cohen distance", ]
  131. list(
  132. specificity_vector = specificity_vector,
  133. log2FC_thresh = log2FC_thresh,
  134. rank_genes = rank_genes,
  135. rank_cell_type = rank_cell_type,
  136. padj_thresh = padj_thresh,
  137. frequency = frequency,
  138. fidelity_thresh = fidelity_thresh,
  139. background_thresh = background_thresh,
  140. cohen_d_thresh = cohen_d_thresh,
  141. all_canonical_gene_list = all_canonical_gene_list
  142. )
  143. })
  144. observeEvent(input$my_datatable_cell_edit, {
  145. info <- input$my_datatable_cell_edit
  146. v$data[info$row, info$col] <- as.numeric(info$value)
  147. })
  148. cohen_d <- function(x, y) {
  149. nx <- length(x)
  150. ny <- length(y)
  151. pooled_sd <- sqrt(((nx - 1) * var(x) + (ny - 1) * var(y)) / (nx + ny - 2))
  152. (mean(x) - mean(y)) / pooled_sd
  153. }
  154. server <- function(input, output, session) {
  155. output$checkbox_matrix <- renderUI({
  156. rows <- lapply(1:4, function(i) {
  157. fluidRow(
  158. lapply(1:5, function(j) {
  159. column(
  160. width = 2, # to fit 5 checkboxes per row (12/5 ≈ 2)
  161. checkboxInput(
  162. inputId = paste0("check_", i, "_", j),
  163. label = paste("C", i, j),
  164. value = FALSE
  165. )
  166. )
  167. })
  168. )
  169. })
  170. tagList(rows)
  171. })
  172. }
  173. cell_specific_generate_gene_sets <- reactive({
  174. df_merged <- df_merged()
  175. pct_metrics <- pct_metrics()
  176. count_matrix <- filtered_DESeq_matrix()
  177. #all_canonical_gene_list <- all_canonical_gene_list()
  178. ui_vals <- user_inputs()
  179. all_canonical_gene_list <- ui_vals$all_canonical_gene_list
  180. print(all_canonical_gene_list)
  181. fidelity_thresh <- as.numeric(ui_vals$fidelity_thresh)
  182. background_thresh <- as.numeric(ui_vals$background_thresh)
  183. padj_thresh <- as.numeric(ui_vals$padj_thresh)
  184. log2FC_thresh <- ui_vals$log2FC_thresh
  185. cohen_d_thresh <- ui_vals$cohen_d_thresh
  186. frequency <- as.numeric(ui_vals$frequency) # Frequency is a string from textInput
  187. names(fidelity_thresh) <- cell_names
  188. names(background_thresh) <- cell_names
  189. names(cohen_d_thresh) <- cell_names
  190. # print(background_thresh[["Astro"]])
  191. # print(fidelity_thresh[["Astro"]])
  192. # Filter significant genes *per cell type* based on their thresholds
  193. df_merged_sig <- df_merged %>% rowwise() %>% filter(fidelity > fidelity_thresh[Cell],
  194. background < background_thresh[Cell],
  195. padj < padj_thresh,
  196. log2FoldChange > log2FC_thresh) %>% ungroup()
  197. df_merged_sig <- df_merged_sig[df_merged_sig$region %in% regions_to_avoid == FALSE, ]
  198. # print(nrow(df_merged_sig))
  199. #
  200. # # Top genes per Cell
  201. if (nrow(df_merged_sig) == 0) {
  202. top_genes <- data.frame(Cell = character(), gene = character(), freq = numeric())
  203. } else {
  204. top_genes <- df_merged_sig %>% group_by(Cell, gene) %>% summarise(freq = n(), .groups = "drop_last") %>% arrange(Cell, desc(freq)) %>% slice_max(order_by = freq, n = frequency, with_ties = FALSE)
  205. }
  206. # print(top_genes)
  207. # # Build subset count
  208. subset_count_matrix <- count_matrix[top_genes$gene, ]
  209. global_gene_set_results <- list()
  210. putative <- data.frame()
  211. canonical <- data.frame()
  212. # print(dim(subset_count_matrix))
  213. # Loop through cells
  214. for (cell in cell_names) {
  215. log2_filtered_TPM_matrix <- log2(subset_count_matrix + 1)
  216. current_count_matrix <- log2_filtered_TPM_matrix
  217. genes <- rownames(current_count_matrix)
  218. current_count_matrix_cell <- current_count_matrix[, tstrsplit(colnames(current_count_matrix), "_", fixed=TRUE)[[1]] == cell]
  219. current_count_matrix_BG <- current_count_matrix[, tstrsplit(colnames(current_count_matrix), "_", fixed=TRUE)[[1]] != cell]
  220. # print(dim(current_count_matrix_cell))
  221. # print(dim(current_count_matrix_BG))
  222. # Mann-Whitney U test
  223. p_values_mann <- sapply(genes, function(r) {
  224. test_result <- wilcox.test(current_count_matrix_cell[r, ], current_count_matrix_BG[r, ])
  225. test_result$p.value
  226. })
  227. adjusted_p_mann <- p.adjust(p_values_mann, method = "BH")
  228. # Cohen's d
  229. cohen_d_values <- sapply(genes, function(r) {
  230. cohen_d(current_count_matrix_cell[r, ], current_count_matrix_BG[r, ])
  231. })
  232. summary_table <- data.frame(
  233. row = genes,
  234. mean_A = sapply(genes, function(r) mean(current_count_matrix_cell[r, ])),
  235. mean_B = sapply(genes, function(r) mean(current_count_matrix_BG[r, ])),
  236. p_value = p_values_mann,
  237. adjusted_p = adjusted_p_mann,
  238. cohen_d = cohen_d_values
  239. )
  240. summary_table <- summary_table[summary_table$row %in% top_genes[top_genes$Cell == cell, ]$gene, ]
  241. summary_table$cell <- cell
  242. # Apply Cohen's d filter
  243. summary_table <- summary_table[summary_table$cohen_d > cohen_d_thresh[[cell]], ]
  244. global_gene_set_results[[cell]] <- summary_table$row
  245. #print(head(pct_metrics))
  246. # Collect putative & canonical
  247. putative <- rbind(putative, pct_metrics[pct_metrics$gene %in% global_gene_set_results[[cell]] & pct_metrics$cluster == cell, ])
  248. canonical <- rbind(canonical, pct_metrics[pct_metrics$gene %in% all_canonical_gene_list[[cell]] & pct_metrics$cluster == cell, ])
  249. }
  250. #print(str(gene_list_by_cell))
  251. list(global_gene_set_results = global_gene_set_results, putative = putative, canonical = canonical)
  252. })
  253. output$heatmapPlot <- renderPlot({
  254. gene_name_lists_by_cell <- cell_specific_generate_gene_sets()
  255. # mat <- matrix(rnorm(36), nrow = 6)
  256. # rownames(mat) <- paste0("Gene", 1:6)
  257. # colnames(mat) <- paste0("Sample", 1:6)
  258. #
  259. # # Plot a simple heatmap using base R
  260. # heatmap(mat,
  261. # main = "Debug Heatmap",
  262. # Colv = NA,
  263. # Rowv = NA,
  264. # scale = "row",
  265. # col = colorRampPalette(c("blue", "white", "red"))(50))
  266. # gene_name_lists_by_cell <- cell_specific_generate_gene_sets()
  267. # By index:
  268. global_gene_set_results <- gene_name_lists_by_cell$global_gene_set_results
  269. all_markers <- unique(unlist(global_gene_set_results))
  270. vst_mat <- vst_mat()
  271. common_gene_set <- unique(intersect(rownames(vst_mat), all_markers))
  272. plot_matrix <- vst_mat[common_gene_set, ]
  273. print(dim(plot_matrix))
  274. df_row <- data.frame(common_gene_set)
  275. rownames(df_row) <- common_gene_set
  276. colnames(df_row) <- "Marker"
  277. print(dim(df_row))
  278. inverse_gene_cell_hash <- list()
  279. for (key in names(global_gene_set_results)){
  280. for (gene in global_gene_set_results[[key]]){
  281. inverse_gene_cell_hash[[gene]] <- key
  282. }
  283. }
  284. print(length(names(inverse_gene_cell_hash)))
  285. for(marker in df_row$Marker){
  286. df_row[marker, "color"] <- paste0(inverse_gene_cell_hash[[marker]], " marker")
  287. }
  288. df_row <- df_row[-c(1)]
  289. df_col <- data.frame(tstrsplit(colnames(plot_matrix), "_")[[1]])
  290. rownames(df_col) <- colnames(plot_matrix)
  291. colnames(df_col) <- "Cell Type"
  292. # # Load RColorBrewer for color palettes
  293. #
  294. colors <- c("red", "green", "blue", "orange", "violet", "brown")#brewer.pal(6, "Set1")
  295. # Define your colors as a named vector
  296. color_vector <- c(
  297. "Astro marker" = colors[1],
  298. "Excite marker" = colors[2],
  299. "Inhibit marker" = colors[3],
  300. "Micro marker" = colors[4],
  301. "Oligo marker" = colors[5],
  302. "OPC marker" = colors[6])
  303. # Define your colors as a named vector
  304. cell_vector <- c(
  305. "Astro" = colors[1],
  306. "Excite" = colors[2],
  307. "Inhibit" = colors[3],
  308. "Micro" = colors[4],
  309. "Oligo" = colors[5],
  310. "OPC" = colors[6])
  311. annotation_colors <- list()
  312. annotation_colors$color <- as.factor(color_vector)
  313. annotation_colors$`Cell Type` <- as.factor(cell_vector)
  314. grid.newpage() # Start a new graphical page
  315. pheatmap_obj <- pheatmap(
  316. plot_matrix,
  317. cluster_rows = TRUE,
  318. cluster_cols = TRUE,
  319. show_rownames = TRUE,
  320. show_colnames = TRUE,
  321. annotation_col = df_col,
  322. annotation_row = df_row,
  323. annotation_colors = annotation_colors,
  324. fontsize_col = 7,
  325. fontsize_row = 10,
  326. fontsize = 25,
  327. cellwidth = 7,
  328. cellheight = 10,
  329. clustering_method = "ward.D2",
  330. legend = TRUE,
  331. color = colorRampPalette(c("blue", "white", "red"))(50),
  332. angle_col = 90)
  333. grid.draw(pheatmap_obj)
  334. })
  335. output$plotContainer <- renderUI({
  336. gene_name_lists_by_cell <- cell_specific_generate_gene_sets()
  337. global_gene_set_results <- gene_name_lists_by_cell$global_gene_set_results
  338. all_markers <- unique(unlist(global_gene_set_results))
  339. plotOutput("heatmapPlot", height = paste0(as.character(300 + 10*length(all_markers)), "px"), width = "2800px")
  340. #plotOutput("heatmapPlot", height = "500px", width = "500px")
  341. })
  342. # server.R (or inside your server function)
  343. output$PCAplot <- renderPlot({
  344. # 1. grab your Seurat object
  345. so <- PCA_seurat()
  346. # 2. split & trim your comma‐separated input
  347. genes <- trimws( unlist(strsplit(input$markersText, ",")) )
  348. # coords <- Embeddings(so, "pca")[, 1:2]
  349. # xlim_shared <- range(coords[,1])
  350. # ylim_shared <- range(coords[,2])
  351. # 3. make one FeaturePlot per gene
  352. gene_plots <- lapply(genes, function(g) {
  353. FeaturePlot(object = so, features = g, reduction = "pca", pt.size = 1.5, order = TRUE) +
  354. theme(plot.margin = unit(c(0,0,0,0), "cm"))
  355. })
  356. # 4. add your PCA clustering plot
  357. colors <- c("green", "blue", "red", "violet", "orange", "brown")
  358. p_cluster <- DimPlot(so, reduction = "pca", group.by = "cluster_id", pt.size = 1.5, cols = colors)
  359. all_plots <- c(gene_plots, list(p_cluster))
  360. # 5. arrange in a grid
  361. plot_grid(plotlist = all_plots, ncol = 4)
  362. },
  363. # DYNAMIC WIDTH: recalc whenever markersText changes
  364. width = 1350,
  365. height = function(){
  366. n <- length(trimws(unlist(strsplit(input$markersText, ","))))
  367. # e.g. allocate 600px per column (adjust to taste)
  368. (round((n)/4) + 1)*250
  369. }
  370. )
  371. # server.R (or inside your server function)
  372. output$barplot <- renderPlot({
  373. GLM <- run_GLM_analysis()
  374. GLM_results <- GLM$GLM_results
  375. ggplot(GLM_results, aes(cluster, odds_ratio, fill = metric)) + geom_bar(stat="identity", position = "dodge", width = 0.65) +
  376. labs(title="Multiple Bar plots") +
  377. geom_hline(yintercept = 1, linetype = "dashed",
  378. colour = "tomato", linewidth = 1.5) +
  379. scale_fill_manual(values = c("darkblue", "orange")) +
  380. xlab("Cell Type") + ylab("Odds Ratio") +
  381. theme_bw() +
  382. theme(axis.text.x = element_text(size = 20),
  383. axis.text.y = element_text(size = 20),
  384. axis.title.x = element_text(size = 20),
  385. axis.title.y = element_text(size = 20))},
  386. # DYNAMIC WIDTH: recalc whenever markersText changes
  387. width = 1200, height = 600
  388. )
  389. table_data <- reactive({
  390. gene_name_lists_by_cell <- cell_specific_generate_gene_sets()
  391. global_gene_set_results <- gene_name_lists_by_cell$global_gene_set_results
  392. all_markers <- unique(unlist(global_gene_set_results))
  393. df <- data.frame(
  394. Cell_Type = names(global_gene_set_results),
  395. Genes = sapply(global_gene_set_results, paste, collapse = ", "),
  396. Count = sapply(global_gene_set_results, length)# Convert to comma-separated strings
  397. )
  398. return(df) # Return the dataframe
  399. })
  400. canonical_gene_table_data <- reactive({
  401. ui_vals <- user_inputs()
  402. canonical_gene_set <- ui_vals$all_canonical_gene_list
  403. print(canonical_gene_set)
  404. #global_gene_set_results <- gene_name_lists_by_cell$global_gene_set_results
  405. #all_markers <- unique(unlist(global_gene_set_results))
  406. df <- data.frame(
  407. Cell_Type = names(canonical_gene_set),
  408. Genes = sapply(canonical_gene_set, paste, collapse = ", "),
  409. Count = sapply(canonical_gene_set, length)# Convert to comma-separated strings
  410. )
  411. return(df) # Return the dataframe
  412. })
  413. rank_table <- reactive({
  414. ui_vals <- user_inputs()
  415. canonical_gene_set <- ui_vals$all_canonical_gene_list
  416. print(canonical_gene_set)
  417. df_merged <- df_merged()
  418. #print(ui_vals)
  419. rank_genes <- ui_vals$rank_genes
  420. rank_cell_type <- ui_vals$rank_cell_type
  421. print(rank_genes)
  422. print(rank_cell_type)
  423. genes <- as.character(tstrsplit(rank_genes, ", "))
  424. print(genes)
  425. display_table <- df_merged[df_merged$gene %in% genes & df_merged$cluster == rank_cell_type, ]
  426. display_table <- display_table[order(display_table$gene, decreasing = FALSE), ]
  427. return(display_table) # Return the dataframe
  428. })
  429. output$gene_table <- renderDT({
  430. datatable(table_data(),
  431. options = list(autoWidth = TRUE, scrollX = TRUE, pageLength = 100),
  432. escape = FALSE) %>%
  433. formatStyle(
  434. columns = "Genes", # Replace with your column name
  435. whiteSpace = "normal",
  436. wordWrap = "break-word"
  437. )
  438. })
  439. output$Canonical_marker_table <- renderDT({
  440. datatable(canonical_gene_table_data(),
  441. options = list(autoWidth = TRUE, scrollX = TRUE),
  442. escape = FALSE) %>%
  443. formatStyle(
  444. columns = "Genes", # Replace with your column name
  445. whiteSpace = "normal",
  446. wordWrap = "break-word"
  447. )
  448. })
  449. output$ranking_table <- renderDT({
  450. print(rank_table())
  451. datatable(rank_table(),
  452. options = list(autoWidth = TRUE, scrollX = TRUE, pageLength = 100),
  453. escape = FALSE)
  454. })
  455. }
  456. shinyApp(ui = ui, server = server)

app.R at commit 2d23065, no license · at the source

Overview

Authors: Dennis M Joshy1,2, Soojin V Yi2,3,4
  1. Department of Mechanical Engineering, University of California, Santa Barbara, 93106 USA
  2. Neuroscience Research Institute, University of California, Santa Barbara, 93106 USA
  3. Ecology, Evolution, and Marine Biology, University of California, Santa Barbara, 93106 USA
  4. Molecular, Cellular and Developmental Biology, University of California, Santa Barbara, 93106 USA
Institutions: University of California, Santa Barbara (United States)
Journal: Scientific reports, volume 16, issue 1, article 24601
Dates: received 27 August 2025; accepted 28 April 2026; published online 21 May 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1038/s41598-026-51501-2 · PMID 42168596 · PMCID PMC13454430 · OpenAlex W4413740415
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: genetics / omics (modality), human (organism), cellular / molecular (subfield)
Methods: Statistics, Smoothing, state filtering, decompositions, Machine learning
Keywords: ScRNA-Seq, Cell type markers, Human cortex, Expression fidelity, Background expression, Sublayer specific markers, Biological techniques, Computational biology and bioinformatics, Neuroscience
MeSH: Cerebral Cortex*, Gene Expression Profiling*, Single-Cell Analysis*, Transcriptome*, Biomarkers, Humans, Neurons, Single-Cell Gene Expression Analysis (* major topic)
Topic: Single-cell and spatial transcriptomics (Molecular Biology, Biochemistry, Genetics and Molecular Biology), according to OpenAlex
Funding: National Science Foundation, United States (EF-2021635); National Institutes of Health,United States (HG011641, MH134809); NHGRI NIH HHS (R01 HG011641); NIMH NIH HHS (R01 MH134809)
Citations: not cited yet (Europe PMC); 62 references in the paper

Abstract

Cell type markers have been instrumental to physiological and molecular investigation of the human brain and remain essential for annotating cell type clusters in single-cell expression data and for target validation studies. However, expression of canonical markers in the target cell type (which we termed as the expression ‘fidelity’) as well as expression in unrelated cell types (which we termed as the ‘background expression’) across cortical regions remains poorly characterized. Here, leveraging nearly 500,000 high-quality single-nucleus and single-cell profiles from 19 studies, we quantified marker fidelity, revealing substantial regional variability. We developed a statistical framework that aggregates annotated barcodes into pseudo-bulk profiles, applied rigorous performance metrics, and identified markers with high fidelity, low background, and consistent expression across regions. This approach extended the canonical marker set for six major brain cell types and yielded superior subtype-specific markers. The resulting marker lists, and a user-friendly analysis interface, provide a valuable resource for cell type annotation and validation in neuroscience research.

Supplementary Information: The online version contains supplementary material available at 10.1038/s41598-026-51501-2.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repository

Its files are read in the Code ↔ Paper reader above, with 15 matches between paragraphs and lines of code.

dmj6288/Expanding-canonical-cortical-cell-type-markers-in-the-era-of-single-cell-transcriptomics

License: none: the authors keep all their rights
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: 2d2306504c9aec77600058e847ee25013cab1312, 3 September 2025
Languages: R (48)
Size: 199 files, 48 scripts
Software Heritage: not archived
Found in: “Code availability”
Holds: README, 25 notebooks
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: data.table (21 files), tidyverse (19 files), ggplot2 (12 files), SingleCellExperiment (7 files), pheatmap (6 files), Seurat (6 files), DESeq2 (5 files), glmnet (4 files), igraph (4 files), clusterProfiler (3 files), reshape2 (3 files), ggpubr (2 files), cowplot (1 file), rstatix (1 file)
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
49 files

Code availability

The software pipeline used to perform this analysis is publicly available at https://github.com/dmj6288/Expanding-canonical-cortical-cell-type-markers-in-the-era-of-single-cell-transcriptomics.

Reproduced under the paper's license (CC BY), from the paper cited above.

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;
  • 48 scripts, each with its path and the digest of its content;
  • 15 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

Data Availability Statement

The full single-cell raw cortical count matrix (488,397 cells) and associated cell metadata compiled from all 19 datasets is a great resource to build and test cell classification algorithms and is made publicly available at: 10.6084/m9.figshare.29992147. The pseudo-bulk aggregated count matrix prior to refinement is available for download from the GitHub repository of this project. Supplementary Fig. S1 contains links of all source data prior to any QC, but intermediate datasets will be shared upon request - please directly contact (mailto: ) or (mailto: ). The RShiny application to assist in interactive biomarker discovery and testing is available at https://dmj6288.shinyapps.io/CortexMapperV1/*.Â* Supplementary Files (Figures and Tables) references in the paper are available on the Journal website and upon request.

The software pipeline used to perform this analysis is publicly available at https://github.com/dmj6288/Expanding-canonical-cortical-cell-type-markers-in-the-era-of-single-cell-transcriptomics.

Reproduced under the paper's license (CC BY), from the paper cited above.

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, 2 authors, 9 keywords, 8 MeSH terms, 4 funders, 55 references.

Cite

This paper

Joshy, D. M., & Yi, S. V. (2026). Expanding canonical cortical cell type markers in the era of single-cell transcriptomics. Scientific reports, 16(1), 24601. https://doi.org/10.1038/s41598-026-51501-2

BibTeX

@article{joshy2026expanding,
author = {Joshy, Dennis M and Yi, Soojin V},
title = {{Expanding canonical cortical cell type markers in the era of single-cell transcriptomics}},
journal = {Scientific reports},
year = {2026},
month = may,
volume = {16},
number = {1},
pages = {24601},
publisher = {Nature Publishing Group},
issn = {2045-2322},
doi = {10.1038/s41598-026-51501-2},
url = {https://doi.org/10.1038/s41598-026-51501-2},
pmid = {42168596},
pmcid = {PMC13454430}
}

RIS

TY - JOUR
AU - Joshy, Dennis M
AU - Yi, Soojin V
TI - Expanding canonical cortical cell type markers in the era of single-cell transcriptomics
T2 - Scientific reports
J2 - Sci Rep
PY - 2026
DA - 2026/05/21
VL - 16
IS - 1
SP - 24601
SN - 2045-2322
PB - Nature Publishing Group
DO - 10.1038/s41598-026-51501-2
UR - https://doi.org/10.1038/s41598-026-51501-2
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41598-026-51501-2",
"type": "article-journal",
"title": "Expanding canonical cortical cell type markers in the era of single-cell transcriptomics",
"container-title": "Scientific reports",
"author": [
{
"family": "Joshy",
"given": "Dennis M"
},
{
"family": "Yi",
"given": "Soojin V"
}
],
"container-title-short": "Sci Rep",
"volume": "16",
"issue": "1",
"page": "24601",
"DOI": "10.1038/s41598-026-51501-2",
"PMID": "42168596",
"PMCID": "PMC13454430",
"ISSN": "2045-2322",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41598-026-51501-2",
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
21
]
]
}
}

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/s41467-026-73305-8 [code]
Comparative analysis of the cellular landscape in mammalian striatum.
Journal: Nature communications
In common: SingleCellExperiment, DESeq2, clusterProfiler, 8 other tools, genetics / omics, cellular / molecular, 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. Medicine
In common: SingleCellExperiment, igraph, DESeq2, 9 other tools, genetics / omics, cellular / molecular, 5 references
[3] doi:10.1186/s13059-026-04177-w [code]
Genomic sequence evolution underlying human neocortical interareal diversification.
Journal: Genome biology
In common: rstatix, igraph, pheatmap, 6 other tools, genetics / omics, cellular / molecular, 7 references
[4] 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: SingleCellExperiment, igraph, DESeq2, 9 other tools, cellular / molecular, 3 references
[5] doi:10.1038/s41586-026-10629-x [code]
Whole-genome duplication shaped cell-type evolution in the vertebrate brain.
Journal: Nature
In common: rstatix, igraph, DESeq2, 8 other tools, genetics / omics, cellular / molecular, 4 references
[6] doi:10.3390/ijms27093997 [code]
Coordinated Multicellular Immune Programs and Drug Targets Revealed by Single-Cell Analysis in Driver-Mutated NSCLC.
Journal: International journal of molecular sciences
In common: glmnet, rstatix, igraph, 10 other tools, genetics / omics
[7] doi:10.1371/journal.pcbi.1014573 [code]
Cell-type-specific m1A dynamics are associated with microglial phenotypic transition and neuronal metabolic adaptation during spinal cord injury.
Journal: PLoS computational biology
In common: rstatix, igraph, DESeq2, 9 other tools, genetics / omics, cellular / molecular, 2 references
[8] doi:10.1002/imt2.70163 [code]
Spatial multi-omics unveils sphingolipid metabolic reprogramming within the retinal pathological niche.
Journal: iMeta
In common: SingleCellExperiment, rstatix, igraph, 10 other tools, genetics / omics, cellular / molecular
[9] doi:10.1038/s44318-026-00806-z [code]
Interspecific diversity in the neuronal composition of the mammalian cortex arises from heterochrony in neurogenesis.
Journal: The EMBO journal
In common: SingleCellExperiment, igraph, DESeq2, 9 other tools, 2 references
[10] doi:10.1038/s41467-026-70232-6 [code]
Gene expression dynamics of human and mouse craniofacial development at the single-cell level.
Journal: Nature communications
In common: SingleCellExperiment, DESeq2, clusterProfiler, 8 other tools, genetics / omics, cellular / molecular, 2 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.

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.