环境配置
conda create -n rna python=3.9
conda activate rna
conda install -y multiqc trim-galore subread hisat2
质检
fastqc *.fastq.gz
multiqc *.zip
去接头
vim fastq_list.txt ### 构建自己的文件列表
cat fastq_list.txt | while read id;
do (trim_galore -q 20 \
--phred33 --stringency 3 \
--length 20 -e 0.1 \
--paired ${id}_L002_R1_001.fastq.gz ${id}_L002_R2_001.fastq.gz \
--gzip -o ./clean ); done
比对
mkdir aligned
cat ./fastq_list.txt | while read id;
do (hisat2 -t -p 20 -x ~/ref/hg38/genome \
-1 ./clean/${id}_L002_R1_001_val_1.fq.gz -2 ./clean/${id}_L002_R2_001_val_2.fq.gz \
-S ./aligned/${id}.sam); done
得到count值
mkdir counts
cat ./fastq_list.txt | while read id;
do (featureCounts -T 5 \
-t exon \
-g gene_id \
-a ~/ref/Homo_sapiens.GRCh38.107.chr.gtf \
-o ./counts/${id}_counts.txt \
./aligned/${id}.sam); done
最终会在目标文件夹下面获得两个文件,counts.txt和counts.txt.summary。在R中进行ID转换即可。
网友评论