OSCR

NvashA function reveals temporal differences in neural subtype generation in cnidarians.

Code ↔ Paper

5 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 5 matches
  1. [1] § Materials and methods › Single-cell RNA sequencing and analysis ↔ 05_NvashA_subsetting_trajectory.Rmd, lines 51–67 · score 0.98 · Nvcnido fos1, Pharyngeal Ectoderm, NvfoxA, NvsnailA, Neural Progenitor Cells, likeE
  2. [2] § Results › Single-cell atlas of NvashA-expressing cells identifies embryonic and larval-born neuronal subtypes ↔ 05_NvashA_subsetting_trajectory.Rmd, lines 538–584 · score 0.90 · NvTBA1, n2 g1, n1 l2, n1 l3, N1.g.early, NGD.1
  3. [3] § Materials and methods › Trajectory inference and pseudotime ↔ 05_NvashA_subsetting_trajectory.Rmd, lines 1033–1153 · score 0.90 · SeuratWrappers, cluster_cells, learn_graph, clicking, interactively, nodes
  4. [4] § Results › Larval neurons spatially overlap with previously identified neuronal domains along the oral-aboral axis ↔ 05_NvashA_subsetting_trajectory.Rmd, lines 538–584 · score 0.78 · n1 l1, n2 g1, NGD.1, Nv2.1205, Nv2.2620, axis
  5. [5] § Results › Single-cell atlas of NvashA-expressing cells identifies embryonic and larval-born neuronal subtypes ↔ 05_NvashA_subsetting_trajectory.Rmd, lines 317–331 · score 0.56 · neuron.gast, neuron.pl, trajectory, gland, cnidocyte, NvashA

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 Markdown · 1,242 lines · 63 KB · no license · 5 matches

  1. ---
  2. title: "ashA figures for pub"
  3. output: html_document
  4. date: "2024-10-07"
  5. ---
  6. ```{r}
  7. library(dplyr)
  8. library(Seurat)
  9. library(patchwork)
  10. library(ggplot2)
  11. library(janitor)
  12. library(sctransform)
  13. library(DoubletFinder)
  14. library(glmGamPoi)
  15. library(BiocManager)
  16. library(multtest)
  17. library(metap)
  18. library(scCustomize)
  19. library(qs)
  20. library(igraph)
  21. library(tidyr)
  22. library(magrittr)
  23. ```
  24. # Supplemental Figure 1
  25. #gastrula stage
  26. ```{r}
  27. Stella_combined_filt_gastrula <- FindNeighbors(Stella_combined_filt20dim, dims = 1:20)
  28. Stella_combined_filt_gastrula <- FindClusters(Stella_combined_filt_gastrula, resolution = 1)
  29. Stella_combined_filt_gastrula <- RunUMAP(Stella_combined_filt_gastrula, dims = 1:20, verbose = FALSE)
  30. DimPlot(Stella_combined_filt_gastrula, reduction = "umap", label = FALSE, pt.size = 0.005, label.size = 5)
  31. ```
  32. ```{r}
  33. library(magrittr)
  34. [email hidden] %<>%
  35. mutate(CombinedCluster = case_when(seurat_clusters %in% c(13, 14, 27) ~ "Gland",
  36. seurat_clusters %in% c(25, 16, 20, 29, 30, 23, 10, 19) ~ "Cnidocyte",
  37. seurat_clusters %in% c(11) ~ "Neural Progenitor Cell",
  38. seurat_clusters %in% c(17, 18, 28) ~ "Neuron",
  39. seurat_clusters %in% c(5) ~ "Pharyngeal Ectoderm",
  40. seurat_clusters %in% c(3, 7, 26) ~ "Mesendoderm",
  41. seurat_clusters %in% c(1, 2, 24, 6, 9, 22, 8, 21, 15, 0, 4, 12) ~ "Trunk/Aboral Ectoderm"))
  42. [email hidden]$CombinedCluster <- factor([email hidden]$CombinedCluster, levels = c("Gland", "Cnidocyte", "Neural Progenitor Cell", "Neuron", "Pharyngeal Ectoderm", "Mesendoderm", "Trunk/Aboral Ectoderm"))
  43. Stella_combined_filt_gastrula <- SetIdent(Stella_combined_filt_gastrula, value = [email hidden]$CombinedCluster)
  44. ```
  45. #Need to set the active ident. CombinedCluster is the combined and named clusters from above. seurat_clusters is the original cluster numbers
  46. ```{r}
  47. p5<-DimPlot(Stella_combined_filt_gastrula, reduction = "umap", label = FALSE, pt.size = 0.1, label.size = 6)
  48. p5
  49. [email hidden]$CombinedCluster <- factor([email hidden]$CombinedCluster, levels = c("Gland", "Cnidocyte", "Neural Progenitor Cell", "Neuron", "Pharyngeal Ectoderm", "Mesendoderm", "Trunk/Aboral Ectoderm"))
  50. Stella_combined_filt_gastrula <- SetIdent(Stella_combined_filt_gastrula, value = [email hidden]$CombinedCluster)
  51. list_of_genes <- c("NV2g012902000.1", "NV2g018581000.1", "NV2g019749000.1", "NV2g010686000.1", "NV2g016402000.1", "NV2g004477000.1", "NV2g006608000.1", "NV2g009665000.1", "NV2g000252000.1", "NV2g011441000.1", "NV2g000472000.1", "NV2g003168000.1", "NV2g012726000.1")
  52. library(patchwork)
  53. plt <- DotPlot(Stella_combined_filt_gastrula, features = list_of_genes) + RotatedAxis() + theme(axis.text.x = element_text(angle = 90)) + FontSize(10)
  54. plt <- plt + scale_x_discrete(labels = expression(italic("Nvmucin"), italic("Nvnot-likeE"), italic("Nvcnido-fos1"), italic("Nvncol3"), italic("NvsoxC"), italic("NvsoxB(2)"), italic("Nvath-like"), italic("NvashA"), italic("Nvelav1"), italic("NvfoxA"), italic("NvsnailA"), italic("Nvwnt2"), italic("Nvsix3/6")))
  55. plt <- plt + ggtitle('Marker genes gastrula annotation')
  56. plt
  57. ```
  58. ```{r, fig.width = 5, fig.height = 4}
  59. # identify your favorite gene in the UMAP plot
  60. goi <- "NV2g009665000.1"
  61. p5 <- FeaturePlot_scCustom(seurat_object = Stella_combined_filt_gastrula, features = goi, pt.size = 0.0005)
  62. p5 <- p5 + ggtitle("NvashA in gastrula")
  63. p5
  64. ```
  65. #early planula
  66. ```{r}
  67. Stella_early_pl
  68. dim(Stella_early_pl)
  69. ncol(Stella_early_pl)
  70. ```
  71. ```{r}
  72. Stella_early_pl <- FindNeighbors(Stella_early_pl_raw, dims = 1:20)
  73. Stella_early_pl <- FindClusters(Stella_early_pl, resolution = 1)
  74. Stella_early_pl <- RunUMAP(Stella_early_pl, dims = 1:20, verbose = FALSE)
  75. DimPlot(Stella_early_pl, reduction = "umap")
  76. ```
  77. ```{r}
  78. library(magrittr)
  79. [email hidden] %<>%
  80. mutate(CombinedCluster = case_when(seurat_clusters %in% c(7, 16) ~ "Gland",
  81. seurat_clusters %in% c(18, 19, 20, 11) ~ "Cnidocyte",
  82. seurat_clusters %in% c(14, 12) ~ "Neural Progenitor Cell",
  83. seurat_clusters %in% c(15, 22) ~ "Neuron",
  84. seurat_clusters %in% c(8, 24, 21) ~ "Pharyngeal Ectoderm",
  85. seurat_clusters %in% c(6) ~ "Mesendoderm",
  86. seurat_clusters %in% c(0, 1, 2, 3, 4, 5, 9, 10, 13, 17, 23) ~ "Trunk/Aboral Ectoderm"))
  87. [email hidden]$CombinedCluster <- factor([email hidden]$CombinedCluster, levels = c("Gland", "Cnidocyte", "Neural Progenitor Cell", "Neuron", "Pharyngeal Ectoderm", "Mesendoderm", "Trunk/Aboral Ectoderm"))
  88. Stella_early_pl <- SetIdent(Stella_early_pl, value = [email hidden]$CombinedCluster)
  89. ```
  90. ```{r}
  91. p5<-DimPlot(Stella_early_pl, reduction = "umap", label = FALSE, pt.size = 0.1, label.size = 6)
  92. p5
  93. [email hidden]$CombinedCluster <- factor([email hidden]$CombinedCluster, levels = c("Gland", "Cnidocyte", "Neural Progenitor Cell", "Neuron", "Pharyngeal Ectoderm", "Mesendoderm", "Trunk/Aboral Ectoderm"))
  94. Stella_early_pl <- SetIdent(Stella_early_pl, value = [email hidden]$CombinedCluster)
  95. list_of_genes <- c("NV2g012902000.1", "NV2g018581000.1", "NV2g019749000.1", "NV2g010686000.1", "NV2g016402000.1", "NV2g004477000.1", "NV2g006608000.1", "NV2g009665000.1", "NV2g000252000.1", "NV2g011441000.1", "NV2g000472000.1", "NV2g003168000.1", "NV2g012726000.1")
  96. plt <- DotPlot(Stella_early_pl, features = list_of_genes) + RotatedAxis() + theme(axis.text.x = element_text(angle = 90)) + FontSize(10)
  97. plt <- plt + scale_x_discrete(labels = expression(italic("Nvmucin"), italic("Nvnot-likeE"), italic("Nvcnido-fos1"), italic("Nvncol3"), italic("NvsoxC"), italic("NvsoxB(2)"), italic("Nvath-like"), italic("NvashA"), italic("Nvelav1"), italic("NvfoxA"), italic("NvsnailA"), italic("Nvwnt2"), italic("Nvsix3/6")))
  98. plt <- plt + ggtitle('Marker genes early planula annotation')
  99. plt
  100. ```
  101. ```{r}
  102. goi <- "NV2g009665000.1" #
  103. p5 <- FeaturePlot_scCustom(seurat_object = Stella_early_pl, features = goi, pt.size = 0.0005)
  104. p5 <- p5 + ggtitle("NvashA in early planula")
  105. p5
  106. ```
  107. #mid planula
  108. ```{r}
  109. [email hidden] %<>%
  110. mutate(CombinedCluster = case_when(seurat_clusters %in% c(10) ~ "Gland",
  111. seurat_clusters %in% c(17, 15, 9) ~ "Cnidocyte",
  112. seurat_clusters %in% c(6, 16) ~ "Neural Progenitor Cell",
  113. seurat_clusters %in% c(12, 20) ~ "Neuron",
  114. seurat_clusters %in% c(5, 19, 18) ~ "Pharyngeal Ectoderm",
  115. seurat_clusters %in% c(13) ~ "Mesendoderm",
  116. seurat_clusters %in% c(0, 1, 2, 3, 4, 7, 8, 11, 14) ~ "Trunk/Aboral Ectoderm"))
  117. [email hidden]$CombinedCluster <- factor([email hidden]$CombinedCluster, levels = c("Gland", "Cnidocyte", "Neural Progenitor Cell", "Neuron", "Pharyngeal Ectoderm", "Mesendoderm", "Trunk/Aboral Ectoderm"))
  118. Stella_mid_pl <- SetIdent(Stella_mid_pl, value = [email hidden]$CombinedCluster)
  119. ```
  120. ```{r}
  121. p5<-DimPlot(Stella_mid_pl, reduction = "umap", label = FALSE, pt.size = 0.1, label.size = 6)
  122. p5
  123. [email hidden]$CombinedCluster <- factor([email hidden]$CombinedCluster, levels = c("Gland", "Cnidocyte", "Neural Progenitor Cell", "Neuron", "Pharyngeal Ectoderm", "Mesendoderm", "Trunk/Aboral Ectoderm"))
  124. Stella_mid_pl <- SetIdent(Stella_mid_pl, value = [email hidden]$CombinedCluster)
  125. list_of_genes <- c("NV2g012902000.1", "NV2g018581000.1", "NV2g019749000.1", "NV2g010686000.1", "NV2g016402000.1", "NV2g004477000.1", "NV2g006608000.1", "NV2g009665000.1", "NV2g000252000.1", "NV2g011441000.1", "NV2g000472000.1", "NV2g003168000.1", "NV2g012726000.1")
  126. plt <- DotPlot(Stella_mid_pl, features = list_of_genes) + RotatedAxis() + theme(axis.text.x = element_text(angle = 90)) + FontSize(10)
  127. plt <- plt + scale_x_discrete(labels = expression(italic("Nvmucin"), italic("Nvnot-likeE"), italic("Nvcnido-fos1"), italic("Nvncol3"), italic("NvsoxC"), italic("NvsoxB(2)"), italic("Nvath-like"), italic("NvashA"), italic("Nvelav1"), italic("NvfoxA"), italic("NvsnailA"), italic("Nvwnt2"), italic("Nvsix3/6")))
  128. plt <- plt + ggtitle('Marker genes mid planula annotation')
  129. plt
  130. ```
  131. ```{r}
  132. goi <- "NV2g009665000.1"
  133. p5 <- FeaturePlot_scCustom(seurat_object = Stella_mid_pl, features = goi, pt.size = 0.0005)
  134. p5 <- p5 + ggtitle("NvashA in mid planula")
  135. p5
  136. ```
  137. #late planula
  138. #grouping clusters and cluster identification
  139. ```{r}
  140. library(magrittr)
  141. [email hidden] %<>%
  142. mutate(CombinedCluster = case_when(seurat_clusters %in% c(10, 31) ~ "Gland",
  143. seurat_clusters %in% c(14, 21, 20, 22, 30, 18) ~ "Cnidocyte",
  144. seurat_clusters %in% c(13, 19) ~ "Neural Progenitor Cell",
  145. seurat_clusters %in% c(3, 32, 28, 27, 23) ~ "Neuron",
  146. seurat_clusters %in% c(8, 12, 25, 17, 15) ~ "Pharyngeal Ectoderm",
  147. seurat_clusters %in% c(7) ~ "Mesendoderm",
  148. seurat_clusters %in% c(0, 1, 2, 4, 5, 6, 9, 11, 16, 24, 26, 29) ~ "Trunk/Aboral Ectoderm"))
  149. [email hidden]$CombinedCluster <- factor([email hidden]$CombinedCluster, levels = c("Gland", "Cnidocyte", "Neural Progenitor Cell", "Neuron", "Pharyngeal Ectoderm", "Mesendoderm", "Trunk/Aboral Ectoderm"))
  150. Stella_late_pl <- SetIdent(Stella_late_pl, value = [email hidden]$CombinedCluster)
  151. ```
  152. #late planula- annotation figure for pub
  153. ```{r}
  154. p5<-DimPlot(Stella_late_pl, reduction = "umap", label = FALSE, pt.size = 0.1, label.size = 6)
  155. p5
  156. [email hidden]$CombinedCluster <- factor([email hidden]$CombinedCluster, levels = c("Gland", "Cnidocyte", "Neural Progenitor Cell", "Neuron", "Pharyngeal Ectoderm", "Mesendoderm", "Trunk/Aboral Ectoderm"))
  157. Stella_late_pl <- SetIdent(Stella_late_pl, value = [email hidden]$CombinedCluster)
  158. list_of_genes <- c("NV2g012902000.1", "NV2g018581000.1", "NV2g019749000.1", "NV2g010686000.1", "NV2g016402000.1", "NV2g004477000.1", "NV2g006608000.1", "NV2g009665000.1", "NV2g000252000.1", "NV2g011441000.1", "NV2g000472000.1", "NV2g003168000.1", "NV2g012726000.1")
  159. plt <- DotPlot(Stella_late_pl, features = list_of_genes) + RotatedAxis() + theme(axis.text.x = element_text(angle = 90)) + FontSize(10)
  160. plt <- plt + scale_x_discrete(labels = expression(italic("Nvmucin"), italic("Nvnot-likeE"), italic("Nvcnido-fos1"), italic("Nvncol3"), italic("NvsoxC"), italic("NvsoxB(2)"), italic("Nvath-like"), italic("NvashA"), italic("Nvelav1"), italic("NvfoxA"), italic("NvsnailA"), italic("Nvwnt2"), italic("Nvsix3/6")))
  161. plt <- plt + ggtitle('Marker genes late planula annotation')
  162. plt
  163. ```
  164. ```{r}
  165. goi <- "NV2g009665000.1"
  166. p5 <- FeaturePlot_scCustom(seurat_object = Stella_late_pl, features = goi, pt.size = 0.0005)
  167. p5 <- p5 + ggtitle("NvashA in late planula")
  168. p5
  169. ```
  170. # Figure 1
  171. # new ashA analysis on subsetted objects
  172. ```{r}
  173. DATA_DIR <- "ashA_combined/data"
  174. RESULTS_DIR <- "ashA_combined/results"
  175. ```
  176. # Subsetting NvashA + cells from each timepoint
  177. ```{r}
  178. #gastrula
  179. R1 <- RidgePlot(object = Stella_combined_filt_gastrula, features = 'NV2g009665000.1')
  180. R1 <- R1 + ggtitle('NvashA expression levels across each cluster at gastrula')
  181. R1
  182. ashA_gastrula <- subset(Stella_combined_filt_gastrula, subset = `NV2g009665000.1` > 0.65)
  183. dim(ashA_gastrula); dim(Stella_combined_filt_gastrula) # cells express NvashA
  184. save(ashA_gastrula, file = file.path(DATA_DIR, "ashA_gastrula.Rda"))
  185. ```
  186. ```{r}
  187. #early planula
  188. R1 <- RidgePlot(object = Stella_early_pl, features = 'NV2g009665000.1')
  189. R1 <- R1 + ggtitle('NvashA expression levels across each cluster at early planula')
  190. R1
  191. ashA_early_pl <- subset(Stella_early_pl, subset = `NV2g009665000.1` > 0.65)
  192. dim(ashA_early_pl); dim(Stella_early_pl) # cells express NvashA
  193. save(ashA_early_pl, file = file.path(DATA_DIR, "ashA_early_pl.Rda"))
  194. ```
  195. ```{r}
  196. #mid planula
  197. R1 <- RidgePlot(object = Stella_mid_pl, features = 'NV2g009665000.1')
  198. R1 <- R1 + ggtitle('NvashA expression levels across each cluster at mid planula')
  199. R1
  200. ashA_mid_pl <- subset(Stella_mid_pl, subset = `NV2g009665000.1` > 0.65)
  201. dim(ashA_mid_pl); dim(Stella_mid_pl) # cells express NvashA
  202. save(ashA_mid_pl, file = file.path(DATA_DIR, "ashA_mid_pl.Rda"))
  203. ```
  204. ```{r}
  205. #late planula
  206. R1 <- RidgePlot(object = Stella_late_pl, features = 'NV2g009665000.1')
  207. R1 <- R1 + ggtitle('NvashA expression levels across each cluster at late planula')
  208. R1
  209. ashA_late_pl <- subset(Stella_late_pl, subset = `NV2g009665000.1` > 0.65)
  210. dim(ashA_late_pl); dim(Stella_late_pl) # cells express NvashA
  211. save(ashA_late_pl, file = file.path(DATA_DIR, "ashA_late_pl.Rda"))
  212. ```
  213. # merge all files and make "timepoint" identity
  214. ```{r}
  215. ashA_combinedv4 <-merge(x = ashA_gastrula, y = list(ashA_early_pl, ashA_mid_pl, ashA_late_pl), add.cell.ids = c("gastrula", "early planula", "mid planula", "late planula"))
  216. ```
  217. ```{r}
  218. ids <- rownames([email hidden])
  219. table(stringr::str_split_fixed(string = ids, pattern = "_", n = 3)[,1])
  220. timepoint <- stringr::str_split_fixed(string = ids, pattern = "_", n = 3)[,1]
  221. [email hidden]$timepoint <- timepoint
  222. Idents(ashA_combinedv4) <- "timepoint"
  223. Idents(ashA_combinedv4)
  224. ```
  225. #analysis of merged NvashA subset data
  226. ```{r}
  227. ashA_combinedv4_20dims <- FindNeighbors(ashA_combinedv4, dims = 1:20)
  228. ashA_combinedv4_20dims <- FindClusters(ashA_combinedv4_20dims, resolution = 1)
  229. head(Idents(ashA_combinedv4_20dims), 10)
  230. ashA_combinedv4_20dims <- RunUMAP(ashA_combinedv4_20dims, dims = 1:20, verbose = FALSE)
  231. p1.ashA <- DimPlot(ashA_combinedv4_20dims, reduction = "umap", group.by = "timepoint", label = FALSE, pt.size = 0.1, label.size = 5)
  232. p2.ashA <- DimPlot(ashA_combinedv4_20dims, reduction = "umap",group.by = "orig.ident" , pt.size = 0.1)
  233. p3.ashA <- DimPlot(ashA_combinedv4_20dims, reduction = "umap", label = TRUE, pt.size = 0.1, label.size = 8)
  234. p4.ashA <- DimPlot(ashA_combinedv4_20dims, reduction = "umap", label = FALSE, pt.size = 0.1, label.size = 8)
  235. p1.ashA
  236. p2.ashA
  237. p3.ashA
  238. p4.ashA
  239. ```
  240. # figure for annotation of NvashA clusters - DotPlot
  241. ```{r fig.width = 3, fig.height = 3}
  242. ashA_combinedv4_20dims <- SetIdent(ashA_combinedv4_20dims, value = [email hidden]$seurat_clusters)
  243. [email hidden] <- factor([email hidden],
  244. levels = c("16", "4", "3", "10", "12", "1", "15", "20", "6", "9", "11", "13", "5",
  245. "2", "0", "7",
  246. "14", "18", "17", "22", "21", "19", "8"))
  247. list_of_genes <- c("NV2g012902000.1", "NV2g018581000.1", "NV2g019749000.1", "NV2g010686000.1", "NV2g010927000.1", "NV2g018311000.1", "NV2g007706000.1", "NV2g001852000.1", "NV2g016402000.1", "NV2g004477000.1", "NV2g006608000.1", "NV2g000252000.1","NV2g002719000.1", "NV2g015023000.1")
  248. plt <- DotPlot(ashA_combinedv4_20dims, features = list_of_genes) + RotatedAxis() + theme(axis.text.x = element_text(angle = 90)) + FontSize(10)
  249. plt <- plt + scale_x_discrete(labels = expression(italic("Nvmucin"), italic("Nvnot-likeE"), italic("Nvcnido-fos1"), italic("Nvncol3"), italic("Nvshk1"), italic("Nv2.18311"), italic("Nvnh2l1-like-1"), italic("Nvdmrt-E"), italic("NvsoxC"), italic("NvsoxB2"), italic("Nvath-like"), italic("Nvelav1"), italic("NvTBA1-like7"), italic("Nve429")))
  250. plt <- plt + ggtitle('Marker genes across each cluster in NvashA subset')
  251. plt
  252. ```
  253. #Grouping clusters - NvashA subset
  254. #Need to set the active ident. CombinedCluster is the combined and named clusters from above. seurat_clusters is the original cluster numbers
  255. ```{r}
  256. library(magrittr)
  257. [email hidden] %<>%
  258. mutate(CombinedCluster = case_when(seurat_clusters %in% c(12, 10, 3, 4) ~ "cnidocyte",
  259. seurat_clusters %in% c(16) ~ "gland",
  260. seurat_clusters %in% c(1, 15, 20) ~ "cni.gast",
  261. seurat_clusters %in% c(6, 9, 13, 11, 5) ~ "neuron.gast-pl",
  262. seurat_clusters %in% c(2, 0, 7, 14, 17, 18, 19, 21, 22) ~ "neuron.pl",
  263. #seurat_clusters %in% c(8) ~ "unknown"
  264. ))
  265. [email hidden]$CombinedCluster <- factor([email hidden]$CombinedCluster, levels = c("gland", "cnidocyte", "cni.gast", "neuron.gast-pl", "neuron.pl"))
  266. ashA_combinedv4_20dims <- SetIdent(ashA_combinedv4_20dims, value = [email hidden]$CombinedCluster)
  267. ```
  268. ```{r}
  269. p5.ashA_20<-DimPlot(ashA_combinedv4_20dims, reduction = "umap", label = FALSE, pt.size = 0.1, label.size = 6)
  270. p5.ashA_20
  271. ```
  272. # Supplemental Figure 2
  273. # make UMAPs for all genes at once
  274. ```{r}
  275. list_of_genes <- c("NV2g006608000.1", "NV2g004477000.1", "NV2g016402000.1", "NV2g000252000.1","NV2g002719000.1", "NV2g015023000.1")
  276. list_of_names <- c( "Nvath-like", "NvsoxB(2)", "NvsoxC", "Nvelav1", "Nvtba1-like7", "NVE490")
  277. if(length(list_of_names) == length(list_of_genes)){
  278. for(i in 1:length(list_of_genes)){
  279. plt <- FeaturePlot_scCustom(ashA_combinedv4_20dims, features = list_of_genes[i], pt.size = 0.005)
  280. plt <- plt + ggtitle(list_of_names[i])
  281. print(plt)
  282. ggsave(plt, file = paste0("/ashA_combined/umaps/", list_of_names[i], "-umap.jpg"), device = "jpg", width = 5, height = 4)
  283. }
  284. } else {
  285. message("Error! - fix your names/ids!")
  286. }
  287. ```
  288. # Extract colors for timepoints
  289. ```{r}
  290. p1.ashA <- DimPlot(ashA_combinedv4_20dims, reduction = "umap", group.by = "timepoint", label = FALSE, pt.size = 0.1, label.size = 5)
  291. # extract colors
  292. p <- ggplot_build(p1.ashA)
  293. colors <- unique(p$data[[1]]$colour)
  294. library(magrittr)
  295. [email hidden] %<>%
  296. mutate(colorG = ifelse(timepoint == "gastrula", colors[1], "grey50"),
  297. colorEP = ifelse(timepoint == "early planula", colors[2], "grey50"),
  298. colorMP = ifelse(timepoint == "mid planula", colors[3], "grey50"),
  299. colorLP = ifelse(timepoint == "late planula", colors[4], "grey50"))
  300. p1.ashA_G <- DimPlot(ashA_combinedv4_20dims, reduction = "umap", group.by = "colorG",
  301. label = FALSE, pt.size = 0.1, label.size = 5, cols = c(colors[1], "grey80"))
  302. p1.ashA_G <- p1.ashA_G + NoLegend() + ggtitle("gastrula")
  303. p1.ashA_G
  304. ggsave(filename = "p1ashA_G.jpg", plot = p1.ashA_24, height = 4, width = 5)
  305. p1.ashA_EP <- DimPlot(ashA_combinedv4_20dims, reduction = "umap", group.by = "colorEP",
  306. label = FALSE, pt.size = 0.1, label.size = 5, cols = c(colors[2], "grey80"))
  307. p1.ashA_EP <- p1.ashA_EP + NoLegend() + ggtitle("early planula")
  308. p1.ashA_EP
  309. ggsave(filename = "p1ashA_EP.jpg", plot = p1.ashA_EP, height = 4, width = 5)
  310. p1.ashA_MP <- DimPlot(ashA_combinedv4_20dims, reduction = "umap", group.by = "colorMP",
  311. label = FALSE, pt.size = 0.1, label.size = 5, cols = c(colors[3], "grey80"))
  312. p1.ashA_MP <- p1.ashA_MP + NoLegend() + ggtitle("mid planula")
  313. p1.ashA_MP
  314. ggsave(filename = "p1ashA_MP.jpg", plot = p1.ashA_MP, height = 4, width = 5)
  315. p1.ashA_LP <- DimPlot(ashA_combinedv4_20dims, reduction = "umap", group.by = "colorLP",
  316. label = FALSE, pt.size = 0.1, label.size = 5, cols = c(colors[4], "grey80"))
  317. p1.ashA_LP <- p1.ashA_LP + NoLegend() + ggtitle("late planula")
  318. p1.ashA_LP
  319. ggsave(filename = "p1ashA_LP.jpg", plot = p1.ashA_LP, height = 4, width = 5)
  320. ```
  321. # Supplemental Figure 3
  322. # Find DEGs
  323. ```{r}
  324. markers_ashA_combinedv4_20dims <- FindAllMarkers(ashA_combinedv4_20dims)
  325. library(rio)
  326. library(dplyr)
  327. markers_ashA_combinedv4_20dims %>%
  328. tibble::rownames_to_column("gene_id") %>%
  329. rio::export(., file = "/markers_ashA_combinedv4_20dims.csv")
  330. ```
  331. # Determine if the markers are unique markers. Genes = all neural from ashA FindAllMarkers top genes
  332. ```{r fig.width = 8, fig.height = 3}
  333. ashA_combinedv4_20dims <- SetIdent(ashA_combinedv4_20dims, value = [email hidden]$seurat_clusters)
  334. [email hidden] <- factor([email hidden],
  335. levels = c("16", "4", "3", "10", "12", "1", "15", "20", "6", "9", "11", "13", "5",
  336. "2", "0", "7",
  337. "14", "18", "17", "22", "19", "21", "8"))
  338. list_of_genes <- c("NV2g016299000.1", "NV2g014774000.1", "NV2g012706000.1", "NV2g005875000.1", "NV2g014348000.1", #6
  339. "NV2g021230000.1", "NV2g014384000.1", "NV2g003558000.1", "NV2g023233000.1", "NV2g018400000.1", #9
  340. "NV2g011343000.1", "NV2g024863000.1", "NV2g025171000.1", "NV2g015162000.1", "NV2g024857000.1", #11
  341. "NV2g011772000.1", "NV2g014153000.1", "NV2g025073000.1", "NV2g004915000.1", "NV2g021248000.1", #13
  342. "NV2g021302000.1", "NV2g021840000.1", "NV2g024129000.1", "NV2g023280000.1", "NV2g001446000.1", #5
  343. "NV2g014792000.1", "NV2g003097000.1", "NV2g016402000.1", "NV2g013863000.1", "NV2g004360000.1", #2
  344. "NV2g007811000.1", "NV2g023729000.1", "NV2g010520000.1", "NV2g005103000.1", "NV2g003747000.1", #0
  345. "NV2g024838000.1", "NV2g017174000.1", "NV2g008406000.1", "NV2g023195000.1", "NV2g016035000.1", #7
  346. "NV2g007753000.1", "NV2g001757000.1", "NV2g004704000.1", "NV2g004096000.1", "NV2g007867000.1", #14
  347. "NV2g015930000.1", "NV2g002620000.1", "NV2g002627000.1", "NV2g002623000.1", "NV2g020225000.1", #18
  348. "NV2g001999000.1", "NV2g011608000.1", "NV2g015217000.1", "NV2g015222000.1", "NV2g017107000.1", #17
  349. "NV2g021058000.1", "NV2g013128000.1", "NV2g016346000.1", "NV2g014663000.1", "NV2g009262000.1", #22
  350. "NV2g018588000.1", "NV2g003875000.1", "NV2g015362000.1", "NV2g015156000.1", "NV2g015982000.1", #19
  351. "NV2g001204000.1", "NV2g001205000.1", "NV2g007735000.1", "NV2g018362000.1", "NV2g020402000.1", #21
  352. "NV2g014532000.1", "NV2g002896000.1", "NV2g013603000.1", "NV2g004414000.1", "NV2g009834000.1" #8
  353. )
  354. plt4 <- DotPlot(ashA_combinedv4_20dims, features = list_of_genes) + RotatedAxis() + theme(axis.text.x = element_text(angle = 90)) + FontSize(10)
  355. plt4 <- plt4 + scale_x_discrete(labels = expression(
  356. italic("Nvprga"), italic("Nv2.14774"), italic("Nv2.12706"), italic("Nv2.5875"), italic("Nvpapss-like-1"), #6
  357. italic("Nvats6-like-7"), italic("Nv2.14384"), italic("Nv2.3558"), italic("Nv2.23233"), italic("Nvdd3-like-2"), #9
  358. italic("Nvaa2BR-like-2"), italic("Nvmuc1-like-2"), italic("Nvegfl8-like-1"), italic("Nv2.15162"), italic("Nvvwa7-like-2"), #11
  359. italic("Nvblml2-like-1"), italic("Nv2.14153"), italic("Nvaa3R-like-7"), italic("Nvtaar6-like-2"), italic("Nv2.21248"), #13
  360. italic("Nvprga-R.199"), italic("Nv2.21840"), italic("Nvshb-like-6"), italic("Nvgr101-like-10"), italic("Nv2.1446"), #5
  361. italic("Nvrl12-like-1"), italic("Nvrs3A-like-1"), italic("NvsoxC"), italic("Nv2.13863"), italic("Nvrl13-like-1"), #2
  362. italic("Nv2.7811"), italic("Nv2.23729"), italic("Nv2.10520"), italic("Nv2.5103"), italic("Nv2.3747"), #0
  363. italic("Nv2.24838"), italic("Nvaebp1-like-1"), italic("Nvats7-like-1"), italic("Nvlox5-like-3"), italic("Nvnas4-like-2"), #7
  364. italic("Nvviaat-like-40"), italic("Nvfez"), italic("NvCNTP1-like-14"), italic("NvSC6A1-like-9"), italic("Nvbtn1-like-6"), #14
  365. italic("Nv2.15930"), italic("Nv2.2620"), italic("Nv2.2627"), italic("Nv2.2623"), italic("Nv2.20225"), #18
  366. italic("Nvviaat-like-31"), italic("Nvbha15-like-1"), italic("Nv2.15217"), italic("Nv2.15222"), italic("Nvnr1BA-like-1"), #17
  367. italic("Nv2.21058"), italic("Nvaa2AR-like-3"), italic("Nvopn4-like-13"), italic("Nv2.14663"), italic("Nv2.9262"), #22
  368. italic("Nvach10-like-11"), italic("Nvqrfpr-like-31"), italic("Nvhce2-like-1"), italic("Nv.15156"), italic("Nv2.15982"), #19
  369. italic("Nv2.1204"), italic("Nv2.1205"), italic("Nvopn4B-like-6"), italic("Nvadrb2-like-40"), italic("Nvcckar-like-2"), #21
  370. italic("Nv2.14532"), italic("Nvtda6-like-1"), italic("Nvgp2-like-44"), italic("Nv2.4414"), italic("Nv2.9834") #8
  371. ))
  372. plt4 <- plt4 + ggtitle('top 5 DEGs from each cluster on NvashA subset')
  373. plt4
  374. ggsave(plt4, file = "/top_markers_ashA_DEGs.jpg", width = 20, height =8)
  375. ```
  376. # top 5 NvashA markers (DEGs) on late planula dataset
  377. ```{r}
  378. library(magrittr)
  379. [email hidden] %<>%
  380. mutate(CombinedCluster = case_when(seurat_clusters %in% c(10, 31) ~ "Gland",
  381. seurat_clusters %in% c(14, 21, 20, 22, 30, 18) ~ "Cnidocyte",
  382. seurat_clusters %in% c(13, 19) ~ "Neural Progenitor Cell",
  383. seurat_clusters %in% c(3, 32, 28, 27, 23) ~ "Neuron",
  384. seurat_clusters %in% c(8, 12, 25, 17, 15) ~ "Pharyngeal Ectoderm",
  385. seurat_clusters %in% c(7) ~ "Mesendoderm",
  386. seurat_clusters %in% c(0, 1, 2, 4, 5, 6, 9, 11, 16, 24, 26, 29) ~ "Trunk/Aboral Ectoderm"))
  387. [email hidden]$CombinedCluster <- factor([email hidden]$CombinedCluster, levels = c("Gland", "Cnidocyte", "Neural Progenitor Cell", "Neuron", "Pharyngeal Ectoderm", "Mesendoderm", "Trunk/Aboral Ectoderm"))
  388. Stella_late_pl <- SetIdent(Stella_late_pl, value = [email hidden]$CombinedCluster)
  389. ```
  390. #Need to set the active ident. CombinedCluster is the combined and named clusters. seurat_clusters is the original cluster numbers ***used in paper
  391. ```{r, fig.width = 20, fig.height = 5}
  392. [email hidden]$CombinedCluster <- factor([email hidden]$CombinedCluster, levels = c("Gland", "Cnidocyte", "Neural Progenitor Cell", "Neuron", "Pharyngeal Ectoderm", "Mesendoderm", "Trunk/Aboral Ectoderm"))
  393. Stella_late_pl <- SetIdent(Stella_late_pl, value = [email hidden]$CombinedCluster)
  394. list_of_genes <- c("NV2g016299000.1", "NV2g014774000.1", "NV2g012706000.1", "NV2g005875000.1", "NV2g014348000.1", #6
  395. "NV2g021230000.1", "NV2g014384000.1", "NV2g003558000.1", "NV2g023233000.1", "NV2g018400000.1", #9
  396. "NV2g011343000.1", "NV2g024863000.1", "NV2g025171000.1", "NV2g015162000.1", "NV2g024857000.1", #11
  397. "NV2g011772000.1", "NV2g014153000.1", "NV2g025073000.1", "NV2g004915000.1", "NV2g021248000.1", #13
  398. "NV2g021302000.1", "NV2g021840000.1", "NV2g024129000.1", "NV2g023280000.1", "NV2g001446000.1", #5
  399. "NV2g014792000.1", "NV2g003097000.1", "NV2g016402000.1", "NV2g013863000.1", "NV2g004360000.1", #2
  400. "NV2g007811000.1", "NV2g023729000.1", "NV2g010520000.1", "NV2g005103000.1", "NV2g003747000.1", #0
  401. "NV2g024838000.1", "NV2g017174000.1", "NV2g008406000.1", "NV2g023195000.1", "NV2g016035000.1", #7
  402. "NV2g007753000.1", "NV2g001757000.1", "NV2g004704000.1", "NV2g004096000.1", "NV2g007867000.1", #14
  403. "NV2g015930000.1", "NV2g002620000.1", "NV2g002627000.1", "NV2g002623000.1", "NV2g020225000.1", #18
  404. "NV2g001999000.1", "NV2g011608000.1", "NV2g015217000.1", "NV2g015222000.1", "NV2g017107000.1", #17
  405. "NV2g021058000.1", "NV2g013128000.1", "NV2g016346000.1", "NV2g014663000.1", "NV2g009262000.1", #22
  406. "NV2g018588000.1", "NV2g003875000.1", "NV2g015362000.1", "NV2g015156000.1", "NV2g015982000.1", #19
  407. "NV2g001204000.1", "NV2g001205000.1", "NV2g007735000.1", "NV2g018362000.1", "NV2g020402000.1", #21
  408. "NV2g014532000.1", "NV2g002896000.1", "NV2g013603000.1", "NV2g004414000.1", "NV2g009834000.1" #8
  409. )
  410. plt <- DotPlot(Stella_late_pl, features = list_of_genes) + RotatedAxis() + theme(axis.text.x = element_text(angle = 90)) + FontSize(10)
  411. plt <- plt + scale_x_discrete(labels = expression(
  412. italic("Nvprga"), italic("Nv2.14774"), italic("Nv2.12706"), italic("Nv2.5875"), italic("Nvpapss-like-1"), #6
  413. italic("Nvats6-like-7"), italic("Nv2.14384"), italic("Nv2.3558"), italic("Nv2.23233"), italic("Nvdd3-like-2"), #9
  414. italic("Nvaa2BR-like-2"), italic("Nvmuc1-like-2"), italic("Nvegfl8-like-1"), italic("Nv2.15162"), italic("Nvvwa7-like-2"), #11
  415. italic("Nvblml2-like-1"), italic("Nv2.14153"), italic("Nvaa3R-like-7"), italic("Nvtaar6-like-2"), italic("Nv2.21248"), #13
  416. italic("Nvprga-R.199"), italic("Nv2.21840"), italic("Nvshb-like-6"), italic("Nvgr101-like-10"), italic("Nv2.1446"), #5
  417. italic("Nvrl12-like-1"), italic("Nvrs3A-like-1"), italic("NvsoxC"), italic("Nv2.13863"), italic("Nvrl13-like-1"), #2
  418. italic("Nv2.7811"), italic("Nv2.23729"), italic("Nv2.10520"), italic("Nv2.5103"), italic("Nv2.3747"), #0
  419. italic("Nv2.24838"), italic("Nvaebp1-like-1"), italic("Nvats7-like-1"), italic("Nvlox5-like-3"), italic("Nvnas4-like-2"), #7
  420. italic("Nvviaat-like-40"), italic("Nvfez"), italic("NvCNTP1-like-14"), italic("NvSC6A1-like-9"), italic("Nvbtn1-like-6"), #14
  421. italic("Nv2.15930"), italic("Nv2.2620"), italic("Nv2.2627"), italic("Nv2.2623"), italic("Nv2.20225"), #18
  422. italic("Nvviaat-like-31"), italic("Nvbha15-like-1"), italic("Nv2.15217"), italic("Nv2.15222"), italic("Nvnr1BA-like-1"), #17
  423. italic("Nv2.21058"), italic("Nvaa2AR-like-3"), italic("Nvopn4-like-13"), italic("Nv2.14663"), italic("Nv2.9262"), #22
  424. italic("Nvach10-like-11"), italic("Nvqrfpr-like-31"), italic("Nvhce2-like-1"), italic("Nv.15156"), italic("Nv2.15982"), #19
  425. italic("Nv2.1204"), italic("Nv2.1205"), italic("Nvopn4B-like-6"), italic("Nvadrb2-like-40"), italic("Nvcckar-like-2"), #21
  426. italic("Nv2.14532"), italic("Nvtda6-like-1"), italic("Nvgp2-like-44"), italic("Nv2.4414"), italic("Nv2.9834") #8
  427. ))
  428. plt <- plt + ggtitle('top 5 subset markers on late planula')
  429. plt
  430. ggsave(plt, file = "/top_markers_LP_dotplot.jpg", width = 20, height = 5)
  431. ```
  432. # Supplemental Figure 4
  433. # Find DEGs from Cole et al. 2024's neuroglandular dataset
  434. ```{r}
  435. markers_neurogland.all <- FindAllMarkers(neurogland.all)
  436. library(rio)
  437. library(dplyr)
  438. markers_neurogland.all %>%
  439. tibble::rownames_to_column("gene_id") %>%
  440. rio::export(., file = "/markers_neurogland.all.csv")
  441. ```
  442. # top genes from Alison Cole's (Cole et al., 2024) neugoglandular datawset on NvashA subset
  443. ```{r fig.width = 9, fig.height = 3}
  444. ashA_combinedv4_20dims <- SetIdent(ashA_combinedv4_20dims, value = [email hidden]$seurat_clusters)
  445. [email hidden] <- factor([email hidden],
  446. levels = c("16", "4", "3", "10", "12", "1", "15", "20", "6", "9", "11", "13", "5",
  447. "2", "0", "7",
  448. "14", "18", "17", "22", "19", "21", "8"))
  449. list_of_genes <- c("NV2g011600000.1", "NV2g016299000.1", "NV2g000651000.1", "NV2g016823000.1", "NV2g011343000.1", #N1.L2
  450. "NV2g014153000.1", "NV2g025073000.1", "NV2g011772000.1", "NV2g004915000.1", "NV2g009042000.1", #N1.L1
  451. "NV2g012348000.1", "NV2g021230000.1","NV2g003558000.1", "NV2g021840000.1", "NV2g024129000.1", #N1.L3
  452. "NV2g015787000.1", "NV2g016037000.1","NV2g011524000.1", "NV2g007282000.1", "NV2g023984000.1", #N2.1
  453. "NV2g020120000.1", "NV2g008437000.1","NV2g007753000.1", "NV2g010940000.1", "NV2g017198000.1", #N2.2
  454. "NV2g018186000.1", "NV2g001757000.1", "NV2g023678000.1", "NV2g002044000.1","NV2g000371000.1", #N2.3
  455. "NV2g016206000.1", "NV2g010682000.1","NV2g025643000.1", "NV2g006888000.1", "NV2g004704000.1", #N2.4
  456. "NV2g002620000.1", "NV2g002627000.1", "NV2g002623000.1", "NV2g000952000.1", "NV2g005984000.1", #N1.g.early
  457. "NV2g006171000.1", "NV2g015217000.1", "NV2g001449000.1", "NV2g014600000.1", "NV2g008266000.1", #N2.g1
  458. "NV2g021058000.1", "NV2g016346000.1", "NV2g014663000.1", "NV2g011930000.1", "NV2g014773000.1", #NGD.1
  459. "NV2g018872000.1", "NV2g001204000.1", "NV2g001205000.1", "NV2g001202000.1", "NV2g020328000.1", #N1.2
  460. "NV2g019212000.1", "NV2g008558000.1", "NV2g008740000.1", "NV2g019209000.1", "NV2g006433000.1",
  461. "NV2g017383000.1", "NV2g002154000.1", "NV2g022717000.1", "NV2g024546000.1", "NV2g013148000.1"
  462. )
  463. plt9 <- DotPlot(ashA_combinedv4_20dims, features = list_of_genes) + RotatedAxis() + theme(axis.text.x = element_text(angle = 90)) + FontSize(10)
  464. plt9 <- plt9 + ggtitle("subtype markers on ashA subset")
  465. plt9 <- plt9 + scale_x_discrete(labels = expression(
  466. italic("Nv2.11600"), italic("NvPRGa"), italic("NvMFD6B-like-1"), italic("NvAQP2-like-1"), italic("NvAA2BR-like-2"),
  467. italic("Nv2.14153"), italic("NvAA3R-like-7"), italic("NvBLML2-like-1"), italic("NvTAAR6-like-2"), italic("NvTLL-like2"),
  468. italic("NvPR1-like-1"), italic("NvATS6-like-7"), italic("Nv2.3558"), italic("Nv2.21840"), italic("NvSHB-like-6"),
  469. italic("Nv2.15787"), italic("Nv2.16037"), italic("NvTBA3-like-2"), italic("NvFibrinogen-like"), italic("NvEDIL3-like-40"),
  470. italic("NvTMPS6-like-2"), italic("NvQGRFa"), italic("NvVIAAT-like-40"), italic("NvGABR1-like-2"), italic("NvFBCD1-like-22"),
  471. italic("NvGBRG3-like-1"), italic("Nvfez"), italic("NvFXD3A-like-1"), italic("Nv2.2044"), italic("NvGBRR1-like-5"), #N2.3
  472. italic("NvECT-like-2"), italic("NvNLGNY-like-2"), italic("NvTBX5A-like-4"), italic("NvACHA3-like-9"), italic("NvCNTP1-like-14"), #N2.4
  473. italic("Nv2.2620"), italic("Nv2.2627"), italic("Nv2.2623"), italic("NvCP17A-like-28"), italic("NvPGCA-like-20"), #N1.g.early
  474. italic("NvTBA1-like-1"), italic("Nv2.15217"), italic("NvPRDM14d"), italic("NvCALM-like-34"), italic("Nv2.8266"), #N2.g1
  475. italic("Nv2.21058"), italic("NvOPN4-like-13"), italic("Nv2.14663"), italic("NvKCNJ5-like-1"), italic("Nv2.14773"), #NGD.1
  476. italic("NvEmx3"), italic("Nv2.1204"), italic("Nv2.1205"), italic("Nv2.1202"), italic("NvTM11D-like-4"), #N1.2
  477. italic("NvFBP1-like-40"), italic("NvVITRN-like-3"), italic("NvCO7A1-like-1"), italic("NvFBP1-like-50"), italic("NvSAAR1-like-1"),
  478. italic("NvCD63-like-12"), italic("Nv2.2154"), italic("Nv2.22717"), italic("NvDMBT1-like-28"), italic("NvSON-like-3")
  479. ))
  480. plt9
  481. ggsave(plt9, file = "/subtpemarker_dotplot.jpg", width = 20, height =8)
  482. ```
  483. #Nvasha markers on Cole's neuroglandular dataset
  484. ```{r, fig.width = 8, fig.height = 8}
  485. genes <- c(
  486. # "PRGa", "NV2.14774", "NV2.12706", "NV2.5875", "PAPSS-like-1", #6
  487. # "ATS6-like-7", "NV2.14384", "NV2.3558", "NV2.23233", "DD3-like-2", #9
  488. "AA2BR-like-2", "MUC1-like-2", "EGFL8-like-1", "NV2.15162", "VWA7-like-2", #11
  489. "BLML2-like-1", "NV2.14153", "AA3R-like-7", "TAAR6-like-2", "NV2.21248", #13
  490. "PRGa-R.199", "NV2.21840", "SHB-like-6", "GR101-like-10", "NV2.1446", #5
  491. # "RL12-like-1", "RS3A-like-1", "SoxC", "NV2.13863", "RL13-like-1", #2
  492. # "NV2.7811", "NV2.23729", "NV2.10520", "NV2.5103", "NV2.3747", #0
  493. "NV2.24838", "AEBP1-like-1", "ATS7-like-1", "LOX5-like-3", "NAS4-like-2", #7
  494. "VIAAT-like-40", "fez", "CNTP1-like-14", "SC6A1-like-9", "BTN1-like-6", #14
  495. "NV2.15930", "NV2.2620", "NV2.2627", "NV2.2623", "NV2.20225", #18
  496. "VIAAT-like-31", "BHA15-like-1", "NV2.15217", "NV2.15222", "NR1BA-like-1", #17
  497. "NV2.21058", "AA2AR-like-3", "OPN4-like-13", "NV2.14663", "NV2.9262", #22
  498. "ACH10-like-11", "QRFPR-like-31", "HCE2-like-1", "NV2.15156", "NV2.15982", #19
  499. "NV2.1204", "NV2.1205", "OPN4B-like-6", "ADRB2-like-40", "CCKAR-like-2", #21
  500. "NV2.14532", "TDA6-like-1", "GP2-like-44", "NV2.4414", "NV2.9834") #8
  501. plt9 <- DotPlot(neurogland.all, features = genes) + RotatedAxis() + theme(axis.text.x = element_text(angle = 90)) + FontSize(10)
  502. plt9 <- plt9 + ggtitle("NvashA cluster markers/DEGs on neuroglandular dataset")
  503. plt9 <- plt9 + scale_x_discrete(labels = expression(
  504. #6, #9
  505. italic("Nvaa2BR-like-2"), italic("Nvmuc1-like-2"), italic("Nvegfl8-like-1"), italic("Nv2.15162"), italic("Nvvwa7-like-2"), #11
  506. italic("Nvblml2-like-1"), italic("Nv2.14153"), italic("Nvaa3R-like-7"), italic("Nvtaar6-like-2"), italic("Nv2.21248"), #13
  507. italic("Nvprga-R.199"), italic("Nv2.21840"), italic("Nvshb-like-6"), italic("Nvgr101-like-10"), italic("Nv2.1446"), #5
  508. #2, #0
  509. italic("Nv2.24838"), italic("Nvaebp1-like-1"), italic("Nvats7-like-1"), italic("Nvlox5-like-3"), italic("Nvnas4-like-2"), #7
  510. italic("Nvviaat-like-40"), italic("Nvfez"), italic("NvCNTP1-like-14"), italic("NvSC6A1-like-9"), italic("Nvbtn1-like-6"), #14
  511. italic("Nv2.15930"), italic("Nv2.2620"), italic("Nv2.2627"), italic("Nv2.2623"), italic("Nv2.20225"), #18
  512. italic("Nvviaat-like-31"), italic("Nvbha15-like-1"), italic("Nv2.15217"), italic("Nv2.15222"), italic("Nvnr1BA-like-1"), #17
  513. italic("Nv2.21058"), italic("Nvaa2AR-like-3"), italic("Nvopn4-like-13"), italic("Nv2.14663"), italic("Nv2.9262"), #22
  514. italic("Nvach10-like-11"), italic("Nvqrfpr-like-31"), italic("Nvhce2-like-1"), italic("Nv.15156"), italic("Nv2.15982"), #19
  515. italic("Nv2.1204"), italic("Nv2.1205"), italic("Nvopn4B-like-6"), italic("Nvadrb2-like-40"), italic("Nvcckar-like-2"), #21
  516. italic("Nv2.14532"), italic("Nvtda6-like-1"), italic("Nvgp2-like-44"), italic("Nv2.4414"), italic("Nv2.9834") #8
  517. ))
  518. plt9
  519. ggsave(plt9, file = "/ashAmarkersNGdata.jpg", width = 15, height = 10)
  520. ```
  521. #Supplemental Figure 5
  522. #cnidocyte subtype dotplot - full clusters
  523. ```{r fig.width = 8, fig.height = 3}}
  524. ashA_combinedv4_20dims <- SetIdent(ashA_combinedv4_20dims, value = [email hidden]$seurat_clusters)
  525. [email hidden] <- factor([email hidden],
  526. levels = c("16", "4", "3", "10", "12", "1", "15", "20", "6", "9", "11", "13", "5",
  527. "2", "0", "7",
  528. "14", "18", "17", "22", "21", "19", "8"))
  529. features_CnidoSub <- c("NV2g000363000.1", "NV2g007706000.1", "NV2g007069000.1", "NV2g001852000.1",
  530. "NV2g014792000.1", "NV2g003097000.1", "NV2g005947000.1", "NV2g015684000.1",
  531. "NV2g010927000.1", "NV2g018311000.1", "NV2g009989000.1", "NV2g003202000.1",
  532. "NV2g007207000.1", "NV2g002780000.1", "NV2g007209000.1", "NV2g019217000.1",
  533. "NV2g025705000.1", "NV2g012610000.1", "NV2g009823000.1", "NV2g004514000.1",
  534. "NV2g021967000.1", "NV2g014593000.1", "NV2g014594000.1", "NV2g019221000.1",
  535. "NV2g014815000.1", "NV2g007709000.1",
  536. "NV2g009503000.1", "NV2g008284000.1", "NV2g012900000.1", "NV2g007818000.1",
  537. "NV2g011818000.1", "NV2g012689000.1", "NV2g010115000.1", "NV2g011819000.1",
  538. "NV2g009120000.1", "NV2g000411000.1", "NV2g002044000.1", "NV2g004676000.1",
  539. "NV2g014822000.1", "NV2g018300000.1", "NV2g014159000.1", "NV2g018114000.1",
  540. "NV2g009028000.1", "NV2g015716000.1", "NV2g003814000.1", "NV2g020507000.1")
  541. plt <- DotPlot(ashA_combinedv4_20dims, features = features_CnidoSub) + RotatedAxis() + theme(axis.text.x = element_text(angle = 90)) + FontSize(10)
  542. plt <- plt + scale_x_discrete(labels = expression(italic("Nvmarco-like-2"), italic("Nvnh2l1-like-1"), italic("Nvh3-like-17"), italic("Nvdmrt-E"),
  543. italic("Nvrl12-like-1"), italic("Nvrs3a-like-1"), italic("Nvrs8-like-1",), italic("Nvrs12-like-1"),
  544. italic("Nvshk1"), italic("Nv2.18311"), italic("Nvco6-like-4"), italic("Nvhmcn1-like-87"),
  545. italic("Nvvmp6"), italic("Nvhmcn1-like-89"), italic("Nv2.7209"), italic("Nv2.19217"),
  546. italic("Nv2.25705"), italic("Nvmac1"), italic("Nv2.9823"), italic("Nvcop3-like-1"),
  547. italic("Nv2.21967"), italic("Nv2.14593"), italic("Nv2.14594"), italic("Nv2.19221"),
  548. italic("Nv2.14815"), italic("Nv2.7709"),
  549. italic("Nv2.9503"), italic("Nv2.8284"), italic("Nvcapa-like-1"), italic("Nvggha-like-11"),
  550. italic("Nvco6a-like-6"), italic("Nv2.12689"), italic("Nv2.10115"), italic("NV2.11819"),
  551. italic("Nvnupr1-like-1"), italic("Nvak1a1-like-1"), italic("Nv2.2044"), italic("Nvtraf4-like-19"),
  552. italic("Nv2.14822"), italic("Nv2.18300"), italic("Nvlama2-like-2.1"), italic("Nvisp2-like-2"),
  553. italic("Nvgabr2-like-21"), italic("Nvfbp1-like-2"), italic("Nvnpff2-like-90"), italic("Nvpk1l2-like-31")))
  554. plt <- plt + ggtitle('Cnidocyte subtype markers in NvashA subset')
  555. plt
  556. ggsave(plt, file = "/CnidoSubtypeDotplotv2.jpg", width = 12, height = 8)
  557. #removed NV2g015045000.1,NV2g025210000.1, NV2g018310000.1, NV2g006718000.1, NV2g007385000.1, NV2g016293000.1, NV2g025609000.1, NV2g008572000.1 NV2g014765000.1, NV2g007708000.1, NV2g019873000.1 = not found
  558. ```
  559. #umaps for cnidocyte genes on NvashA subset
  560. ```{r}
  561. list_of_genes <- c("NV2g019749000.1", "NV2g010686000.1", "NV2g010927000.1", "NV2g018311000.1", "NV2g007706000.1", "NV2g001852000.1")
  562. list_of_names <- c("Nvcnido-fos1", "Nvncol3", "Nvshk1", "Nv2.18311", "Nvnh2l1-like-1", "Nvdmrt-E")
  563. if(length(list_of_names) == length(list_of_genes)){
  564. for(i in 1:length(list_of_genes)){
  565. plt <- FeaturePlot_scCustom(ashA_combinedv4_20dims, features = list_of_genes[i], pt.size = 0.005)
  566. plt <- plt + ggtitle(list_of_names[i])
  567. print(plt)
  568. ggsave(plt, file = paste0("/ashA_combined/umaps/", list_of_names[i], "-umap.jpg"), device = "jpg", width = 5, height = 4)
  569. }
  570. } else {
  571. message("Error! - fix your names/ids!")
  572. }
  573. ```
  574. #Supplemental Figure 6
  575. #UMAPs for ashA target genes on ashA subset
  576. ```{r}
  577. list_of_genes <- c("NV2g023192000.1", "NV2g024331000.1", "NV2g005875000.1", "NV2g012875000.1")
  578. list_of_names <- c( "Nvlwamide-like", "NvglraA3-like", "Nvserum amyloid A-like", "Nvabcc4-like")
  579. if(length(list_of_names) == length(list_of_genes)){
  580. for(i in 1:length(list_of_genes)){
  581. plt <- FeaturePlot_scCustom(ashA_combinedv4_20dims, features = list_of_genes[i], pt.size = 0.005)
  582. plt <- plt + ggtitle(list_of_names[i])
  583. print(plt)
  584. }
  585. } else {
  586. message("Error! graphs won't genereate - fix your names/ids!")
  587. }
  588. ```
  589. # NvashA known target genes on gastrula dataset
  590. ```{r}
  591. Stella_combined_filt_gastrula <- SetIdent(Stella_combined_filt_gastrula, value = [email hidden]$seurat_clusters)
  592. [email hidden] <- factor([email hidden],
  593. levels = c("13", "14", "27", "25", "16", "20", "29", "30",
  594. "23", "10", "19", "11",
  595. "17", "18", "28", "5", "3", "7", "26", "1", "2", "24", "6", "9", "22", "8", "21", "15", "0", "4", "12"))
  596. list_of_genes <- c("NV2g009665000.1", "NV2g023192000.1", "NV2g024331000.1", "NV2g005875000.1", "NV2g012875000.1")
  597. plt3 <- DotPlot(Stella_combined_filt_gastrula, features = list_of_genes) + RotatedAxis() + theme(axis.text.x = element_text(angle = 90)) + FontSize(10)
  598. plt3 <- plt3 + scale_x_discrete(labels = expression(italic("NvashA"), italic("Nvlwamide-like"), italic("NvglraA3-like"), italic("Nvserum amyloid A-like"), italic("Nvabcc4-like")))
  599. plt3 <- plt3 + ggtitle('NvashA targets on gastrula dataset')
  600. plt3
  601. ```
  602. # NvashA known target genes on mid planula dataset
  603. ```{r}
  604. Stella_mid_pl <- SetIdent(Stella_mid_pl, value = [email hidden]$seurat_clusters)
  605. [email hidden] <- factor([email hidden],
  606. levels = c("10", "17", "15", "9", "6", "16", "12", "20",
  607. "5", "19", "18", "13",
  608. "0", "1", "2", "3", "4", "7", "8", "11", "14"))
  609. list_of_genes <- c("NV2g009665000.1", "NV2g023192000.1", "NV2g024331000.1", "NV2g005875000.1", "NV2g012875000.1")
  610. plt3 <- DotPlot(Stella_mid_pl, features = list_of_genes) + RotatedAxis() + theme(axis.text.x = element_text(angle = 90)) + FontSize(10)
  611. plt3 <- plt3 + scale_x_discrete(labels = expression(italic("NvashA"), italic("Nvlwamide-like"), italic("NvglraA3-like"), italic("Nvserum amyloid A-like"), italic("Nvabcc4-like")))
  612. plt3 <- plt3 + ggtitle('NvashA targets on mid planula dataset')
  613. plt3
  614. ```
  615. # NvashA known targets on late planula dataset
  616. ```{r}
  617. Stella_late_pl <- SetIdent(Stella_late_pl, value = [email hidden]$seurat_clusters)
  618. [email hidden] <- factor([email hidden],
  619. levels = c("10", "31", "14", "21", "20", "22", "30", "18",
  620. "13", "19", "3", "32", "28", "27", "23",
  621. "8", "12", "25", "17", "15", "7",
  622. "0", "1", "2", "4", "5", "6", "9", "11", "16","24", "26", "29"))
  623. list_of_genes <- c("NV2g009665000.1", "NV2g023192000.1", "NV2g024331000.1", "NV2g005875000.1", "NV2g012875000.1")
  624. plt3 <- DotPlot(Stella_late_pl, features = list_of_genes) + RotatedAxis() + theme(axis.text.x = element_text(angle = 90)) + FontSize(10)
  625. plt3 <- plt3 + scale_x_discrete(labels = expression(italic("NvashA"), italic("Nvlwamide-like"), italic("NvglraA3-like"), italic("Nvserum amyloid A-like"), italic("Nvabcc4-like")))
  626. plt3 <- plt3 + ggtitle('NvashA targets on late planula dataset')
  627. plt3
  628. ```
  629. #FIGURE 2
  630. #Subsetting neual only cells from NvashA+ subset
  631. ```{r}
  632. ashA_neural_sub3 <- subset(x = ashA_combinedv4_20dims, idents = c("6", "9", "11", "13", "5",
  633. "2", "0", "7",
  634. "14", "18", "17", "22", "19", "21"))
  635. save(ashA_neural_sub3,
  636. file = file.path(DATA_DIR, "ashA_neural_sub3.Rda"))
  637. ```
  638. ```{r}
  639. # keep original cluster IDs (the ones it was subset by)
  640. ashA_neural_sub3$cluster_orig <- Idents(ashA_neural_sub3)
  641. # preserve level order from the parent object
  642. ashA_neural_sub3$cluster_orig <- factor(
  643. ashA_neural_sub3$cluster_orig,
  644. levels = levels(ashA_combinedv4_20dims) # keeps original cluster order
  645. )
  646. # (optional) also stash numeric seurat_clusters if present
  647. if ("seurat_clusters" %in% colnames([email hidden])) {
  648. ashA_neural_sub3$seurat_clusters_orig <- ashA_neural_sub3$seurat_clusters
  649. }
  650. table(ashA_neural_sub3$cluster_orig)
  651. ```
  652. ```{r}
  653. # Recalculate within the subset
  654. ashA_neural_sub3 <- NormalizeData(ashA_neural_sub3)
  655. ashA_neural_sub3 <- FindVariableFeatures(ashA_neural_sub3, selection.method = "vst", nfeatures = 2000)
  656. ashA_neural_sub3 <- ScaleData(ashA_neural_sub3)
  657. ashA_neural_sub3 <- RunPCA(ashA_neural_sub3, npcs = 30)
  658. ```
  659. 15 dims
  660. ```{r}
  661. ashA_neural_sub3_15dims <- FindNeighbors(ashA_neural_sub3, dims = 1:15)
  662. ashA_neural_sub3_15dims <- FindClusters(ashA_neural_sub3_15dims, resolution = 1)
  663. head(Idents(ashA_neural_sub3_15dims), 10)
  664. ashA_neural_sub3_15dims <- RunUMAP(ashA_neural_sub3_15dims, dims = 1:15, verbose = FALSE)
  665. p1 <- DimPlot(ashA_neural_sub3_15dims, reduction = "umap", group.by = "timepoint", label = FALSE, pt.size = 0.1, label.size = 5)
  666. p2 <- DimPlot(ashA_neural_sub3_15dims, reduction = "umap",group.by = "orig.ident" , pt.size = 0.1)
  667. p3 <- DimPlot(ashA_neural_sub3_15dims, reduction = "umap", label = TRUE, pt.size = 0.1, label.size = 8)
  668. p4 <- DimPlot(ashA_neural_sub3_15dims, reduction = "umap", label = FALSE, pt.size = 0.1, label.size = 8)
  669. ashA_neural_sub3_15dims$cluster_new <- Idents(ashA_neural_sub3_15dims)
  670. p1
  671. p2
  672. p3
  673. p4
  674. save(ashA_neural_sub3_15dims3,
  675. file = file.path(DATA_DIR, "ashA_neural_sub3_15dims.Rda"))
  676. ```
  677. ```{r}
  678. # plot originals without changing Idents()
  679. p_orig <- DimPlot(
  680. ashA_neural_sub3_15dims,
  681. reduction = "umap",
  682. group.by = "cluster_orig",
  683. label = TRUE, repel = TRUE, pt.size = 0.1
  684. ) + ggtitle("UMAP — Original cluster IDs")
  685. # New clusters (current Idents) for comparison
  686. p_new <- DimPlot(
  687. ashA_neural_sub3_15dims,
  688. reduction = "umap",
  689. label = TRUE, repel = TRUE, pt.size = 0.1
  690. ) + ggtitle("UMAP — New clusters")
  691. p_new; p_orig
  692. ```
  693. #Supplemental Figure 7
  694. #annotation_final_for paper
  695. ```{r fig.width = 9, fig.height = 7}
  696. list_of_genes <- c("NV2g012902000.1", "NV2g018581000.1", "NV2g019749000.1", "NV2g010686000.1","NV2g016402000.1", "NV2g004477000.1", "NV2g006608000.1", "NV2g009665000.1", "NV2g023192000.1", "NV2g000252000.1"
  697. )
  698. plt <- DotPlot(ashA_neural_sub3_15dims, features = list_of_genes) + RotatedAxis() + theme(axis.text.x = element_text(angle = 90)) + FontSize(10)
  699. plt <- plt + scale_x_discrete(labels = expression(italic("Nvmucin"), italic("Nvnot-likeE"), italic("Nvcnido-fos1"), italic("Nvncol3"), italic("NvsoxC"), italic("NvsoxB(2)"), italic("Nvath-like"), italic("NvashA"), italic("NvLWamide-like"), italic("Nvelav1")
  700. ))
  701. plt <- plt + ggtitle('NvashA neural subset')
  702. plt
  703. ```
  704. #used this code to find all markers
  705. ```{r}
  706. markers_ashA_neural_sub3_15dims <- FindAllMarkers(ashA_neural_sub3_15dims)
  707. library(rio)
  708. library(dplyr)
  709. markers_ashA_neural_sub3_15dims %>%
  710. tibble::rownames_to_column("gene_id") %>%
  711. rio::export(., file = "/markers_ashA_neural_sub3_15dims.csv")
  712. ```
  713. ```{r}
  714. library(dplyr)
  715. library(readr)
  716. library(readxl)
  717. ### 1. Read marker file (from Seurat FindAllMarkers output)
  718. markers <- read_csv("markers_ashA_neural_sub3_15dims.csv")
  719. ### 2. Read annotation file
  720. annotations <- read_csv("manifest_mappings.csv")
  721. ### 3. Extract top 5 genes per cluster *in file order*
  722. top_markers <- markers %>%
  723. group_by(cluster) %>%
  724. mutate(row_in_cluster = row_number()) %>%
  725. filter(row_in_cluster <= 5) %>%
  726. ungroup() %>%
  727. arrange(cluster, row_in_cluster)
  728. ### 4. Join annotations
  729. # top_markers$gene is Nv2gID
  730. # annotations$mapped_geneID is the matching column
  731. top_markers_annot <- top_markers %>%
  732. left_join(annotations, by = c("gene" = "mapped_geneID"))
  733. ### 5. Construct feature vector (Nv2g IDs) and label vector (gene names)
  734. list_of_genes <- top_markers_annot$gene # Seurat features
  735. labels_vec <- top_markers_annot$gene.name # Human-readable names
  736. ### 6. Replace missing names with gene IDs
  737. labels_vec[is.na(labels_vec)] <- list_of_genes[is.na(labels_vec)]
  738. ```
  739. ```{r fig.width = 20, fig.height = 10}
  740. plt5 <- DotPlot(
  741. ashA_neural_sub3_15dims,
  742. features = list_of_genes,
  743. scale = FALSE
  744. ) +
  745. RotatedAxis() +
  746. theme(axis.text.x = element_text(angle = 90)) +
  747. FontSize(10)
  748. plt5 <- plt5 + scale_x_discrete(labels = labels_vec)
  749. plt5 <- plt5 + ggtitle("Top 5 subset markers on NvashA neural subset")
  750. plt5
  751. ```
  752. #used this code to easily see the top 5 genes
  753. ```{r}
  754. # This will PRINT a block:
  755. clusters <- sort(unique(top_markers$cluster))
  756. cat("list_of_genes <- c(\n")
  757. for (cl in clusters) {
  758. genes_cl <- top_markers$gene[top_markers$cluster == cl]
  759. cat(" ", paste0('"', genes_cl, '"', collapse = ", "), ", #", cl, "\n", sep = "")
  760. }
  761. cat(")\n")
  762. ```
  763. ```{r}
  764. # Print human-readable gene names grouped by cluster
  765. clusters <- sort(unique(top_markers_annot$cluster))
  766. cat("labels_vec <- c(\n")
  767. for (cl in clusters) {
  768. names_cl <- top_markers_annot$gene.name[top_markers_annot$cluster == cl]
  769. # Replace any NA names with the Nv2g ID so nothing is blank
  770. names_cl[is.na(names_cl)] <- top_markers_annot$gene[top_markers_annot$cluster == cl][is.na(names_cl)]
  771. cat(" ", paste0('"', names_cl, '"', collapse = ", "), ", #", cl, "\n", sep = "")
  772. }
  773. cat(")\n")
  774. ```
  775. ```{r fig.width = 20, fig.height = 10}
  776. list_of_genes <- c("NV2g021840000.1", "NV2g021302000.1", "NV2g024129000.1", "NV2g001446000.1", "NV2g012348000.1", #0
  777. "NV2g007811000.1", "NV2g012793000.1", "NV2g018662000.1", "NV2g014260000.1", "NV2g010809000.1", #1
  778. "NV2g014348000.1", "NV2g014774000.1", "NV2g001200000.1", "NV2g016299000.1", "NV2g019361000.1", #2
  779. "NV2g018827000.1", "NV2g018825000.1", "NV2g002299000.1", "NV2g002596000.1", "NV2g020327000.1", #3
  780. "NV2g011343000.1", "NV2g023614000.1", "NV2g012875000.1", "NV2g024863000.1", "NV2g003856000.1", #4
  781. "NV2g011441000.1", "NV2g008165000.1", "NV2g011806000.1", "NV2g011442000.1", "NV2g000333000.1", #5
  782. "NV2g011772000.1", "NV2g014153000.1", "NV2g025073000.1", "NV2g004915000.1", "NV2g021248000.1", #6
  783. "NV2g006813000.1", "NV2g006810000.1", "NV2g008789000.1", "NV2g017754000.1", "NV2g006809000.1", #7
  784. "NV2g007753000.1", "NV2g001757000.1", "NV2g004704000.1", "NV2g020120000.1", "NV2g004096000.1", #8
  785. "NV2g013863000.1", "NV2g002898000.1", "NV2g014792000.1", "NV2g006333000.1", "NV2g004360000.1", #9
  786. "NV2g020623000.1", "NV2g025991000.1", "NV2g021230000.1", "NV2g018400000.1", "NV2g023233000.1", #10
  787. "NV2g000160000.1", "NV2g005192000.1", "NV2g004530000.1", "NV2g014941000.1", "NV2g024159000.1", #11
  788. "NV2g011608000.1", "NV2g016903000.1", "NV2g008266000.1", "NV2g017107000.1", "NV2g001999000.1", #12
  789. "NV2g002620000.1", "NV2g002627000.1", "NV2g015930000.1", "NV2g002623000.1", "NV2g009018000.1", #13
  790. "NV2g015362000.1", "NV2g018588000.1", "NV2g003875000.1", "NV2g024629000.1", "NV2g006966000.1", #14
  791. "NV2g000450000.1", "NV2g005143000.1", "NV2g005142000.1", "NV2g006552000.1", "NV2g005046000.1", #15
  792. "NV2g001204000.1", "NV2g001205000.1", "NV2g007735000.1", "NV2g018362000.1", "NV2g022444000.1", #16
  793. "NV2g010279000.1", "NV2g009708000.1", "NV2g014290000.1", "NV2g023195000.1", "NV2g015846000.1", #17
  794. "NV2g021058000.1", "NV2g009262000.1", "NV2g013128000.1", "NV2g014663000.1", "NV2g016346000.1" #18
  795. )
  796. plt4 <- DotPlot(ashA_neural_sub3_15dims, features = list_of_genes, scale = FALSE) + RotatedAxis() + theme(axis.text.x = element_text(angle = 90)) + FontSize(10)
  797. plt4 <- plt4 + scale_x_discrete(labels = c("NV2g021840000.1", "NV2g021302000.1", "NV2g024129000.1", "NV2g001446000.1", "NV2g012348000.1", #0
  798. "NV2g007811000.1", "NV2g012793000.1", "NV2g018662000.1", "NV2g014260000.1", "NV2g010809000.1", #1
  799. "NV2g014348000.1", "NV2g014774000.1", "NV2g001200000.1", "NV2g016299000.1", "NV2g019361000.1", #2
  800. "NV2g018827000.1", "NV2g018825000.1", "NV2g002299000.1", "NV2g002596000.1", "NV2g020327000.1", #3
  801. "NV2g011343000.1", "NV2g023614000.1", "NV2g012875000.1", "NV2g024863000.1", "NV2g003856000.1", #4
  802. "NV2g011441000.1", "NV2g008165000.1", "NV2g011806000.1", "NV2g011442000.1", "NV2g000333000.1", #5
  803. "NV2g011772000.1", "NV2g014153000.1", "NV2g025073000.1", "NV2g004915000.1", "NV2g021248000.1", #6
  804. "NV2g006813000.1", "NV2g006810000.1", "NV2g008789000.1", "NV2g017754000.1", "NV2g006809000.1", #7
  805. "NV2g007753000.1", "NV2g001757000.1", "NV2g004704000.1", "NV2g020120000.1", "NV2g004096000.1", #8
  806. "NV2g013863000.1", "NV2g002898000.1", "NV2g014792000.1", "NV2g006333000.1", "NV2g004360000.1", #9
  807. "NV2g020623000.1", "NV2g025991000.1", "NV2g021230000.1", "NV2g018400000.1", "NV2g023233000.1", #10
  808. "NV2g000160000.1", "NV2g005192000.1", "NV2g004530000.1", "NV2g014941000.1", "NV2g024159000.1", #11
  809. "NV2g011608000.1", "NV2g016903000.1", "NV2g008266000.1", "NV2g017107000.1", "NV2g001999000.1", #12
  810. "NV2g002620000.1", "NV2g002627000.1", "NV2g015930000.1", "NV2g002623000.1", "NV2g009018000.1", #13
  811. "NV2g015362000.1", "NV2g018588000.1", "NV2g003875000.1", "NV2g024629000.1", "NV2g006966000.1", #14
  812. "NV2g000450000.1", "NV2g005143000.1", "NV2g005142000.1", "NV2g006552000.1", "NV2g005046000.1", #15
  813. "NV2g001204000.1", "NV2g001205000.1", "NV2g007735000.1", "NV2g018362000.1", "NV2g022444000.1", #16
  814. "NV2g010279000.1", "NV2g009708000.1", "NV2g014290000.1", "NV2g023195000.1", "NV2g015846000.1", #17
  815. "NV2g021058000.1", "NV2g009262000.1", "NV2g013128000.1", "NV2g014663000.1", "NV2g016346000.1" #18
  816. ))
  817. plt4 <- plt4 + ggtitle('top 5 subset markers on NvashA neural subset')
  818. plt4
  819. ggsave(plt4, file = "/top_markersNeural_dotplot.jpg", width = 20, height = 10)
  820. ```
  821. # Nvasha+ neural cluster markers on Cole et al. 2024's neuroglandular dataset
  822. ```{r, fig.width = 15, fig.height = 10}
  823. genes <- c("NV2.21840", "PRGa-R.199", "SHB-like-6", "NV2.1446", "PR1-like-1", #0
  824. "NV2.7811", "OtxC", "ADA1A-like-16", "NV2.14260", "ACH10-like-9", #1
  825. "PAPSS-like-1", "NV2.14774", "THIO-like-1", "PRGa", #"HLSa/SNIa/NTVa", #2
  826. "myc1", "Myc3", "NV2.2299", "YPF17-like-2", "ADRB2-like-31", #3
  827. "AA2BR-like-2", "NV2.23614", "MRP4-like-1", "MUC1-like-2", "NV2.3856", #4
  828. "FoxA", "VKT52-like-1", "PPR27-like-12", "NV2.11442", "RSPH1-like-4", #5
  829. "BLML2-like-1", "NV2.14153", "AA3R-like-7", "TAAR6-like-2", "NV2.21248", #6
  830. "NV2.6813", "MLRP2-like-30", "NV2.8789", "NV2.17754", "GR101-like-11", #7
  831. "VIAAT-like-40", "fez", "CNTP1-like-14", "TMPS6-like-2", "SC6A1-like-9", #8
  832. "NV2.13863", "NV2.2898", "RL12-like-1", "RL7-like-1", "RL13-like-1", #9
  833. "RPAC1-like-1", "FOXD1-like-1", "ATS6-like-7", "DD3-like-2", "NV2.23233", #10
  834. "NV2.160", "NV2.5192", "SEGN-like-4", "BIR7B-like-1", "MCTP1-like-1", #11
  835. "BHA15-like-1", "GRIA3-like-1", "NV2.8266", "NR1BA-like-1", "VIAAT-like-31", #12
  836. "NV2.2620", "NV2.2627", "NV2.15930", "NV2.2623", "NV2.9018", #13
  837. "HCE2-like-1", "ACH10-like-11", "QRFPR-like-31", "ADRB1-like-1", "TLR1-like-4", #14
  838. "NV2.450", "NV2.5143", "NV2.5142", "DMBT1-like-29", "NV2.5046", #15
  839. "NV2.1204", "NV2.1205", "OPN4B-like-6", "ADRB2-like-40", "AGRL3-like-1", #16
  840. "NV2.10279", "GBRB1-like-5", "NV2.14290", "LOX5-like-3", "CNTP5-like-7", #17
  841. "NV2.21058", "NV2.9262", "AA2AR-like-3", "NV2.14663", "OPN4-like-13" #18
  842. )
  843. plt9 <- DotPlot(neurogland.all, features = genes) + RotatedAxis() + theme(axis.text.x = element_text(angle = 90)) + FontSize(10)
  844. plt9 <- plt9 + ggtitle("ashA neural cluster markers on neurogland")
  845. #plt9 <- plt9 + scale_x_discrete(labels = expression(
  846. # italic("")))
  847. plt9
  848. ggsave(plt9, file = "/ashAneuralmarkersNGdata.jpg", width = 15, height = 10)
  849. ```
  850. ```{r}
  851. dim(ashA_neural_sub3_15dims)
  852. ncol(ashA_neural_sub3_15dims)
  853. ```
  854. #trajectory and pseudotime
  855. trajectory analysis with node selection
  856. ```{r}
  857. library(Seurat)
  858. library(monocle3)
  859. library(SeuratWrappers)
  860. library(ggplot2)
  861. library(dplyr)
  862. library(viridis)
  863. #----------------------------------------------------------
  864. # 1) Start from your Seurat object
  865. #----------------------------------------------------------
  866. seu <- ashA_neural_sub3_15dims
  867. #----------------------------------------------------------
  868. # 2) Convert Seurat -> Monocle3 CDS
  869. #----------------------------------------------------------
  870. cds <- SeuratWrappers::as.cell_data_set(seu)
  871. #----------------------------------------------------------
  872. # 3) Cluster cells & define partitions (Monocle3)
  873. #----------------------------------------------------------
  874. cds <- monocle3::cluster_cells(
  875. cds = cds,
  876. reduction_method = "UMAP",
  877. resolution = 0.001 # ~Seurat res 0.1
  878. )
  879. # (optional sanity checks)
  880. monocle3::plot_cells(cds) # clusters
  881. monocle3::plot_cells(cds, color_cells_by = "partition") # partitions
  882. #----------------------------------------------------------
  883. # 4) Learn the trajectory graph using those partitions
  884. #----------------------------------------------------------
  885. cds <- monocle3::learn_graph(
  886. cds,
  887. use_partition = TRUE,
  888. close_loop = TRUE
  889. )
  890. #----------------------------------------------------------
  891. # 5) Choose roots interactively & compute pseudotime
  892. # - A plot appears: click the node(s) where you want
  893. #----------------------------------------------------------
  894. cds <- monocle3::order_cells(cds)
  895. #----------------------------------------------------------
  896. # 6) Extract pseudotime and CLEAN it (no Inf)
  897. #----------------------------------------------------------
  898. pt <- monocle3::pseudotime(cds)
  899. # replace Inf / -Inf / NaN with NA so Seurat can plot it
  900. pt_clean <- ifelse(is.finite(pt), pt, NA_real_)
  901. # put cleaned pseudotime into Seurat
  902. seu$cds_pseudotime <- pt_clean
  903. # quick check
  904. summary(seu$cds_pseudotime)
  905. #----------------------------------------------------------
  906. # 7) Summarize which clusters are early/late (optional)
  907. #----------------------------------------------------------
  908. meta <- as.data.frame(colData(cds))
  909. meta$partition_m3 <- monocle3::partitions(cds)
  910. meta$cluster_m3 <- monocle3::clusters(cds)
  911. meta$pt <- pt_clean
  912. meta_summary <- meta %>%
  913. group_by(partition = partition_m3, cluster = cluster_m3) %>%
  914. summarise(
  915. n_cells = n(),
  916. min_pt = min(pt, na.rm = TRUE),
  917. mean_pt = mean(pt, na.rm = TRUE),
  918. .groups = "drop"
  919. ) %>%
  920. arrange(partition, min_pt)
  921. meta_summary # <-- table tells you what’s earliest in each partition
  922. #----------------------------------------------------------
  923. # 8) Pseudotime-only monocle plot (blue-yellow viridis) + mirror
  924. #----------------------------------------------------------
  925. # helper to flip left-right
  926. mirror_x <- function(p) p + scale_x_reverse()
  927. p_pseudo <- monocle3::plot_cells(
  928. cds,
  929. color_cells_by = "pseudotime",
  930. show_trajectory_graph = FALSE, # no lines, just cells
  931. label_groups_by_cluster = FALSE,
  932. graph_label_size = 0,
  933. cell_size = 0.5
  934. )
  935. p_pseudo_colored <- p_pseudo +
  936. scale_color_viridis_c(option = "C") + # blue->yellow palette
  937. theme_classic()
  938. p_pseudo_mirrored <- mirror_x(p_pseudo_colored)
  939. p_pseudo_mirrored # <-- this should be “pseudotime only” mirrored panel
  940. #----------------------------------------------------------
  941. # 9) FeaturePlot pseudotime on Seurat UMAP
  942. #----------------------------------------------------------
  943. FeaturePlot(
  944. seu,
  945. features = "cds_pseudotime",
  946. reduction = "umap",
  947. pt.size = 0.1
  948. )
  949. #----------------------------------------------------------
  950. # 10) Save rooted CDS
  951. #----------------------------------------------------------
  952. saveRDS(cds, file = "ashA_neural_sub3_monocle_rooted.rds")
  953. ```
  954. ```{r}
  955. # Trajectory + partitions, not mirrored
  956. p_part_traj <- monocle3::plot_cells(
  957. cds,
  958. color_cells_by = "partition",
  959. show_trajectory_graph = TRUE,
  960. label_groups_by_cluster = FALSE, # no cluster labels
  961. label_roots = TRUE,
  962. label_leaves = TRUE,
  963. label_branch_points = TRUE
  964. )
  965. p_part_traj
  966. # Mirrored version (to match other panels)
  967. p_part_traj_mirrored <- mirror_x(p_part_traj)
  968. p_part_traj_mirrored
  969. ```
  970. ```{r}
  971. p_part_traj_clean <- monocle3::plot_cells(
  972. cds,
  973. color_cells_by = "partition",
  974. show_trajectory_graph = TRUE,
  975. label_groups_by_cluster = FALSE,
  976. label_roots = FALSE,
  977. label_leaves = FALSE,
  978. label_branch_points = FALSE
  979. )
  980. p_part_traj_clean_mirrored <- mirror_x(p_part_traj_clean)
  981. p_part_traj_clean_mirrored
  982. ```
  983. ```{r}
  984. # pseudotime-only (new rooting)
  985. pC_new <- monocle3::plot_cells(
  986. cds,
  987. color_cells_by = "pseudotime",
  988. show_trajectory_graph = FALSE,
  989. label_groups_by_cluster = FALSE,
  990. graph_label_size = 0,
  991. cell_size = 0.5
  992. ) +
  993. scale_x_reverse() # mirrored to match the others
  994. pC_new
  995. # pseudotime + trajectory (new rooting)
  996. pD_new <- monocle3::plot_cells(
  997. cds,
  998. color_cells_by = "pseudotime",
  999. show_trajectory_graph = TRUE,
  1000. label_roots = TRUE,
  1001. label_leaves = TRUE,
  1002. label_branch_points = TRUE,
  1003. label_groups_by_cluster = FALSE,
  1004. cell_size = 0.5
  1005. ) +
  1006. scale_x_reverse()
  1007. pD_new
  1008. ```
  1009. ```{r}
  1010. p_traj_clean <- monocle3::plot_cells(
  1011. cds,
  1012. color_cells_by = "pseudotime",
  1013. show_trajectory_graph = TRUE,
  1014. label_roots = FALSE,
  1015. label_leaves = FALSE,
  1016. label_branch_points = FALSE,
  1017. label_groups_by_cluster = FALSE,
  1018. cell_size = 0.5
  1019. )
  1020. p_traj_clean
  1021. p_traj_clean_mirrored <- p_traj_clean + scale_x_reverse()
  1022. p_traj_clean_mirrored
  1023. ```

