---
# System prepended metadata

title: '22-06： ES由来セルトリ細胞scRNAseq解析　FTSLC_scRNAseq 第２弾 (aggrしない) gscの0,2,3,4,5を抽出'
tags: [解析, ノート, TS, single-cell RNA-seq]

---

###### tags: `ノート` `TS` `解析` `single-cell RNA-seq`

# 22-06： ES由来セルトリ細胞scRNAseq解析　FTSLC_scRNAseq 第２弾 (aggrしない) gscの0,2,3,4,5を抽出

<br>

#### 2026/6/8
#### 【 作業場所＆保存場所 】

• 作業場所
 　~/osc-fs/22_TS_FTSLC_scRNAseq_2022/Seurat_Non_aggr
 
---


#### ※ aggrしないでSeuratした方

【参考】
scRNA-seqデータの解析(応用編)
https://hackmd.io/@takahirosuzuki/ByoEBNVPL

<br>

### 1. gonadal somatic cellsを抽出 -> 0,2,3,4,5を抽出してUMAP
```r=
library(Seurat)
library(dplyr)
library(patchwork)
library(MAST)
library(ggsci)

load("09_gsc_res03_20220516.RData")

#Cluster0,2,3,4,5の抽出_res01
data.integrated.gsc02345_01 <- subsetUmapClust(
    data = data.integrated.gsc,
    subset.name = "seurat_clusters",
    subset.value = c("0", "2", "3", "4","5"),
    npcs = 14,
    dims = 1:10,
    resolution=0.1)
#20220608_data.integrated.gsc02345_DimPlot01
DimPlot(object = data.integrated.gsc02345_01, label = TRUE)+ scale_color_d3()

#Cluster0,2,3,4,5の抽出_res02
data.integrated.gsc02345_02 <- subsetUmapClust(
    data = data.integrated.gsc,
    subset.name = "seurat_clusters",
    subset.value = c("0", "2", "3", "4","5"),
    npcs = 14,
    dims = 1:10,
    resolution=0.2)
#20220608_data.integrated.gsc02345_DimPlot02
DimPlot(object = data.integrated.gsc02345_02, label = TRUE)+ scale_color_d3()

#Cluster0,2,3,4,5の抽出_res03
data.integrated.gsc02345_03 <- subsetUmapClust(
    data = data.integrated.gsc,
    subset.name = "seurat_clusters",
    subset.value = c("0", "2", "3", "4","5"),
    npcs = 14,
    dims = 1:10,
    resolution=0.3)
#20220608_data.integrated.gsc02345_DimPlot03
DimPlot(object = data.integrated.gsc02345_03, label = TRUE)+ scale_color_d3()


#Cluster0,2,3,4,5の抽出_res04
data.integrated.gsc02345_04 <- subsetUmapClust(
    data = data.integrated.gsc,
    subset.name = "seurat_clusters",
    subset.value = c("0", "2", "3", "4","5"),
    npcs = 14,
    dims = 1:10,
    resolution=0.4)
#20220608_data.integrated.gsc02345_DimPlot04
DimPlot(object = data.integrated.gsc02345_04, label = TRUE)+ scale_color_d3()
```
![](https://i.imgur.com/DGItYvY.jpg)


<br>

### 2. gonadal somatic cellsを抽出 -> 0,2,3,4,5を抽出した t-SNE
```r=
#まずはgscのTSNE
data.integrated.gsc <- RunTSNE(
  data.integrated.gsc,
  reduction = "pca",
  cells = NULL,
  dims = 1:10,
  features = NULL,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  distance.matrix = NULL,
  reduction.name = "tsne",
  reduction.key = "tSNE_")
#20220608_TSNE_data.integrated.gsc (8x10)
DimPlot(object = data.integrated.gsc , reduction = "tsne" , label = TRUE)

data.integrated.gsc02345_01 <- RunTSNE(
  data.integrated.gsc02345_01,
  reduction = "pca",
  cells = NULL,
  dims = 1:10,
  features = NULL,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  distance.matrix = NULL,
  reduction.name = "tsne",
  reduction.key = "tSNE_")
#20220608_TSNE_data.integrated.gsc02345_res01 (8x10)
DimPlot(object = data.integrated.gsc02345_01 , reduction = "tsne" , label = TRUE)+ scale_color_ucscgb()

data.integrated.gsc02345_02 <- RunTSNE(
  data.integrated.gsc02345_02,
  reduction = "pca",
  cells = NULL,
  dims = 1:10,
  features = NULL,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  distance.matrix = NULL,
  reduction.name = "tsne",
  reduction.key = "tSNE_")
#20220608_TSNE_data.integrated.gsc02345_res02 (8x10)
DimPlot(object = data.integrated.gsc02345_02 , reduction = "tsne" , label = TRUE)+ scale_color_ucscgb()

data.integrated.gsc02345_03 <- RunTSNE(
  data.integrated.gsc02345_03,
  reduction = "pca",
  cells = NULL,
  dims = 1:10,
  features = NULL,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  distance.matrix = NULL,
  reduction.name = "tsne",
  reduction.key = "tSNE_")
#20220608_TSNE_data.integrated.gsc02345_res03 (8x10)
DimPlot(object = data.integrated.gsc02345_03, reduction = "tsne" , label = TRUE)+ scale_color_ucscgb()

data.integrated.gsc02345_04 <- RunTSNE(
  data.integrated.gsc02345_04,
  reduction = "pca",
  cells = NULL,
  dims = 1:10,
  features = NULL,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  distance.matrix = NULL,
  reduction.name = "tsne",
  reduction.key = "tSNE_")
#20220608_TSNE_data.integrated.gsc02345_res04 (8x10)
DimPlot(object = data.integrated.gsc02345_04 , reduction = "tsne" , label = TRUE)+ scale_color_ucscgb()
```
![](https://i.imgur.com/PaHSw1A.jpg)


<br>

### 3. resolution=0.2のHeatmapと、progenitor,Stromal,Set1,Set2 の遺伝子でFeaturePlot

Heatmap
```r=
#20220608_data.integrated.gsc02345_DimPlot02
DimPlot(object = data.integrated.gsc02345_02, label = TRUE)+ scale_color_d3()

# クラスター特異的遺伝の同定
integrated.markers <- FindAllMarkers(
    object = data.integrated.gsc02345_02,
    only.pos = FALSE,
    min.pct = 0.25,
    logfc.threshold = 0.25,
    test.use = "MAST")

# 計算に少し時間がかかるのでこのオブジェクトはsaveしておく
save(data.integrated.gsc02345_02, file="12_gsc02345_res02.RData")

integrated.markers %>%
    filter(avg_log2FC >= 0) %>%
    group_by(cluster) %>%
    top_n(5, avg_log2FC) -> top5.posi

#20220608_gsc02345_res02_HeatMap_Top5.pdf
DoHeatmap(object = data.integrated.gsc02345_02, features=top5.posi$gene, size=3)
```
![](https://i.imgur.com/UcxDJKv.png)


FeaturePlot
```r=
#progenitor
# 20220608_FeaturePlot_Sox11 (4 x 35)
FeaturePlot(object=data.integrated.gsc02345_02, features= "Sox11", col=c("gray", "red"), split.by="sample", min.cutoff=0.1, pt.size=1)
# 20220608_FeaturePlot_Ecm1
FeaturePlot(object=data.integrated.gsc02345_02, features= "Ecm1", col=c("gray", "red"), split.by="sample", min.cutoff=0.1, pt.size=1)
# 20220608_FeaturePlot_Nr2f1 
FeaturePlot(object=data.integrated.gsc02345_02, features= "Nr2f1", col=c("gray", "red"), split.by="sample", min.cutoff=0.1, pt.size=1)

pdfjoin --outfile 220608_FeaturePlot_progenitor.pdf 20220608_FeaturePlot_Sox11.pdf 20220608_FeaturePlot_Ecm1.pdf 20220608_FeaturePlot_Nr2f1.pdf 

#stromal
# 20220608_FeaturePlot_Wnt5a
FeaturePlot(object=data.integrated.gsc02345_02, features= "Wnt5a", col=c("gray", "red"), split.by="sample", min.cutoff=0.1, pt.size=1)
# 20220608_FeaturePlot_Pdgfra
FeaturePlot(object=data.integrated.gsc02345_02, features= "Pdgfra", col=c("gray", "red"), split.by="sample", min.cutoff=0.1, pt.size=1)
# 20220608_FeaturePlot_Tcf21
FeaturePlot(object=data.integrated.gsc02345_02, features= "Tcf21", col=c("gray", "red"), split.by="sample", min.cutoff=0.1, pt.size=1)
# 20220608_FeaturePlot_Acta2
FeaturePlot(object=data.integrated.gsc02345_02, features= "Acta2", col=c("gray", "red"), split.by="sample", min.cutoff=0.1, pt.size=1)
# 20220608_FeaturePlot_Arx
FeaturePlot(object=data.integrated.gsc02345_02, features= "Arx", col=c("gray", "red"), split.by="sample", min.cutoff=0.1, pt.size=1)
# 20220608_FeaturePlot_Gng13
FeaturePlot(object=data.integrated.gsc02345_02, features= "Gng13", col=c("gray", "red"), split.by="sample", min.cutoff=0.1, pt.size=1)
# 20220608_FeaturePlot_Lgr5
FeaturePlot(object=data.integrated.gsc02345_02, features= "Lgr5", col=c("gray", "red"), split.by="sample", min.cutoff=0.1, pt.size=1)
# 20220608_FeaturePlot_Apoc1
FeaturePlot(object=data.integrated.gsc02345_02, features= "Apoc1", col=c("gray", "red"), split.by="sample", min.cutoff=0.1, pt.size=1)
# 20220608_FeaturePlot_Gpc3
FeaturePlot(object=data.integrated.gsc02345_02, features= "Gpc3", col=c("gray", "red"), split.by="sample", min.cutoff=0.1, pt.size=1)
# 20220608_FeaturePlot_Hmcn1
FeaturePlot(object=data.integrated.gsc02345_02, features= "Hmcn1", col=c("gray", "red"), split.by="sample", min.cutoff=0.1, pt.size=1)

pdfjoin --outfile 220608_FeaturePlot_stromal.pdf 20220608_FeaturePlot_Wnt5a.pdf 20220608_FeaturePlot_Pdgfra.pdf 20220608_FeaturePlot_Tcf21.pdf 20220608_FeaturePlot_Acta2.pdf 20220608_FeaturePlot_Arx.pdf 20220608_FeaturePlot_Gng13.pdf 20220608_FeaturePlot_Lgr5.pdf 20220608_FeaturePlot_Apoc1.pdf 20220608_FeaturePlot_Gpc3.pdf 20220608_FeaturePlot_Hmcn1.pdf


#set1
# 20220608_FeaturePlot_Nr5a1
FeaturePlot(object=data.integrated.gsc02345_02, features= "Nr5a1", col=c("gray", "red"), split.by="sample", min.cutoff=0.1, pt.size=1)
# 20220608_FeaturePlot_Sfrp1
FeaturePlot(object=data.integrated.gsc02345_02, features= "Sfrp1", col=c("gray", "red"), split.by="sample", min.cutoff=0.1, pt.size=1)
# 20220608_FeaturePlot_Nr2f2
FeaturePlot(object=data.integrated.gsc02345_02, features= "Nr2f2", col=c("gray", "red"), split.by="sample", min.cutoff=0.1, pt.size=1)

pdfjoin --outfile 220608_FeaturePlot_set1.pdf 20220608_FeaturePlot_Nr5a1.pdf 20220608_FeaturePlot_Arx.pdf 20220608_FeaturePlot_Sfrp1.pdf 20220608_FeaturePlot_Nr2f2.pdf

#set2
# 20220608_FeaturePlot_Cdkn1b
FeaturePlot(object=data.integrated.gsc02345_02, features= "Cdkn1b", col=c("gray", "red"), split.by="sample", min.cutoff=0.1, pt.size=1)
# 20220608_FeaturePlot_Fst
FeaturePlot(object=data.integrated.gsc02345_02, features= "Fst", col=c("gray", "red"), split.by="sample", min.cutoff=0.1, pt.size=1)
# 20220608_FeaturePlot_Amhr2
FeaturePlot(object=data.integrated.gsc02345_02, features= "Amhr2", col=c("gray", "red"), split.by="sample", min.cutoff=0.1, pt.size=1)
# 20220608_FeaturePlot_Mt1
FeaturePlot(object=data.integrated.gsc02345_02, features= "Mt1", col=c("gray", "red"), split.by="sample", min.cutoff=0.1, pt.size=1)

pdfjoin --outfile 220608_FeaturePlot_set2.pdf 20220608_FeaturePlot_Cdkn1b.pdf 20220608_FeaturePlot_Fst.pdf 20220608_FeaturePlot_Amhr2.pdf 20220608_FeaturePlot_Mt1.pdf
```