---
# System prepended metadata

title: 22-01： ES由来セルトリ細胞scRNAseq解析　FTSLC_scRNAseq (cellranger aggr)
tags: [解析, ノート, TS, single-cell RNA-seq]

---

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

# 22-01： ES由来セルトリ細胞scRNAseq解析　FTSLC_scRNAseq (cellranger aggr)

<br>

#### 2026/04/06 
#### 【 作業場所＆保存場所 】
 • rowdata (fastq)
/analysisdata/rawseq/fastq/SHARED/000042/E10-5_XX/ :XXのE10.5
/analysisdata/rawseq/fastq/SHARED/000042/E10-5_XY/ :XYのE10.5
/analysisdata/rawseq/fastq/SHARED/000042/E11-5_XX/ :XXのE11.5
/analysisdata/rawseq/fastq/SHARED/000042/E11-5_XY/ :XYのE11.5
/analysisdata/rawseq/fastq/SHARED/000042/E12-5_XX/ :XXのE12.5
/analysisdata/rawseq/fastq/SHARED/000042/E12-5_XY/ :XYのE12.5
Induced_D6/ :XXのESから分化誘導6⽇⽬ (FOSLCs)
/analysisdata/rawseq/fastq/SHARED/000128/JN00006966/10x-ig168/ :XYのESから分化誘導6⽇⽬
(FTSLCs)
  
  
 • 作業場所
 　~/osc-fs/22_TS_FTSLC_scRNAseq_2022
 
---


### 1.  CellRangerかける

* cell_ranger_job.sh

```
#!/bin/bash
#$ -S /bin/bash
#$ -cwd
#$ -pe smp 4

## $1 id
## $2 fastq directory

cellranger count --id=$1 \
	         --transcriptome=$HOME/ProgramFiles/Cell_Ranger/refdata-cellranger-mm10-3.0.0 \
	         --fastqs=$2 \
		 --expect-cells=8000 \
		 --localcores=2
```

キューイング
```
qsub -N XX_E10.5 cell_ranger_job.sh E10-5_XX //analysisdata/rawseq/fastq/SHARED/000042/E10-5_XX
qsub -N XY_E10.5 cell_ranger_job.sh E10-5_XY //analysisdata/rawseq/fastq/SHARED/000042/E10-5_XY
qsub -N XX_E11.5 cell_ranger_job.sh E11-5_XX //analysisdata/rawseq/fastq/SHARED/000042/E11-5_XX
qsub -N XY_E11.5 cell_ranger_job.sh E11-5_XY //analysisdata/rawseq/fastq/SHARED/000042/E11-5_XY
qsub -N XX_E12.5 cell_ranger_job.sh E12-5_XX //analysisdata/rawseq/fastq/SHARED/000042/E12-5_XX
qsub -N XY_E12.5 cell_ranger_job.sh E12-5_XY //analysisdata/rawseq/fastq/SHARED/000042/E12-5_XY
qsub -N XX_FOSLCs cell_ranger_job.sh Induced_D6 //analysisdata/rawseq/fastq/SHARED/000042/Induced_D6
qsub -N XY_FTSLCs cell_ranger_job.sh 10x-ig168 //analysisdata/rawseq/fastq/SHARED/000128/JN00006966/10x-ig168
```

<br>

### 2 . cellranger aggr

https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/aggregate#cbc 
の"Aggregating libraries with differentchemistry versions"セクション

まず集計CSVファイルを作成する

XX_XY_aggr.csv
```
sample_id,molecule_h5,batch
XX_E10.5,//osc-fs_home/s-maeda/22_TS_FTSLC_scRNAseq_2022/E10-5_XX/outs/molecule_info.h5,v2_lib
XX_E11.5,//osc-fs_home/s-maeda/22_TS_FTSLC_scRNAseq_2022/E11-5_XX/outs/molecule_info.h5,v2_lib
XX_E12.5,//osc-fs_home/s-maeda/22_TS_FTSLC_scRNAseq_2022/E12-5_XX/outs/molecule_info.h5,v2_lib
XY_E10.5,//osc-fs_home/s-maeda/22_TS_FTSLC_scRNAseq_2022/E10-5_XY/outs/molecule_info.h5,v2_lib
XY_E11.5,//osc-fs_home/s-maeda/22_TS_FTSLC_scRNAseq_2022/E11-5_XY/outs/molecule_info.h5,v2_lib
XY_E12.5,//osc-fs_home/s-maeda/22_TS_FTSLC_scRNAseq_2022/E12-5_XY/outs/molecule_info.h5,v2_lib
XX_FOSLCs,//osc-fs_home/s-maeda/22_TS_FTSLC_scRNAseq_2022/Induced_D6/outs/molecule_info.h5,v2_lib
XY_FTSLCs,//osc-fs_home/s-maeda/22_TS_FTSLC_scRNAseq_2022/10x-ig168/outs/molecule_info.h5,v3.1_lib
```

cell_ranger_aggr.sh
```
#!/bin/bash
#$ -S /bin/bash
#$ -cwd
#$ -pe smp 4

## $1 id
## $2 csv file

cellranger aggr --id = $1 \
                --csv = $2 \
                --normalize =mapped
```
```
qsub -q bigmem.q -N aggr cell_ranger_aggr.sh agger_XX_XY XX_XY_aggr.csv
```

<br>

### 3 . Setup the Seurat Object
```r=
library(dplyr)
library(Seurat)
library(patchwork)

#Load the PBMC dataset
aggr.data <- Read10X(data.dir = "/osc-fs_home/s-maeda/22_TS_FTSLC_scRNAseq_2022/agger_XX_XY/outs/count/filtered_feature_bc_matrix")

#Initialize the Seurat object with the raw (non-normalized data)
aggr <- CreateSeuratObject(counts = aggr.data , project = "FTSLC")

```