05_NvashA_subsetting_trajectory.Rmd at commit 07b4710, no license · at the source

Overview

Authors: Jamie A Havrilak1,2, MingHe Cheng1,2, Layla Al-Shaer1,2, Whitney B Leach1, Mia Yagodich1, Dylan Faltine-Gonzalez1,3, Michael J Layden1,2
  1. Department of Biological Sciences, Lehigh University, Bethlehem, PA USA
  2. Lehigh Oceans Research Center, Lehigh University, Bethlehem, PA USA
  3. Present Address: Department of Biomedical Engineering, Johns Hopkins University, Baltimore, MD USA
Institutions: Lehigh University (United States); Johns Hopkins University (United States)
Journal: Scientific reports, volume 16, issue 1, article 12151
Dates: received 8 August 2025; accepted 20 February 2026; published online 5 March 2026
Type: Research article · Language: English
License: CC BY-NC-ND
Identifiers: DOI 10.1038/s41598-026-41460-z · PMID 41781584 · PMCID PMC13076895 · OpenAlex W7133754179
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: other (organism), developmental (subfield)
Keywords: Neurogenesis, Nematostella, NvashA, Neuronal patterning, Nerve-net, Neural development, Developmental biology, Evolution, Neuroscience
MeSH: Cnidaria*, Neurogenesis*, Neurons*, Sea Anemones*, Animals, Body Patterning, Gene Expression Regulation, Developmental, Larva, Nervous System (* major topic)
Topic: Marine Invertebrate Physiology and Ecology (Paleontology, Earth and Planetary Sciences), according to OpenAlex
Funding: National Science Foundation (1942777); NIGMS NIH HHS (R01 GM127615); Department of Health and Human Services National Institute of General Medical Sciences (R01GM127615)
Citations: cited by 2 papers (Europe PMC); 59 references in the paper
Research resources: RRID:SCR_024675

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 5 matches between paragraphs and lines of code.

