OSCR

A Porcine Model of Intervertebral Disc Injury Recapitulates Human Discogenic Pain Via Notochordal Cell Loss and Pain-Inducing Nucleus Pulposus Cell Emergence.

Code ↔ Paper

2 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 2 matches
  1. [1] § Methods › scRNA‐Seq Bioinformatic Analysis ↔ 2. Data Visualization with Seurat Script.qmd, lines 193–256 · score 0.96 · CHI3L1, IL1R1, IL6R, TNFRSF1B, COL1A1, HMOX1
  2. [2] § Methods › scRNA‐Seq Bioinformatic Analysis ↔ 3. Psudotime Analysis Script.qmd, lines 161–220 · score 0.60 · NC lineage, KRT19, MGP, KRT8, TBXT, ACAN

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

Quarto · 612 lines · 26 KB · no license · 1 match

  1. ---
  2. title: "General Seurat Figures and Analysis in RStudio"
  3. format: html
  4. editor: visual
  5. ---
  6. ```{r}
  7. ```
  8. All packages required for script to run.
  9. ```{r}
  10. #| echo: false
  11. #if (!require("BiocManager", quietly = TRUE))
  12. #install.packages("BiocManager")
  13. #BiocManager::install("Seurat", force = TRUE)
  14. #install.packages("remotes")
  15. #install.packages("R.utils")
  16. #remotes::install_github("satijalab/seurat-wrappers")
  17. #BiocManager::install(c('BiocGenerics', 'DelayedArray', 'DelayedMatrixStats',
  18. # 'limma', 'lme4', 'S4Vectors', 'SingleCellExperiment',
  19. # 'SummarizedExperiment', 'batchelor', 'HDF5Array',
  20. # 'terra', 'ggrastr'))
  21. #install.packages("devtools")
  22. #devtools::install_github('cole-trapnell-lab/monocle3')
  23. #BiocManager::install("EnhancedVolcano", force = TRUE)
  24. #BiocManager::install("ComplexHeatmap")
  25. #devtools::install_github("jinworks/CellChat")
  26. #install.packages("NMF")
  27. library(Seurat)
  28. library(SeuratWrappers)
  29. library(patchwork)
  30. library(dplyr)
  31. library(ggplot2)
  32. library(monocle3)
  33. library(Matrix)
  34. #library(EnhancedVolcano)
  35. library (ggrepel)
  36. library(RColorBrewer)
  37. library(pheatmap)
  38. library(webr)
  39. #if GK Laptop
  40. #setwd("C:/Users/gkane/Box/Box - Sheyn Lab/Projects/Ongoing projects/Porcine IVD/Data/scRNA Seq/RStudio and Seurat Analysis/3. Data Visualization via Seurat")
  41. #if BIRI super computer
  42. setwd("C:/Users/kanedag/OneDrive - Cedars-Sinai Health System/Sheyn, Dima's files - Box - Sheyn Lab/Projects/Ongoing projects/Porcine IVD model/Data/scRNA Seq/RStudio and Seurat Analysis/3. Data Visualization via Seurat")
  43. ```
  44. ```{r}
  45. #color by cluster
  46. AllData.int$seurat_clusters -> [email hidden]
  47. AllData.umap <-DimPlot(AllData.int, reduction = "umap", pt.size = 0.01, label = TRUE,
  48. label.size = 4, raster = FALSE) + coord_fixed(ratio=1)
  49. AllData.pca
  50. ggsave("AllData umap.png", AllData.umap)
  51. #color by disc
  52. P1 <- DimPlot(AllData.int, reduction = "pca", pt.size = 0.1, label = TRUE, repel = TRUE,
  53. raster = FALSE,group.by = "orig.ident")
  54. P1
  55. ggsave("All discs orig.ident pca.png", P1)
  56. #color by injury stats
  57. P2 <- DimPlot(AllData.int, reduction = "pca", pt.size = 0.1, label = TRUE, repel = TRUE,
  58. raster = FALSE,group.by = "disc.ident")
  59. P2
  60. ggsave("Inj vs Healthy pca.png", P2)
  61. P3 <- DimPlot(AllData.int, reduction = "pca", pt.size = 0.1, label = TRUE, repel = TRUE,
  62. raster = FALSE,group.by = "cell.ident")
  63. P3
  64. ggsave("Cell Ident pca.png", P3)
  65. P4 <- DimPlot(AllData.int, reduction = "pca", pt.size = 0.1, label = TRUE, repel = TRUE,
  66. raster = FALSE,group.by = "cell.state")
  67. P4
  68. ggsave("Cell.state pca.png", P4)
  69. DimPlot(AllData.int, reduction = "pca", pt.size = 0.01, label = TRUE,
  70. label.size = 4, raster = FALSE)
  71. DimPlot(AllData.int, reduction = "pca", pt.size = 0.1, label = TRUE, repel = TRUE,
  72. raster = FALSE,split.by = "orig.ident")
  73. DimPlot(AllData.int, reduction = "pca", pt.size = 0.1, label = TRUE, repel = TRUE,
  74. raster = FALSE,split.by = "disc.ident")
  75. ```
  76. Plot percent cells from each disc per cluster and percent cells injured/healthy per cluster
  77. ```{r Visualization of batch spread within clusters}
  78. #percent cells from each disc per cluster
  79. # Create a table of cluster-orig.ident counts
  80. cluster_orig.ident_counts <- table(AllData.int$seurat_clusters, AllData.int$orig.ident)
  81. # Calculate the percentage of cells per genotype in each cluster
  82. cluster_orig.ident_percentage <- prop.table(cluster_orig.ident_counts, margin = 1) * 100
  83. # Create a data frame for plotting
  84. plot_data <- as.data.frame(cluster_orig.ident_percentage)
  85. colnames(plot_data) <- c('Cluster', 'orig.ident', 'Percentage')
  86. # Create the stacked bar plot using ggplot2
  87. disc.pct.plot <- ggplot(plot_data, aes(x = Cluster, y = Percentage, fill = orig.ident)) +
  88. geom_bar(stat = "identity", position = "stack", width = 0.7) +
  89. labs(x = 'Cluster', y = 'Percentage of Cells') +
  90. theme_minimal() +
  91. ggtitle('Percentage of Cells per orig.ident in Each Cluster') +
  92. guides(fill = guide_legend(title = 'orig.ident'))
  93. disc.pct.plot
  94. ggsave("percent cells per disc.png", disc.pct.plot, width = 10, height = 8, units = "in")
  95. #percent cells injured/healthy per cluster
  96. #Create a table of cluster-disc.ident counts
  97. inj_ctr_counts <- table(AllData.int$seurat_clusters, AllData.int$disc.ident)
  98. # Calculate the percentage of cells per genotype in each cluster
  99. inj_ctr_percentage <- prop.table(inj_ctr_counts, margin = 1) * 100
  100. # Create a data frame for plotting
  101. plot_data <- as.data.frame(inj_ctr_percentage)
  102. colnames(plot_data) <- c('Cluster', 'disc.ident', 'Percentage')
  103. # Create the stacked bar plot using ggplot2
  104. InjCtr.pct.plot <- ggplot(plot_data, aes(x = Cluster, y = Percentage, fill = disc.ident)) +
  105. geom_bar(stat = "identity", position = "stack", width = 0.7) +
  106. labs(x = 'Cluster', y = 'Percentage of Cells') +
  107. theme_minimal() +
  108. ggtitle('Percentage of Cells per disc.ident in Each Cluster') +
  109. guides(fill = guide_legend(title = 'disc.ident'))+
  110. theme(axis.text.x = element_text(angle = 45, hjust = 1))
  111. InjCtr.pct.plot
  112. ggsave("percent cells per inj-ctr.png", InjCtr.pct.plot, width = 10, height = 8, units = "in")
  113. ```
  114. ```{r Pie-Donut plot}
  115. # Extract the cell.ident and seurat_clusters from the Seurat object
  116. cell_data <- data.frame(cell.ident = [email hidden]$cell.ident,
  117. seurat_clusters = [email hidden]$seurat_clusters)
  118. # Summarize the counts for each combination of cell type and cluster
  119. PD <- cell_data %>%
  120. group_by(cell.ident, seurat_clusters) %>%
  121. summarise(n = n()) %>%
  122. ungroup()
  123. # Modify only the labels containing the word "Transitional" to include line breaks
  124. #PD$cell.ident <- ifelse(grepl("Transitional", PD$cell.ident),
  125. # gsub("Transitional ", "Transitional\n", PD$cell.ident),
  126. # as.character(PD$cell.ident))
  127. # Create the nested pie chart with the specified order and label adjustments
  128. PieDonut(PD, aes(cell.ident, seurat_clusters, count = n),
  129. title = "Cell Types and Clusters Distribution",
  130. showPieName = FALSE,
  131. start=pi/2,
  132. r0 = 0
  133. )
  134. ```
  135. ```{r Healthy vs Injured cluster breakdown bar}
  136. # Extract meta.data from Seurat object
  137. meta_data <- [email hidden]
  138. # Ensure the relevant columns are factors
  139. meta_data$disc.ident <- as.factor(meta_data$disc.ident)
  140. meta_data$seurat_clusters <- as.factor(meta_data$seurat_clusters)
  141. meta_data_summary <- meta_data %>%
  142. dplyr::count(disc.ident, cell.ident) %>%
  143. group_by(disc.ident) %>%
  144. mutate(percentage = n / sum(n) * 100)
  145. # Create the bar plot using ggplot2
  146. ggplot(meta_data, aes(x = disc.ident, fill = cell.ident)) +
  147. geom_bar(position = "fill", stat = "count") +
  148. scale_y_continuous(labels = scales::percent) +
  149. theme_minimal() +
  150. labs(x = "Cell Ident", y = "Percentage", fill = "Cell Identity") +
  151. ggtitle("Distribution of cell identities across Discs")
  152. ```
  153. First run through for cluster cell type identification and visualization of select interesting genes
  154. ```{r Initial cell identification and visiualization of interesting genes}
  155. marker_test_res <- top_markers(cds, group_cells_by="cell.ident", reference_cells=1000, cores=8)
  156. top_specific_markers <- marker_test_res %>%
  157. filter(fraction_expressing >= 0.5) %>%
  158. group_by(cell_group) %>%
  159. top_n(13, pseudo_R2)
  160. top_specific_marker_ids <- unique(top_specific_markers %>% pull(gene_id))
  161. top_specific_marker.int <- plot_genes_by_group(cds,
  162. top_specific_marker_ids,
  163. group_cells_by="cell.ident",
  164. ordering_type="maximal_on_diag",
  165. max.size=3)
  166. top_specific_marker.int
  167. mmp.adam.timp.markers <- DotPlot(AllData.int, features = c("MMP1","MMP2","MMP3", "MMP7",
  168. "MMP11","MMP12","MMP13","MMP14","MMP15","MMP16",
  169. "MMP17","MMP19","MMP20", "MMP23B", "MMP24",
  170. "MMP25","MMP27","MMP28","ADAMTS1","ADAMTS2","ADAMTS3",
  171. "ADAMTS4","ADAMTS5","ADAMTS6","ADAMTS7","ADAMTS9",
  172. "ADAMTS10","ADAMTS12","ADAMTS14",
  173. "ADAMTS17","TIMP1","TIMP2","TIMP3","TNFAIP6")) +
  174. scale_color_gradientn(colors = rev(brewer.pal(11, "RdBu")))+
  175. theme(axis.text.x = element_text(angle = 90, hjust = 1))
  176. mmp.adam.timp.markers
  177. ggsave("MMP-ADAMTS-TIMP dotplot.png", mmp.adam.timp.markers)
  178. assort.mark <- DotPlot(AllData.int, features = c("CDKN1A", "CDKN2A", "E2F7","EIF4", "CDC25A","CDC42", "CDKN2D","CDK12", "TNFRSF1B", "TP53", "IFNG","TNF","IL1B", "IL2","IL6","IL10", "CCL2","CCL7", "CXCL1","CXCL5","CXCL9","CXCL10","MCSF", "RANKL","VEGFA", "IL1R2", "CCL6","CCR6","ADAM8", "TLR1", "TLR2","TLR7","TLR9")) +
  179. scale_color_gradientn(colors = rev(brewer.pal(11, "RdBu")))+
  180. theme(axis.text.x = element_text(angle = 90, hjust = 1))
  181. assort.mark
  182. ggsave("Assorted markers dotplot.png", assort.mark)
  183. hog <- DotPlot(AllData.int, features = c("KRT8", "KRT18", "MGP","DCN","PRRX1","CRLF1","PDE1A","ABLIM1","HHIP", "HHIPL2","CDON","BOC","SMO")) +
  184. scale_color_gradientn(colors = rev(brewer.pal(11, "RdBu")))+
  185. theme(axis.text.x = element_text(angle = 90, hjust = 1))
  186. hog
  187. ggsave("Hedgehog dotplot.png",hog, width = 8, height = 7, units = "in")
  188. #WNT related markers "WNT5B","DVL1","DVL3","LRP5","CTNNB1","GSK3B","CSNK1E","LRP6","SFRP1"
  189. #assorted differentiation markers - ,"SOX5","SOX6","SOX9", "CHRD","GDF5","GREM1"
  190. celltype.overview <- DotPlot(AllData.int, features = list(
  191. "NC" = c("TBXT","KRT8","KRT18","CD24"),
  192. "Trans" = c("ACAN","OGN","ABLIM1","FOSB","PODN","CCNL1","SOX9","COL11A1","FN1","COL2A1","TIMP3"),
  193. "NP" = c( "PAX1","COL9A1","SOX5","SOX6","MGP","DCN","LUM"),
  194. "Pro" = c("TOP2A","CDK1","BIRC5"),
  195. "EC" = c("PECAM1","ENG", "CDH5"))) +
  196. scale_color_gradientn(colors = rev(brewer.pal(11, "RdBu")))+
  197. theme(axis.text.x = element_text(angle = 45, hjust = 1))
  198. celltype.overview
  199. ggsave("AllData initial cell overview dotplot.png", celltype.overview)
  200. dpi.overview <- DotPlot(AllData.int, features = list(
  201. "Degeneration" = c("COL1A1", "COL3A1", "FN1", "MMP16","ADAMTS6","TIMP1","TIMP3","CHI3L1"),
  202. "Inflammation" = c("IL1R1","IL6R","IL16","IL18","TNFRSF1B","IER3","HMOX1"),
  203. "Pain/Innervation" = c("NTN1","NTN4","SEMA3D","SEMA3E","CCN2","TRPV4"))) +
  204. scale_color_gradientn(colors = rev(brewer.pal(11, "RdBu")))+
  205. theme(axis.text.x = element_text(angle = 45, hjust = 1))
  206. dpi.overview
  207. ggsave("degen pain inflam marker overview dotplot.png", celltype.overview)
  208. ```
  209. ```{r}
  210. DefaultAssay(AllData.int) <- "RNA"
  211. celltype.overview <- DotPlot(AllData.int, features = c("ACAN", "COL2A1","SOX9","MIA","KRT8","KRT18","SLC2A1", "CD81","FN1","CRTAC1","CALR","COL1A1","COL1A2", "COL5A1","COL5A2","COL12A1","CD14", "TBXT","PECAM1","ENG", "CDH5", "PTPRC","LYZ" )) +
  212. scale_color_gradientn(colors = rev(brewer.pal(11, "RdBu")))+
  213. theme(axis.text.x = element_text(angle = 90, hjust = 1))
  214. celltype.overview
  215. #Identification of endothelial cells - Cluster 14
  216. Endo.clust <- VlnPlot(AllData.int, features = c("ENG", "PECAM1", "CDH5", "ICAM1", "TEK", "KDR"),pt.size = 0)
  217. Endo.clust
  218. #notochordal/progenitor cells - Cluster 0,1,3,8,9,11,13-16,18,20, maybe 17
  219. noto.clust <- VlnPlot(AllData.int, features = c("TBXT","KRT8","KRT18","PDGFRA","PRRX1","PROCR","ANGPT1","PAX1"), pt.size = 0)
  220. noto.clust
  221. AllData.int$cell.ident <- as.factor(ifelse(AllData.int$seurat_clusters %in% c("0", "1", "3", "9", "20"), "Notochordal",
  222. ifelse(AllData.int$seurat_clusters %in% c("2", "4", "5", "6", "7", "12"), "Nucleus Pulposus",
  223. ifelse(AllData.int$seurat_clusters %in% c("10", "19"), "Fibrocartilage",
  224. ifelse(AllData.int$seurat_clusters %in% c("11", "13"), "Transitional Fibrocartilage",
  225. ifelse(AllData.int$seurat_clusters %in% c("8", "14", "15", "16", "18"), "Transitional Nucleus Pulposus",
  226. ifelse(AllData.int$seurat_clusters == "17", "Immune",
  227. ifelse(AllData.int$seurat_clusters == "21", "Endothelial", ""))))))))
  228. AllData.int$cell.state <- as.factor(ifelse(AllData.int$cell.ident %in% c("Notochordal"), "Progenitor",
  229. ifelse(AllData.int$cell.ident %in% c("Transitional Nucleus Pulposus", "Transitional Fibrocartilage"), "Transitional",
  230. ifelse(AllData.int$cell.ident %in% c("Nucleus Pulposus", "Fibrocartilage", "Immune", "Endothelial"), "Terminal", NA))))
  231. ```
  232. Find and export cluster vs all unique markers
  233. ```{r Export cluster vs all unique genes for IPA analysis}
  234. DefaultAssay(AllData.int) <- "RNA"
  235. top_genes_list <- list()
  236. # Loop through each cluster, find unique genes, and export to CSV
  237. for (i in 0:21) {
  238. cluster_markers <- FindMarkers(AllData.int, ident.1 = i, min.pct = 0.25)
  239. top_genes <- head(cluster_markers[order(cluster_markers$p_val_adj), ],10)
  240. top_genes_list[[paste("Cluster", i)]] <- top_genes
  241. # write.csv(cluster_markers, sprintf("C:/Users/kanedag/Box/Box - Sheyn Lab/Projects/Ongoing projects/Porcine IVD/Data/scRNA Seq/RStudio and Seurat Analysis/3. Data Visualization via Seurat/Cluster Unique Genes/Cluster%d.csv", i), row.names = TRUE)
  242. print(paste("File for cluster", i, "written."))
  243. }
  244. print(top_genes_list)
  245. top_gene_names <- unique(unlist(lapply(top_genes_list, rownames)))
  246. # Remove markers that start with "ENSSS"
  247. top_gene_names <- top_gene_names[!grepl("^ENSSS", top_gene_names)]
  248. top5.dot <- DotPlot(AllData.int, features = top_gene_names) +
  249. scale_color_gradientn(colors = rev(brewer.pal(11, "RdBu")))+
  250. theme(axis.text.x = element_text(angle = 90, hjust = 1))
  251. top5.dot
  252. ggsave("Top 10 genes dotplot.png", top5.dot, width = 30, height = 7, units = "in")
  253. ```
  254. Find and export unique markers between injured vs healthy discs
  255. ```{r Export inj vs ctr unique markers for IPA analysis}
  256. Idents(AllData.int) <- AllData.int$disc.ident
  257. # Find markers between groups
  258. InjVCtr <- FindMarkers(AllData.int, ident.1 = "injured", ident.2 = "healthy", min.pct = 0.25)
  259. # Print the top 10 markers
  260. head(InjVCtr, n = 10)
  261. # Write the markers to a CSV file
  262. write.csv(InjVCtr, file = "C:/Users/kanedag/Box/Box - Sheyn Lab/Projects/Ongoing projects/Porcine IVD/Data/scRNA Seq/RStudio and Seurat Analysis/3. Data Visualization via Seurat/Cluster Unique Genes/Inj_Vs_Ctr_markers.csv", row.names = TRUE)
  263. ```
  264. ```{r NP-FC-Transitional Clusters comparison}
  265. Idents(AllData.int) <- AllData.int$seurat_clusters
  266. # Define the subset of clusters to process
  267. clusters_to_process <- c(2, 4:8, 10:16, 18:19)
  268. # Loop through each specified cluster
  269. for (i in clusters_to_process) {
  270. # Find markers in the current cluster compared to all other clusters in the subset
  271. cluster_markers <- FindMarkers(AllData.int, ident.1 = i, ident.2 = clusters_to_process[clusters_to_process != i], min.pct = 0.25)
  272. # Construct the file path using sprintf for organized file naming
  273. file_path <- sprintf("C:/Users/kanedag/Box/Box - Sheyn Lab/Projects/Ongoing projects/Porcine IVD/Data/scRNA Seq/RStudio and Seurat Analysis/3. Data Visualization via Seurat/NP-FC-Transitional Clusters/Cluster%d.csv", i)
  274. # Write the result to a CSV file
  275. write.csv(cluster_markers, file_path, row.names = TRUE)
  276. # Print message after writing the file
  277. print(paste("File for cluster", i, "written."))
  278. }
  279. ```
  280. ```{r NP-FC cluster comparison}
  281. Idents(AllData.int) <- AllData.int$seurat_clusters
  282. # Define the subset of clusters to process
  283. clusters_to_process <- c(2, 4:7, 10,12)
  284. # Loop through each specified cluster
  285. for (i in clusters_to_process) {
  286. # Find markers in the current cluster compared to all other clusters in the subset
  287. cluster_markers <- FindMarkers(AllData.int, ident.1 = i, ident.2 = clusters_to_process[clusters_to_process != i], min.pct = 0.25)
  288. # Construct the file path using sprintf for organized file naming
  289. file_path <- sprintf("C:/Users/kanedag/Box/Box - Sheyn Lab/Projects/Ongoing projects/Porcine IVD/Data/scRNA Seq/RStudio and Seurat Analysis/3. Data Visualization via Seurat/NP-FC Clusters/Cluster%d.csv", i)
  290. # Write the result to a CSV file
  291. write.csv(cluster_markers, file_path, row.names = TRUE)
  292. # Print message after writing the file
  293. print(paste("File for cluster", i, "written."))
  294. }
  295. ```
  296. ```{r Notochordal cluster comparison}
  297. Idents(AllData.int) <- AllData.int$seurat_clusters
  298. # Define the subset of clusters to process
  299. clusters_to_process <- c(0, 1, 3, 8, 9, 11, 14:16, 18, 20)
  300. # Loop through each specified cluster
  301. for (i in clusters_to_process) {
  302. # Find markers in the current cluster compared to all other clusters in the subset
  303. cluster_markers <- FindMarkers(AllData.int, ident.1 = i, ident.2 = clusters_to_process[clusters_to_process != i], min.pct = 0.25)
  304. # Construct the file path using sprintf for organized file naming
  305. file_path <- sprintf("C:/Users/gkane/Box/Box - Sheyn Lab/Projects/Ongoing projects/Porcine IVD/Data/scRNA Seq/RStudio and Seurat Analysis/3. Data Visualization via Seurat/Notochordal Clusters/Cluster%d.csv", i)
  306. # Write the result to a CSV file
  307. write.csv(cluster_markers, file_path, row.names = TRUE)
  308. # Print message after writing the file
  309. print(paste("File for cluster", i, "written."))
  310. }
  311. ```
  312. ```{r Cell type comparison}
  313. Idents(AllData.int) <- AllData.int$cell.ident
  314. # Define the subset of clusters to process
  315. ident_to_process <- c("Notochordal","Fibrocartilage", "Transitional Fibrocartilage","Transitional Nucleus Pulposus","Endothelial","Immune","Nucleus Pulposus")
  316. # Loop through each specified cluster
  317. for (i in ident_to_process) {
  318. # Find markers in the current cluster compared to all other clusters in the subset
  319. ident_markers <- FindMarkers(AllData.int, ident.1 = i, ident.2 = ident_to_process[ident_to_process != i], min.pct = 0.25)
  320. # Construct the file path using sprintf for organized file naming
  321. file_path <- sprintf("C:/Users/kanedag/Box/Box - Sheyn Lab/Projects/Ongoing projects/Porcine IVD/Data/scRNA Seq/RStudio and Seurat Analysis/3. Data Visualization via Seurat/Comparison by cell type/%s.csv", i)
  322. # Write the result to a CSV file
  323. write.csv(ident_markers, file_path, row.names = TRUE)
  324. # Print message after writing the file
  325. print(paste("File for ident", i, "written."))
  326. }
  327. marker_test_res <- top_markers(cds, group_cells_by="cell.ident", reference_cells=1000, cores=8)
  328. top_specific_markers <- marker_test_res %>%
  329. filter(fraction_expressing >= 0.5) %>%
  330. group_by(cell_group) %>%
  331. top_n(10, pseudo_R2)
  332. top_specific_marker_ids <- unique(top_specific_markers %>% pull(gene_id))
  333. top_specific_marker.int <- plot_genes_by_group(cds,
  334. top_specific_marker_ids,
  335. group_cells_by="cell.ident",
  336. ordering_type="maximal_on_diag",
  337. max.size=3)
  338. top_specific_marker.int
  339. ```
  340. ```{r Problem vs non-problem children}
  341. #all clusters with > 65% of one disc type will be classificed as that disc, clusters will 50/50 to 65/40 splits will be considered mixed.
  342. AllData.int$disc.prop <- as.factor(ifelse(AllData.int$seurat_clusters %in% c("0", "1", "3", "9", "11", "13", "14" ,"15","16","17","18","20"), "Healthy",
  343. ifelse(AllData.int$seurat_clusters %in% c("2", "4", "5", "6", "8","9", "12","19"), "Injured",
  344. ifelse(AllData.int$seurat_clusters %in% c("7","10","21"), "Mixed",""))))
  345. Idents(AllData.int) <- AllData.int$disc.prop
  346. # Find markers between groups
  347. comp <- FindMarkers(AllData.int, ident.1 = "Injured", ident.2 = "Healthy", min.pct = 0.25)
  348. # Write the markers to a CSV file
  349. write.csv(comp, file = "C:/Users/kanedag/Box/Box - Sheyn Lab/Projects/Ongoing projects/Porcine IVD/Data/scRNA Seq/RStudio and Seurat Analysis/3. Data Visualization via Seurat/Inj Vs Ctr cluster comparison.csv", row.names = TRUE)
  350. DotPlot(AllData.int, features = features_to_plot) +
  351. scale_color_gradientn(colors = rev(brewer.pal(11, "RdBu")))+
  352. theme(axis.text.x = element_text(angle = 90, hjust = 1))
  353. Idents(AllData.int) <- AllData.int$seurat_clusters
  354. ```
  355. ```{r problem children comparison}
  356. Idents(AllData.int) <- AllData.int$seurat_clusters
  357. # Define the subset of clusters to process
  358. clusters_to_process <- c("2", "4", "5", "6", "7", "10", "12")
  359. # Loop through each specified cluster
  360. for (i in clusters_to_process) {
  361. # Find markers in the current cluster compared to all other clusters in the subset
  362. cluster_markers <- FindMarkers(AllData.int, ident.1 = i, ident.2 = clusters_to_process[clusters_to_process != i], min.pct = 0.25)
  363. # Construct the file path using sprintf for organized file naming
  364. file_path <- sprintf("C:/Users/kanedag/Box/Box - Sheyn Lab/Projects/Ongoing projects/Porcine IVD/Data/scRNA Seq/RStudio and Seurat Analysis/3. Data Visualization via Seurat/Problem Children Comparison/Cluster%s.csv", i)
  365. # Write the result to a CSV file
  366. write.csv(cluster_markers, file_path, row.names = TRUE)
  367. # Print message after writing the file
  368. print(paste("File for cluster", i, "written."))
  369. }
  370. ```
  371. ```{r}
  372. DefaultAssay(AllData.int) <- "RNA"
  373. # Define gene lists (adjust if you already have them stored)
  374. EXO <- c("TSG101","PDCD6IP","VPS4A","VPS4B","CHMP2A","CHMP2B","CHMP4A","CHMP4B",
  375. "CHMP1A","CHMP1B","IST1","HGS","STAM","STAM2","RAB27A","RAB27B","RAB35",
  376. "RAB11A","RAB11B","ARF6","VAMP7","VAMP8","SNAP23","SYTL4","ANXA1","ANXA2",
  377. "CD9","CD63","CD81")
  378. CONST <- c("SAR1A","SAR1B","SEC23A","SEC23B","SEC24A","SEC24B","SEC24C","SEC24D",
  379. "SEC13","SEC31A","SEC31B","ARF1","GBF1","COPA","COPB1","COPB2","COPG1",
  380. "COPG2","COPZ1","COPZ2","SEC61A1","SEC61B","SSR1","HSPA5","DNAJB11",
  381. "STX3","STX4","VAMP3","VAMP8","SNAP23")
  382. CAV <- c("CAV1","CAV2","CAVIN1","CAVIN2","CAVIN3","EHD2")
  383. REG <- c("RAB3A","RAB3B","RAB3C","RAB3D","SYT1","SYT7","CPLX1","CPLX2","STX1A",
  384. "VAMP2","SNAP25")
  385. # Add module scores with unique names
  386. AllData.int <- AddModuleScore(AllData.int, features = list(EXO), name = "EXOscore")
  387. AllData.int <- AddModuleScore(AllData.int, features = list(CONST), name = "CONSTscore")
  388. AllData.int <- AddModuleScore(AllData.int, features = list(CAV), name = "CAVscore")
  389. AllData.int <- AddModuleScore(AllData.int, features = list(REG), name = "REGscore")
  390. # Create composite AltTraffickingScore
  391. AllData.int$AltTraffickingScore <-
  392. AllData.int$EXOscore1 + AllData.int$CONSTscore1 -
  393. AllData.int$CAVscore1 - AllData.int$REGscore1
  394. #Cell communication style by cluster
  395. scores <- FetchData(AllData.int, vars = c("seurat_clusters",
  396. "EXOscore1","CONSTscore1","CAVscore1","REGscore1","AltTraffickingScore"))
  397. avg_scores <- scores %>%
  398. group_by(seurat_clusters) %>%
  399. summarise(across(everything(), mean, na.rm = TRUE))
  400. avg_scores_long <- tidyr::pivot_longer(avg_scores,
  401. cols = -seurat_clusters,
  402. names_to = "ScoreType",
  403. values_to = "MeanScore")
  404. ggplot(avg_scores_long, aes(x = seurat_clusters, y = MeanScore, fill = ScoreType)) +
  405. geom_bar(stat="identity", position="dodge") +
  406. theme_classic() +
  407. theme(axis.text.x = element_text(angle=45, hjust=1)) +
  408. ylab("Average module score") +
  409. xlab("Cluster")
  410. #Cell communication style by cell type
  411. scores <- FetchData(AllData.int, vars = c("cell.ident",
  412. "EXOscore1","CONSTscore1","CAVscore1","REGscore1","AltTraffickingScore"))
  413. avg_scores <- scores %>%
  414. group_by(cell.ident) %>%
  415. summarise(across(everything(), mean, na.rm = TRUE))
  416. avg_scores_long <- tidyr::pivot_longer(avg_scores,
  417. cols = -cell.ident,
  418. names_to = "ScoreType",
  419. values_to = "MeanScore")
  420. ggplot(avg_scores_long, aes(x = cell.ident, y = MeanScore, fill = ScoreType)) +
  421. geom_bar(stat="identity", position="dodge") +
  422. theme_classic() +
  423. theme(axis.text.x = element_text(angle=45, hjust=1)) +
  424. ylab("Average module score") +
  425. xlab("Cluster")
  426. #Cell communication style by select cell type
  427. # Pick the identities you care about
  428. selected_idents <- c("Notochordal","Transitional Nucleus Pulposus","Nucleus Pulposus")
  429. scores <- FetchData(AllData.int, vars = c("cell.ident",
  430. "EXOscore1","CONSTscore1","CAVscore1","REGscore1","AltTraffickingScore")) %>%
  431. filter(cell.ident %in% selected_idents)
  432. avg_scores <- scores %>%
  433. group_by(cell.ident) %>%
  434. summarise(across(everything(), mean, na.rm = TRUE), .groups="drop")
  435. avg_scores_long <- pivot_longer(avg_scores,
  436. cols = -cell.ident,
  437. names_to = "ScoreType",
  438. values_to = "MeanScore")
  439. ggplot(avg_scores_long, aes(x = cell.ident, y = MeanScore, fill = ScoreType)) +
  440. geom_bar(stat="identity", position="dodge") +
  441. theme_classic() +
  442. theme(axis.text.x = element_text(angle=45, hjust=1)) +
  443. ylab("Average module score") +
  444. xlab("Cell identity")
  445. ```
  446. ```{r}
  447. NC <- DotPlot(AllData.int, features = c("TBXT","KRT8", "KRT18", "KRT19", "CD24","LGALS3","CAV1","SHH", "NOTO", "FOXA2","FOXJ1", "CHRD","NOG")) +
  448. scale_color_gradientn(colors = rev(brewer.pal(11, "RdBu"))) +
  449. theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
  450. labs(title = "Notochordal Marker Expression")
  451. NC
  452. # NP marker plot (bottom)
  453. NP <- DotPlot(AllData.int, features = c("ACAN", "COL2A1","COL3A1","COL6A1","COL9A1", "COL11A1", "DCN","MGP","COMP","TRPV4","SERPINE2","TIMP1","TIMP3", "PAX1", "SOX5", "SOX6")) +
  454. scale_color_gradientn(colors = rev(brewer.pal(11, "RdBu"))) +
  455. theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
  456. labs(title = "NP Marker Expression")
  457. NP
  458. NC + NP
  459. DotPlot(AllData.int, features = c("PECAM1", "VWF", "CDH5", "KDR", "FLT1", "ENG", "ESAM", "PLVAP", "CD34", "MCAM", "CLDN5", "TEK", "FABP4")) +
  460. scale_color_gradientn(colors = rev(brewer.pal(11, "RdBu"))) +
  461. theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
  462. labs(title = "Endothelial Cell Marker Expression")
  463. ```

