BSTMatrix v_2.2流程說明
1.軟件依賴
1)python: 版本3.8及以上,安裝cv2模塊(4.0以上版本),matplotlib,seaborn,pandas
2)Star:版本2.6.1d及以上版本
3)perl:threads及threads::shared模塊
4)Rscript:需要以下R包,seurat、dplyr、tibble、ggplot2、broom、purrr、cowplot、cluster、ggpubr、plotly、htmlwidgets、kableextra、htmltools、shiny、knitr、rmarkdown、optparse。
依賴的軟件需要使用export添加到環(huán)境變量中,以實現流程的調用。
2.輸入數據準備
1)測序數據:雙端測序fastq數據。
2)參考基因組數據:基因組序列文件,gtf文件(第3列需要包含exon),gff文件(可選)(第3列需要包含gene、exon)。
3)features.tsv文件:可使用gtf文件生成,參考命令:perl ./tools/features_generate.pl -i xxx.gtf -o features.tsv
4)STAR基因組索引文件:可使用基因組序列文件和gtf文件生成,參考命令:STAR –runThreadN 8 –runMode genomeGenerate –genomeDir star/ –genomeFastaFiles genome.fa –sjdbGTFfile gene.gtf
5)熒光解碼文件及HE圖片文件。
3.配置文件編寫
配置文件:
## fq測序數據文件路徑,支持.gz格式
FQ1 /path/to/read_1.fq.gz
FQ2 /path/to/read_2.fq.gz
## Flu info file 熒光解碼文件路徑
FLU /path/to/flu_info.txt
## 參考基因組STAR建庫目錄及gff/gtf文件路徑
INDEX /path/to/STAR/index/dir/
GFF /path/to/ref/gene/gff3/file #(也可使用gtf文件)
## 參考基因組features.tsv文件路徑
FEATURE /path/to/features.tsv
## HE染色圖片路徑
HE /path/to/HE.tif
## 輸出目錄及輸出文件前綴
OUTDIR /path/to/result/dir/
PREFIX outfile-prefix
### 程序參數
## fastq2BcUmi
BCType V2 #barcode 版本類型(一般為V2版本)
BCThreads 8 #線程數
## Umi2Gene
Sjdboverhang 100 #STAR建庫時使用的-sjdboverhang參數值,默認100
STARThreads 8 #STAR比對線程數
ENV python和Rscript的路徑,如不提供則使用系統(tǒng)環(huán)境中的版本(不提供請注釋掉以下參數)
PYTHON /path/to/python/dir/
Rscript /path/to/Rscript/dir/
4.流程運行
1)流程說明:
流程分為6個步驟,如下所示:
A)步驟1:運行fastq2BcUmi,識別fastq數據中的barcode、umi。
B)步驟2:運行LinkBcChip,識別熒光數據的barcode信息并對應到芯片上位置。
C)步驟3:運行Umi2Gene,將reads與參考基因組比對,得到每個UMI對應的基因信息。
D)步驟4:運行MatrixMake,獲得基因表達矩陣。
E)步驟5:運行AllheStat,處理HE圖片。
F)步驟6:運行cluster.R,進行聚類分析。
G)步驟7:運行WebReport,得到網頁版報告。
2)流程參數:
-c config.txt 數據配置文件
-s 步驟選擇,0為運行1-7所有步驟,也可選擇個別步驟單獨運行,多個步驟中間使用“,”分割。
3)參考命令:
./BSTMatrix -c config.txt -s 0
./BSTMatrix -c config.txt -s 1,2,3,4,5,6,7
./BSTMatrix -c config.txt -s 1,3
5.結果文件說明
1)目錄結構及結果說明:
outdir/
├── 01.fastq2BcUmi 步驟1運行結果目錄
│?? ├── prefix.bc_dist 不同barcode檢測統(tǒng)計
│?? ├── prefix.bc_stat 不同barcode檢測統(tǒng)計
│?? ├── prefix.bc_umi_read.tsv barcode類型、對應的umi及reads數統(tǒng)計文件
│?? ├── prefix.bc_umi_read.tsv.id barcode類型、對應的umi及reads id文件
│?? ├── prefix.filter 沒有完整識別出來barcode的reads信息
│?? ├── prefix.full_stat barcode類型對應的reads數、umi數
│?? ├── prefix.id_map id編號對應關系文件
│?? ├── prefix.qual.stat reads統(tǒng)計文件
│?? ├── prefix.select_id 完整識別出barcode和UMI的reads id文件
│?? ├── prefix.stat barcode檢測統(tǒng)計
│?? ├── prefix.umi reads對應的barcode類型及umi
│?? └── prefix.umi_cor.info umi校正信息
├── 02.LinkBcChip 步驟2運行結果目錄
│?? ├── prefix.barcode_pos.tsv barcode類型對應的芯片位置文件
│?? ├── prefix.barcode.tsv 芯片對應的barcode類型文件
│?? ├── prefix.used.barcode
│?? └── prefix.pos reads對應的芯片位置及barcode類型文件
├── 03.Umi2Gene 步驟3運行結果目錄
│?? ├── prefixAligned.sortedByCoord.out.bam STAR軟件比對結果
│?? ├── prefix.final.transcript
│?? ├── prefixLog.final.out STAR軟件比對結果信息文件
│?? ├── prefix.cut90.fq 剪切成90bp長度的reads文件
│?? ├── prefixLog.out
│?? ├── prefixLog.progress.out
│?? ├── prefix.map2exon
│?? ├── prefix.map2gene reads比對到的基因信息
│?? ├── prefix.map2intron
│?? ├── prefix.map2transcript
│?? ├── prefix.mapadjust.exon
│?? ├── prefix.mapadjust.intron
│?? ├── prefix.mapadjust.transcript
│?? ├── prefixSJ.out.tab
│?? ├── prefix_STARgenome
│?? ├── prefix_STARpass1
│?? ├── prefix_STARtmp
│?? ├── prefix.stat
│?? ├── prefix.total.stat reads比對結果統(tǒng)計文件
│?? └── prefix.umi_gene.tsv barcode對應的umi及基因文件
├── 04.MatrixMake 步驟4運行結果目錄
│?? ├── prefix.matrix.tsv 基因表達矩陣文件
│?? ├── prefix.matrix.tsv.filt
│?? ├── prefix.select.bc_umi_read.tsv
│?? ├── prefix.select.umi_gene.tsv
│?? ├── prefix.select.umi_gene.tsv.filter
│?? └── prefix.sequencing_saturation.stat
├── 05.AllheStat 步驟5運行結果目錄
│?? ├── allhe
│?? ├── all_level_stat.txt 不同水平的spots統(tǒng)計
│?? ├── BSTViewer_project BSTViewer軟件輸入數據
│?? ├── heAuto_level_matrix 不同分辨率組織內spot的矩陣目錄
│?? ├── level_matrix 不同分辨率的矩陣目錄
│?? ├── stat.txt
│?? └── umi_plot umi count圖片統(tǒng)計圖目錄
├── 06.Cluster 步驟6 聚類結果目錄
│?? ├── L13 L13水平聚類結果目錄
│?? ├── L3 L3水平聚類結果目錄
│?? ├── L4 L4水平聚類結果目錄
│?? ├── L5 L5水平聚類結果目錄
│?? ├── L6 L6水平聚類結果目錄
│?? └── L7 L7水平聚類結果目錄
├── 07.WebReport 步驟7運行結果目錄
│?? ├── prefix.filelist
│?? ├── report.html 單文件版網頁版報告文件
│?? ├── index.html 網頁版報告html文件
│?? └── src 網頁版報告src目錄
└── prefix 收集的基因表達矩陣等文件目錄
├── barcode_pos.tsv barcode類型對應的芯片位置文件
├── barcode.tsv 芯片對應的barcode類型文件
├── bc_umi_read.tsv.gz barcode類型、對應的umi及reads數統(tǒng)計文件
├── umi_gene.tsv.gz barcode對應的umi及基因文件
├── features.tsv features.tsv文件
└── matrix.tsv 基因表達矩陣文件