美文网首页单细胞转录组生信分析工具包WES与WGS
NCBI公共数据库下载10x单细胞数据进行上游分析的全流程

NCBI公共数据库下载10x单细胞数据进行上游分析的全流程

作者: Yu_Lin | 来源:发表于2022-06-02 16:29 被阅读0次

参考生信技能书
一文打通单细胞上游:从软件部署到上游分析
prefetch官网说明
cellranger官网说明
本教程是基于下载NCBI公共数据库10x单细胞数据sra文件,进行解压合并和重命名,最后运行cellranger得到单细胞表达矩阵。
第一步、下载和安装prefetch软件;
第二步、解压sra文件,如有特殊情况需要对测序文件进行合并,依据cellranger的要求对文件进行重命名;
第三步、安装和运行cellranger。

1、安装prefetch(在NCBI官网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文件

首先、点击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转fastq

常规的SRA转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、压缩一下(如果觉得文件大可以压缩,不压缩也没有关系,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下载都会出现404错误,而且版本也不是最新的。需要通过Download page输入个人信息后(如下图),获得最新cellranger版本下载链接和参考基因组


image.png

确认cellranger是否安装好

(base) [medxh@login2 qingdao]$ which cellranger 
~/yard/apps/cellranger-6.0.2/cellranger

7、批量运行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、得到表达矩阵,下游在R studio中进行分析

image.png

相关文章

网友评论

    本文标题:NCBI公共数据库下载10x单细胞数据进行上游分析的全流程

    本文链接:https://www.haomeiwen.com/subject/fiafmrtx.html