LaydenLab/NvashA_scRNAseq

License: none: the authors keep all their rights
State: the link answers, verified on 30 September 2026
Evidence: files inventoried
Commit: 07b47105178678bfa348e9c3474025a3246234ec, 5 December 2025
Languages: R (5)
Size: 6 files, 5 scripts
Software Heritage: not archived
Found in: “Data availability”
Holds: README, 5 notebooks
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: ggplot2 (5 files), patchwork (5 files), Seurat (5 files), tidyverse (5 files), igraph (1 file), Monocle 3 (1 file)
Availability: 1 check, the latest on 30 September 2026: the link answers
  • 30 September 2026: the link answers
6 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;
  • 5 scripts, each with its path and the digest of its content;
  • 5 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.1038/s41598-026-41460-z.

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

Recorded: type, language, journal, volume, issue, pages, dates, 7 authors, 9 keywords, 9 MeSH terms, 3 funders, 49 references, 1 RRID.

Cite

This paper

Havrilak, J. A., Cheng, M., Al-Shaer, L., Leach, W. B., Yagodich, M., Faltine-Gonzalez, D., & Layden, M. J. (2026). NvashA function reveals temporal differences in neural subtype generation in cnidarians. Scientific reports, 16(1), 12151. https://doi.org/10.1038/s41598-026-41460-z