2. Data Visualization with Seurat Script.qmd at commit d8bb4fc, no license · at the source

Overview

Authors: Giselle Kaneda1,2,3, Jacob T Wechsler1,2, Melissa Chavez1,2, Julia Sheyn1,2, Karandeep Cheema4,5, Chushu Shen4,5, Dante Rigo De Righi4, Lixia Wang4, Yin‐Chen Hsu4, Pablo Avalos2, Yibin Xie4, Wafa Tawackoli1,2,3,4,6,7, Candace Floyd8, Debiao Li4,5, Dmitriy Sheyn1,2,3,6,7
  1. Orthopaedic Stem Cell Research Laboratory, Cedars‐Sinai Medical Center, Los Angeles, California, USA
  2. Board of Governors Regenerative Medicine Institute, Cedars‐Sinai Medical Center, Los Angeles, California, USA
  3. Department of Biomedical Sciences, Cedars‐Sinai Medical Center, Cedars‐Sinai Medical Center, Los Angeles, California, USA
  4. Biomedical Imaging Research Institute, Cedars‐Sinai Medical Center, Los Angeles, California, USA
  5. Department of Bioengineering, University of California, Los Angeles, California, USA
  6. Department of Orthopaedics, Cedars‐Sinai Medical Center, Los Angeles, California, USA
  7. Department of Surgery, Cedars‐Sinai Medical Center, Los Angeles, California, USA
  8. Department of Emergency Medicine, Emory University, Atlanta, Georgia, USA
