參考生信技能書
一文打通單細(xì)胞上游:從軟件部署到上游分析
prefetch官網(wǎng)說明
cellranger官網(wǎng)說明
本教程是基于下載NCBI公共數(shù)據(jù)庫10x單細(xì)胞數(shù)據(jù)sra文件,進(jìn)行解壓合并和重命名,最后運(yùn)行cellranger得到單細(xì)胞表達(dá)矩陣。
第一步、下載和安裝prefetch軟件;
第二步、解壓sra文件,如有特殊情況需要對測序文件進(jìn)行合并,依據(jù)cellranger的要求對文件進(jìn)行重命名;
第三步、安裝和運(yùn)行cellranger。
1、安裝prefetch(在NCBI官網(wǎng)Download下載)
wget https://ftp-trace.ncbi.nlm.nih.gov/sra/sdk/current/sratoolkit.current-centos_linux64.tar.gz
tar -zxvf sratoolkit.current-centos_linux64.tar.gz
echo 'export export PATH=$PATH:/lustre/home/acct-medxh/medxh/sccdata/sratoolkit.3.0.0-centos_linux64/bin' >> ~/.bash_profile
source ~/.bash_profile
prefetch -V #查看版本
2、通過prefetch下載SRA文件
首先、點(diǎn)擊project頁面All runs,下載SRR_Acc_List.txt文件

image.png

image.png
然后、通過prefetch代碼下載SRA文件
#! /bin/sh
cd /lustre/home/acct-medxh/medxh/sccdata/thin.end/qingdao/
prefetch -X 100GB -O output --option-file SRR_Acc_List.txt
下載后的文件如下圖

image.png
3、fasterq-dump SRA轉(zhuǎn)fastq
常規(guī)的SRA轉(zhuǎn)fastq文件,用的是fastq-dump軟件,速度非常慢,4-5個小時才能處理完一個樣本。
這里用新辦法fasterq-dump,2分鐘完成一個樣本:
方法1:多個文件批量做
cat >fastq.sh
#! /bin/sh
ls /lustre/home/acct-medxh/medxh/sccdata/thin.end/xiamen/output/SRR*/*.sra | cut -d "/" -f 10 | while read id; do (fasterq-dump --split-files -e 24 ./$id --include-technical); done
4、同一個樣本品測序文件合并(這個作者同一個樣品有四個測序文件)
cat SRR17064075_1.fastq SRR17064076_1.fastq SRR17064087_1.fastq SRR17064088_1.fastq > V-LPP_S1_L001_R1_001.fastq
cat SRR17064075_2.fastq SRR17064076_2.fastq SRR17064087_2.fastq SRR17064088_2.fastq > V-LPP_S1_L001_R2_001.fastq
5、壓縮一下(如果覺得文件大可以壓縮,不壓縮也沒有關(guān)系,cellranger也能識別)
ls *fastq | while read id; do gzip $id; done &
6、下載cellranger(https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/tutorial_in)
tutorial頁面中使用curl和wget下載都會出現(xiàn)404錯誤,而且版本也不是最新的。需要通過Download page輸入個人信息后(如下圖),獲得最新cellranger版本下載鏈接和參考基因組

image.png
確認(rèn)cellranger是否安裝好
(base) [medxh@login2 qingdao]$ which cellranger
~/yard/apps/cellranger-6.0.2/cellranger
7、批量運(yùn)行cellranger
#! /bin/sh
ref=/lustre/home/acct-medxh/medxh/yard/reference/refdata-gex-GRCh38-2020-A
ls /lustre/home/acct-medxh/medxh/sccdata/thin.end/qingdao/output/*.fastq | cut -d "/" -f 10 | cut -d "_" -f 1 | uniq | while read id;
do
cellranger count --id=$id \
--transcriptome=$ref \
--fastqs=/lustre/home/acct-medxh/medxh/sccdata/thin.end/qingdao/output \
--sample=$id \
--nosecondary \
--localcores=40
done
sbatch -p cpu --exclusive cellranger.sh
8、得到表達(dá)矩陣,下游在R studio中進(jìn)行分析

image.png