BibTeX

@article{havrilak2026nvasha,
author = {Havrilak, Jamie A and Cheng, MingHe and Al-Shaer, Layla and Leach, Whitney B and Yagodich, Mia and Faltine-Gonzalez, Dylan and Layden, Michael J},
title = {{NvashA function reveals temporal differences in neural subtype generation in cnidarians}},
journal = {Scientific reports},
year = {2026},
month = mar,
volume = {16},
number = {1},
pages = {12151},
publisher = {Nature Publishing Group},
issn = {2045-2322},
doi = {10.1038/s41598-026-41460-z},
url = {https://doi.org/10.1038/s41598-026-41460-z},
pmid = {41781584},
pmcid = {PMC13076895}
}

RIS

TY - JOUR
AU - Havrilak, Jamie A
AU - Cheng, MingHe
AU - Al-Shaer, Layla
AU - Leach, Whitney B
AU - Yagodich, Mia
AU - Faltine-Gonzalez, Dylan
AU - Layden, Michael J
TI - NvashA function reveals temporal differences in neural subtype generation in cnidarians
T2 - Scientific reports
J2 - Sci Rep
PY - 2026
DA - 2026/03/05
VL - 16
IS - 1
SP - 12151
SN - 2045-2322
PB - Nature Publishing Group
DO - 10.1038/s41598-026-41460-z
UR - https://doi.org/10.1038/s41598-026-41460-z
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41598-026-41460-z",
"type": "article-journal",
"title": "NvashA function reveals temporal differences in neural subtype generation in cnidarians",
"container-title": "Scientific reports",
"author": [
{
"family": "Havrilak",
"given": "Jamie A"
},
{
"family": "Cheng",
"given": "MingHe"
},
{
"family": "Al-Shaer",
"given": "Layla"
},
{
"family": "Leach",
"given": "Whitney B"
},
{
"family": "Yagodich",
"given": "Mia"
},
{
"family": "Faltine-Gonzalez",
"given": "Dylan"
},
{
"family": "Layden",
"given": "Michael J"
}
],
"container-title-short": "Sci Rep",
"volume": "16",
"issue": "1",
"page": "12151",
"DOI": "10.1038/s41598-026-41460-z",
"PMID": "41781584",
"PMCID": "PMC13076895",
"ISSN": "2045-2322",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41598-026-41460-z",
"language": "en",
"issued": {
"date-parts": [
[
2026,
3,
5
]
]
}
}

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.1371/journal.pbio.3003803 [code]
The anti-neural role of BMP signaling is a consequence of its ancestral function in dorsoventral patterning.
Journal: PLoS biology
In common: Seurat, ggplot2, tidyverse, other, 12 references
[2] doi:10.1371/journal.pbio.3003931 [code]
A single-cell transcriptomic atlas reveals the emergence of medusa-specific cell states in the scyphozoan Aurelia coerulea.
Journal: PLoS biology
In common: Seurat, patchwork, ggplot2, 1 other tool, 7 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, igraph, Seurat, 3 other tools, 2 references
[4] 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, Seurat, 3 other tools, 2 references
[5] doi:10.1016/j.stem.2026.05.005 [code]
Generation of human appetite-regulating neurons and tanycytes from pluripotent stem cells.
Journal: Cell stem cell
In common: Monocle 3, igraph, Seurat, 3 other tools, 1 reference
[6] 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, igraph, Seurat, 3 other tools, 1 reference
[7] 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, Seurat, 3 other tools, 1 reference
[8] doi:10.1038/s41420-026-02971-w [code]
Multi-omics reveals heterogeneity and functional populations of oligodendrocyte progenitor cells induced by human neural stem cells.
Journal: Cell death discovery
In common: Monocle 3, igraph, Seurat, 3 other tools, 1 reference
[9] doi:10.1038/s41467-026-75273-5 [code]
Spinal cord regeneration deploys cell-type specific developmental and non-developmental strategies to restore neuron diversity.
Journal: Nature communications
In common: Monocle 3, Seurat, patchwork, 2 other tools, other, developmental, 1 reference
[10] doi:10.1002/jsp2.70200 [code]
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
In common: Monocle 3, igraph, Seurat, 3 other tools, other

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.