Posted Updated 3 minutes read (About 403 words)0 visits
RNA-seq-Liver
质控
1 2 3 4 5 6 7
| input_dir=/home/gongyuqi/project/RNA-seq/liver-mouse/clean output_dir=/home/gongyuqi/project/RNA-seq/liver-mouse/clean/QC
nohup fastqc -t 18 $input_dir/*fq.gz -o $output_dir &
dir=/home/gongyuqi/project/RNA-seq/liver-mouse/clean/QC multiqc $dir/*fastqc.zip --ignore $dir/*.html
|
Hisat2 进行比对
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| ls *1.clean.fq.gz >fq1.txt ls *2.clean.fq.gz >fq2.txt paste fq1.txt fq2.txt >sample.txt
ref=/home/gongyuqi/ref/mm10/index/hisat2/mm10 cat sample.txt|while read id do arr=(${id}) fq1=${arr[0]} fq2=${arr[1]} sample=${fq1%%_*}.sort.bam hisat2 -p 8 -x $ref -1 $fq1 -2 $fq2 | samtools sort -@ 8 -o /home/gongyuqi/project/RNA-seq/liver-mouse/align/$sample - done
chmod +x hisat2-alignment.sh nohup bash hisat2-alignment.sh &
|
统计比对情况
1 2 3 4 5 6
| ls *.bam|xargs -i samtools index {}
ls *.bam|xargs -i samtools flagstat -@ 8 {} | grep "mapped (" > mapping_ratio.txt ls *.bam > bam.txt paste bam.txt mapping_ratio.txt|gawk 'BEGIN{FS=" "}{print $1,$6}'|sed 's/(/: /g' > mapping_results.txt
|
比对后质量控制
qualimap bamqc & qualimap multi-bamqc
1 2 3
|
qualimap --java-mem-size=16G multi-bamqc -d multi-bamqc.txt -outdir qualimap_multi-bamqc -outformat PDF:HTML
|
qualimap rnaseq & multiqc
1 2 3 4 5 6
| cat qualimap_rnaseq.sh gtf=/home/gongyuqi/ref/mm10/GTF/gencode.vM24.annotation.gtf ls *.bam | while read id; do qualimap --java-mem-size=16G rnaseq -pe -bam $id -gtf $gtf -outdir ${id%%.*}_qualimap_rnaseq -outformat PDF:HTML -oc ${id%%.*}; done nohup ./qualimap_rnaseq.sh &
multiqc *_rnaseq
|
featureCounts生成表达矩阵
1 2 3 4
| gtf=/home/gongyuqi/ref/mm10/GTF/gencode.vM24.annotation.gtf nohup featureCounts -T 8 -p -t exon -g gene_id -a $gtf -o ../matrix/RNA-matrix.txt *.bam 1>counts.id.log 2>&1 &
multiqc RNA-matrix.txt.summary
|