單細胞轉錄組上游分析實戰

一、下載數據

GSE111229 :https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE111229

只下載7個SRR進行學習;

數據下載的話可以參考前面寫的一篇筆記:

RNA-seq入門(一)數據下載和格式轉換

1.png

二、安裝conda

參考前面的筆記:

conda下載及安裝

安裝軟件:

conda install -y sra-tools multiqc fastp hisat2

三、SRA轉fastq文件

ls * |while read id; do (nohup fastq-dump --gzip --split-3 -O ./ ${id} &); done

四、質控

ls *gz |xargs fastqc

五、過濾

  1. 新建幾個文件夾
mkdir 01clean 02mapping 03count
  1. 批量fastp
ls *.fastq.gz | while read id; do (nohup fastp -i ${id} -o ../01clean/$(basename ${id} ".gz").clean);done
2.png

六、比對

下載參考基因組

hisat2官網有建好索引的基因組下載:

http://daehwankimlab.github.io/hisat2/download/#m-musculus

3.png

批量比對

cd 02mapping/
ls ../01clean/*clean |while read id;do (nohup hisat2 -p 2 -x /mnt/e/bioinfo/mmreference/mm10/genome -U $id -S ${id%%.*}.hisat.sam &);done

%%.* 語法參考

https://blog.csdn.net/qq_30130417/article/details/80911989

file=/dir1/dir2/dir3/my.file.txt

{file#*/}: 刪掉第一個 / 及其左邊的字符串:dir1/dir2/dir3/my.file.txt

{file##*/}: 刪掉最后一個 / 及其左邊的字符串:my.file.txt

{file#*.}: 刪掉第一個 . 及其左邊的字符串:file.txt

{file##*.}: 刪掉最后一個 . 及其左邊的字符串:txt

{file%/*}: 刪掉最后一個 / 及其右邊的字符串:/dir1/dir2/dir3

{file%%/*}: 刪掉第一個 / 及其右邊的字符串:(空值)

{file%.*}: 刪掉最后一個 . 及其右邊的字符串:/dir1/dir2/dir3/my.file

{file%%.*}: 刪掉第一個 . 及其右邊的字符串:/dir1/dir2/dir3/my

由于是在自己電腦上跑數據,沒用服務器,結果死機了,還是一個個數據單獨比對吧,這里只演示一個:

nohup hisat2 -p 2 -x /mnt/e/bioinfo/mmreference/mm10/genome -U ../01clean/SRR6790711.fastq.clean -S SRR6790711.hisat.sam &

sam格式 轉bam格式

ls *.sam | while read id;do (samtools sort -O bam -@ 2 -o $(basename ${id} ".sam").bam ${id});done

為bam文件構建index

ls *.bam |xargs -i samtools index {}

七、count

下載featureCounts

wget https://sourceforge.net/projects/subread/files/subread-2.0.2/subread-2.0.2-Linux-x86_64.tar.gz

下載gtf文件
genecode: https://www.gencodegenes.org/mouse/

4.png

全路徑運行featureCounts

/mnt/d/bioinfo/biosoft/featureCounts/subread-2.0.2-Linux-x86_64/bin/featureCounts -T 5 -t exon -g gene_id -a /mnt/e/bioinfo/mmreference/gencode.vM30.annotation.gtf -o ../03count/all.id.txt *.bam 1>counts.id.log 2>&1 &

參考:

B站生信技能樹:

https://www.bilibili.com/video/BV1dt411Y7nn?p=4&spm_id_from=333.1007.top_right_bar_window_history.content.click&vd_source=eeaea161c747e711136e1a14fba65648

?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容