Institutions: Cedars-Sinai Medical Center (United States); University of California, Los Angeles (United States); Emory University (United States)
Journal: JOR spine, volume 9, issue 3, article e70200
Dates: received 13 November 2025; accepted 8 June 2026; published online 9 July 2026
Type: Research article · Language: English
License: CC BY-NC-ND
Identifiers: DOI 10.1002/jsp2.70200 · PMID 42428568 · PMCID PMC13347629 · OpenAlex W4416797438
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: genetics / omics (modality), human (organism), other (organism), pain (population), cellular / molecular (subfield)
Methods: Statistics
Keywords: biobehavioral tests, discogenic pain, intervertebral disc degeneration, low back pain, notochordal cells, nucleus pulposus, porcine model
Topic: Spine and Intervertebral Disc Pathology (Pathology and Forensic Medicine, Medicine), according to OpenAlex
Funding: NIAMS NIH HHS (R01 AR066517, R01 AR082041); NINDS NIH HHS (RF1 NS135504, R34 NS126032)
Citations: not cited yet (Europe PMC); 128 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 2 matches between paragraphs and lines of code.

gkaneda/Pig-IVD-Scripts

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: d8bb4fc3c123dbf52a58d68bb08b9507839af1f9, 18 September 2025
Languages: Quarto (4)
Size: 4 files, 4 scripts
Software Heritage: not archived
Found in: “Data Availability Statement”
Holds: 4 notebooks
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: ggplot2 (4 files), Monocle 3 (4 files), patchwork (4 files), Seurat (4 files), tidyverse (4 files), ComplexHeatmap (2 files), reticulate (2 files), igraph (1 file), pheatmap (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
4 files

The paper's code and data availability statement is in the Data section.

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

Code and data availability statement

The paper has a code and data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:

Read it in the paper: doi.org/10.1002/jsp2.70200.

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, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 15 authors, 7 keywords, 2 funders, 127 references.

Cite

This paper

Kaneda, G., Wechsler, J. T., Chavez, M., Sheyn, J., Cheema, K., Shen, C., Rigo De Righi, D., Wang, L., Hsu, Y., Avalos, P., Xie, Y., Tawackoli, W., Floyd, C., Li, D., & Sheyn, D. (2026). A Porcine Model of Intervertebral Disc Injury Recapitulates Human Discogenic Pain Via Notochordal Cell Loss and Pain-Inducing Nucleus Pulposus Cell Emergence. JOR spine, 9(3), e70200. https://doi.org/10.1002/jsp2.70200

BibTeX

@article{kaneda2026porcine,
author = {Kaneda, Giselle and Wechsler, Jacob T and Chavez, Melissa and Sheyn, Julia and Cheema, Karandeep and Shen, Chushu and Rigo De Righi, Dante and Wang, Lixia and Hsu, Yin‐Chen and Avalos, Pablo and Xie, Yibin and Tawackoli, Wafa and Floyd, Candace and Li, Debiao and Sheyn, Dmitriy},
title = {{A Porcine Model of Intervertebral Disc Injury Recapitulates Human Discogenic Pain Via Notochordal Cell Loss and Pain-Inducing Nucleus Pulposus Cell Emergence}},
journal = {JOR spine},
year = {2026},
month = jul,
volume = {9},
number = {3},
pages = {e70200},
publisher = {Wiley},
issn = {2572-1143},
doi = {10.1002/jsp2.70200},
url = {https://doi.org/10.1002/jsp2.70200},
pmid = {42428568},
pmcid = {PMC13347629}
}

RIS

TY - JOUR
AU - Kaneda, Giselle
AU - Wechsler, Jacob T
AU - Chavez, Melissa
AU - Sheyn, Julia
AU - Cheema, Karandeep
AU - Shen, Chushu
AU - Rigo De Righi, Dante
AU - Wang, Lixia
AU - Hsu, Yin‐Chen
AU - Avalos, Pablo
AU - Xie, Yibin
AU - Tawackoli, Wafa
AU - Floyd, Candace
AU - Li, Debiao
AU - Sheyn, Dmitriy
TI - A Porcine Model of Intervertebral Disc Injury Recapitulates Human Discogenic Pain Via Notochordal Cell Loss and Pain-Inducing Nucleus Pulposus Cell Emergence
T2 - JOR spine
J2 - JOR Spine
PY - 2026
DA - 2026/07/09
VL - 9
IS - 3
SP - e70200
SN - 2572-1143
PB - Wiley
DO - 10.1002/jsp2.70200
UR - https://doi.org/10.1002/jsp2.70200
LA - en
ER -

CSL-JSON

{
"id": "10.1002/jsp2.70200",
"type": "article-journal",
"title": "A Porcine Model of Intervertebral Disc Injury Recapitulates Human Discogenic Pain Via Notochordal Cell Loss and Pain-Inducing Nucleus Pulposus Cell Emergence",
"container-title": "JOR spine",
"author": [
{
"family": "Kaneda",
"given": "Giselle"
},
{
"family": "Wechsler",
"given": "Jacob T"
},
{
"family": "Chavez",
"given": "Melissa"
},
{
"family": "Sheyn",
"given": "Julia"
},
{
"family": "Cheema",
"given": "Karandeep"
},
{
"family": "Shen",
"given": "Chushu"
},
{
"family": "Rigo De Righi",
"given": "Dante"
},
{
"family": "Wang",
"given": "Lixia"
},
{
"family": "Hsu",
"given": "Yin‐Chen"
},
{
"family": "Avalos",
"given": "Pablo"
},
{
"family": "Xie",
"given": "Yibin"
},
{
"family": "Tawackoli",
"given": "Wafa"
},
{
"family": "Floyd",
"given": "Candace"
},
{
"family": "Li",
"given": "Debiao"
},
{
"family": "Sheyn",
"given": "Dmitriy"
}
],
"container-title-short": "JOR Spine",
"volume": "9",
"issue": "3",
"page": "e70200",
"DOI": "10.1002/jsp2.70200",
"PMID": "42428568",
"PMCID": "PMC13347629",
"ISSN": "2572-1143",
"publisher": "Wiley",
"URL": "https://doi.org/10.1002/jsp2.70200",
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
9
]
]
}
}

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.3390/ijms27104466 [code]
Uncovering the Key Circuit FOSL2/FOS/EGR3/EGR1, Contributing to the Hyperexcitability of Excitatory Neurons in the Epileptic Temporal Cortex and Hippocampus.
Journal: International journal of molecular sciences
In common: Monocle 3, reticulate, igraph, 6 other tools, genetics / omics, 1 reference
[2] 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, reticulate, igraph, 5 other tools, genetics / omics, cellular / molecular, 2 references
[3] 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, reticulate, igraph, 6 other tools, cellular / molecular, 1 reference
[4] doi:10.1038/s42003-026-10957-8 [code]
Brain defence by the extracellular matrix protein Cochlin.
Journal: Communications biology
In common: Monocle 3, reticulate, igraph, 6 other tools, cellular / molecular
[5] doi:10.1038/s41588-026-02737-1 [code]
Human and mouse adrenal glands are characterized by species-specific steroidogenic states and tissue turnover.
Journal: Nature genetics
In common: Monocle 3, igraph, ComplexHeatmap, 5 other tools, genetics / omics, cellular / molecular, 1 reference
[6] 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, igraph, ComplexHeatmap, 5 other tools, genetics / omics, cellular / molecular, 1 reference
[7] doi:10.1002/imt2.70163 [code]
Spatial multi-omics unveils sphingolipid metabolic reprogramming within the retinal pathological niche.
Journal: iMeta
In common: Monocle 3, igraph, ComplexHeatmap, 5 other tools, genetics / omics, cellular / molecular, 1 reference
[8] doi:10.1038/s41467-026-76675-1 [code]
Long-read proteogenomic atlas of human neuronal differentiation reveals isoform diversity informing neurodevelopmental risk mechanisms.
Journal: Nature communications
In common: Monocle 3, reticulate, igraph, 5 other tools, genetics / omics, 1 reference
[9] doi:10.1186/s13059-026-04177-w [code]
Genomic sequence evolution underlying human neocortical interareal diversification.
Journal: Genome biology
In common: Monocle 3, reticulate, igraph, 5 other tools, genetics / omics, cellular / molecular
[10] doi:10.1016/j.stemcr.2026.102997 [code]
BDNF regulates pituitary stem cell engagement toward precursor state.
Journal: Stem cell reports
In common: reticulate, igraph, ComplexHeatmap, 4 other tools, cellular / molecular, 3 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.