NCBI公共數(shù)據(jù)庫下載10x單細(xì)胞數(shù)據(jù)進(jìn)行上游分析的全流程

參考生信技能書
一文打通單細(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

參考https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/using/tutorial_ct

#! /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
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容