環(huán)境配置
1. conda安裝
wget?https://repo.anaconda.com/miniconda/Miniconda3-py39_4.12.0-Linux-x86_64.sh
下載完成之后運(yùn)行(按提示安裝)
sh Miniconda3-py39_4.12.0-Linux-x86_64.sh
安裝完成后執(zhí)行以下命令
source ~/.bashrc
2. 環(huán)境配置
conda create -n (環(huán)境名) python=3.9
激活環(huán)境:
conda activate (環(huán)境名)
添加鏡像源
conda config –add channels?https://mirrors.bfsu.edu.cn/anaconda/cloud/bioconda/
conda config –add channels?https://mirrors.bfsu.edu.cn/anaconda/cloud/conda-forge/
conda config –add channels?https://mirrors.bfsu.edu.cn/anaconda/pkgs/free/
conda config –add channels?https://mirrors.bfsu.edu.cn/anaconda/pkgs/main/
查看鏡像源
conda config –show channels
3. 安裝python模塊
conda install numpy=1.23.4
conda install opencv=4.7.0
conda install pandas=2.2.2
conda install matplotlib=3.8.4
conda install tqdm=4.66.4
conda install seaborn=0.12.2
conda install tifffile
conda install scanpy=1.9.8
4. 軟件安裝
conda install samtools=1.18 sambamba=1.0.1 bedtools=2.31.1
conda install macs2=2.2.7.1
conda install deeptools=3.5.5
conda install ucsc-bedgraphtobigwig=472
conda install bwa=0.7.17
conda install bioconda::cutadapt=5.0
conda install bioconda::ucsc-bedsort
conda install bioconda::ucsc-bedclip
5. 安裝指定R版本(v4.3)
conda install -c conda-forge r-base=4.3.1
6. 安裝指定R包
conda install -c conda-forge r-signac=1.14.0
conda install -c conda-forge r-seurat=4.3.0
conda install bioconda::bioconductor-rtracklayer=1.62.0
conda install -c conda-forge r-kableextra=1.4.0
conda install -c conda-forge r-optparse=1.7.5
conda install -c conda-forge r-this.path=2.7.0
conda install conda-forge::r-r.utils
conda install conda-forge::r-devtools=2.4.5
options(timeout = 9999999999999)
devtools::install_github(“davidsjoberg/ggsankey”)
install.packages(‘DT’)
參考基因組配置
參考基因組需要使用bwa進(jìn)行建庫(流程使用bwa比對)
gtf文件中需包含gene_id,gene_name,gene_biotype/gene_type
人和小鼠基因組推薦使用:
https://www.10xgenomics.com/support/software/cell-ranger-arc/latest/release-notes/reference-release-notes
refdata-cellranger-arc-GRCh38-2020-A-2.0.0
refdata-cellranger-arc-mm10-2020-A-2.0.0
其他基因組可自行選擇版本。
配置文件填寫
配置文件可參考config.txt進(jìn)行填寫,內(nèi)容說明如下:
## fq數(shù)據(jù)路徑,F(xiàn)Q1為read1文件路徑,F(xiàn)Q2為read2文件路徑
FQ1 /path/to/read_1.fq.gz
FQ2 /path/to/read_2.fq.gz
## 芯片解碼文件路徑
FLU /path/to/flu_info.txt
## 組織明場圖片路徑
HE /path/to/HE.tif
#INSIDE 1 #是否扣除組織內(nèi)部空白區(qū)域,默認(rèn)1扣除,選0為保留
## 組織熒光圖片路徑
#FL /path/to/FL.tif #組織熒光圖,和HE圖二選一
#FLC -1 #熒光圖顏色通道,值為0,1或2,選擇-1為自動判斷
## 組織區(qū)域文件路徑
JSON /path/to/roi.json #如不給定,則流程會自動使用上面的圖片進(jìn)行識別,自動識別建議使用熒光圖
## 參考基因組文件
GenomeVer xxxx #版本信息,出現(xiàn)在報(bào)告中
Ref /path/to/ref/genome.fa #基因組fa文件
Gtf /path/to/ref/gene.gtf #基因組gtf文件
SPECIES human #物種文件,人和小鼠分別為human/mouse,其他物種自行給定
## 輸出結(jié)果及輸出文件前綴
OUTDIR /path/to/result/dir/
PREFIX outfile-prefix
## barcode 類型,S3000芯片無特殊情況為V2
BCType V2
## 線程數(shù)
Threads 8
## cs序列類型,無特殊情況為cs12
CSType cs12
軟件運(yùn)行
在配置好的環(huán)境中,運(yùn)行命令:
/path/to/BSATAC -c config.txt -s 0
其中 -c 是配置文件,-s 是所選擇運(yùn)行的步驟,0是全部運(yùn)行
結(jié)果說明
outdir/
├── 01.fastq2BcUmi # barcode識別目錄
├── 02.LinkBcChip # 芯片barcode對應(yīng)
├── 03.AllheStat # 多級分辨率和組織區(qū)域處理
├── 04.Cutadapt # 接頭過濾
├── 05.Mapping # reads比對結(jié)果
├── 06.Fragment # Fragment分析
├── 07.WebReport # 網(wǎng)頁版報(bào)告
├── BSTViewer_project # 收集的結(jié)果目錄
└── prefix # 芯片原始barcode結(jié)果
聯(lián)合分析操作指南
注意說明,當(dāng)前分析需要百創(chuàng)智造的空間RNA和空間ATAC分析流程輸出的結(jié)果?。?!
空間RNA和空間ATAC的主要結(jié)果各自存儲在BSTViewer_project文件下。
1. FiJi對齊
1.1:百創(chuàng)智造空間ATAC與空間轉(zhuǎn)錄組聯(lián)合分析之切片對齊概述
https://zhuanlan.zhihu.com/p/1903040885328945604
1.2:百創(chuàng)智造空間ATAC與空間轉(zhuǎn)錄組聯(lián)合分析之切片對齊前圖像生成-01
https://zhuanlan.zhihu.com/p/1898370805919903880
1.3:百創(chuàng)智造空間ATAC與空間轉(zhuǎn)錄組聯(lián)合分析之FIJI中手動對齊切片-02
https://zhuanlan.zhihu.com/p/1903079101796941928
1.4:百創(chuàng)智造空間ATAC與空間轉(zhuǎn)錄組聯(lián)合分析之切片上點(diǎn)的映射-03
https://zhuanlan.zhihu.com/p/1903081341429452952
1.5:百創(chuàng)智造空間ATAC與空間轉(zhuǎn)錄組聯(lián)合分析之Level1向其他level水平的點(diǎn)映射-04
https://zhuanlan.zhihu.com/p/1907854262597321846
其它: Fiji的下載與安裝(windows 10)
https://zhuanlan.zhihu.com/p/18027378723
特殊說明:軟文詳細(xì)講解了對齊的原理,腳本實(shí)現(xiàn)以及結(jié)果說明。其中,軟文中涉及的腳本存在?[SpatialATAC/v1.0.2/fragment/ImageJ_FJ] 中。
2. 聯(lián)合分析
2.1 配置文件說明
配置文件可參考config.yaml?[SpatialATAC/v*/fragment/Joint_analysis/v*/]?進(jìn)行填寫,內(nèi)容說明如下:
ATAC和RNA分析路徑(一級目錄下)
ATAC_analysis path/BSTViewer_project/
RNA_analysis path/BSTViewer_project/
######映射文件(通過Image Fiji獲取)(默認(rèn)讀取L18 L9 L7 L5四個水平的結(jié)果)Fiji path/
輸出路徑 outdir path/analysis
##其它參數(shù) alpha 0.1 ##透明度,范圍是0-1 logfc 0.1
2.2 流程執(zhí)行
perl Joint_main_v1.2.pl -c config.yaml -s 0
其中 -a -b -c 是配置文件,-s 是所選擇運(yùn)行的步驟,0是全部運(yùn)行
perl Joint_main_v1.2.pl
Usage:
-a spatial config ##空間轉(zhuǎn)錄組主流程的配置文件
-b atac config ##空間ATAC主流程的配置文件
-c joint config ##聯(lián)合分析的配置文件(見2.1)
-s run step
step number:
0: run all step
1: Joint analysis
2: Joint report
3: total report
2.3 結(jié)果說明
L*_alignment/
├── L*_Joint_marker_gene.csv ##聯(lián)合分析marker基因
├── L*_joint.rds ##rds文件
├── L*_Sankey_plots.pdf ##?;鶊D
├── L*_Sankey_plots.png
├── L*_heatmap.pdf ##marker基因熱圖
├── L*_heatmap.png
├── L*_CoveragePlot.pdf ##基因組瀏覽器圖
├── L*_CoveragePlot.png
├── L*_Spatial_ATAC.cluster.pdf ##ATAC聚類圖
├── L*_Spatial_ATAC.cluster.png
├── L*_Spatial_Joint.cluster.pdf ##聯(lián)合分析聚類圖
├── L*_Spatial_Joint.cluster.png
├── L*_Spatial_RNA.cluster.pdf ##RNA聚類圖
└── L*_Spatial_RNA.cluster.png
**特殊說明**
1. L*_joint.rds 中存在3個assay,分別是:ATAC(peak矩陣),Spatial(表達(dá)矩陣),RNA(活性矩陣)。
2. 結(jié)果生成2個報(bào)告:聯(lián)合分析的報(bào)告,以及Spatial、ATAC以及聯(lián)合分析的匯總報(bào)告