samtools + bcftools

20 篇文章 3 订阅

samtools + bcftools处理 一个donor 的800多个细胞

# conda activate ngs

/public/home/djs/software/tools_NCBI/sratoolkit.2.10.9-ubuntu64/bin/prefetch-orig.2.10.9  --option-file /public/home/djs/huiyu/20220613_scRNA_VAF/SRR_Acc_List.txt -X 1000G -p -r yes -c -O /public/home/djs/huiyu/20220613_scRNA_VAF/ -t http

ls |while read id ;do echo "~/software/tools_NCBI/sratoolkit.2.10.9-ubuntu64/bin/fasterq-dump  --split-3  ./$id/${id}.sra" >> fasterq_dump.sh; done
ParaFly -c fasterq_dump.sh -CPU 10 >out.log 2>err.log


mkdir {QC_1,QC_2,clean_data}

ls |grep ".fastq" | while read id ;do (fastqc -o ./QC_1  $id &);done

cd QC_1
mkdir multiqc
multiqc ./ -o ./multiqc

cd ../
ls |grep "1.fastq" > 1.txt
ls |grep "2.fastq" > 2.txt
paste 1.txt 2.txt > trim.txt
cat trim.txt |while read id;do a=($id) && ~/software/TrimGalore-master/trim_galore -q 25 --phred33 --stringency 3 -o ./clean_data --paired ${a[0]} ${a[1]}; done

cd clean_data/
ls |grep "report" |while read id ;do rm $id ;done
ls |grep "val.*fq" | while read id ;do (fastqc -o ../QC_2  $id &);done
cd ../QC_2/
mkdir multiqc
multiqc ./ -o ./multiqc


cd ../clean_data
ls |grep "val_1.fq" > 1.txt
ls |grep "val_2.fq" > 2.txt
paste 1.txt 2.txt  > map.txt
cat map.txt |while read id;do a=($id) && echo "/public/home/djs/software/bwa-0.7.17/bwa mem /public/home/djs/software/bwa-0.7.17/index_bwa/human_38/human_ref      ${a[0]}  ${a[1]} > ${a[0]}.sam";done >> mapping.sh
nohup ParaFly -c mapping.sh -CPU 20 >out.log 2>err.log &

# sam_to_bam && sort && index

ls |grep "fq.sam" |while read id ;do echo "samtools view -u ${id} | samtools sort -  > ${id}.sort.bam  && samtools index ${id}.sort.bam" ;done > sam_to_bam.sh

nohup ParaFly -c sam_to_bam.sh -CPU 20 >out.log 2>err.log &

# samtools mpileup && bcftools calling
ls |grep "sort.bam" | grep -v "bai" |while read id ;do echo "samtools mpileup -uf /public/home/djs/software/STAR-2.7.7a/genome_raw/GRCh38.primary_assembly.genome.fa ${id} >> ${id}.bcf && bcftools view -v snps ${id}.bcf > ${id}.vcf && java -Xmx8g -jar /public/home/djs/software/snpEff/snpEff.jar -c /public/home/djs/software/snpEff/snpEff.config  GRCh38 ${id}.vcf >> ${id}.ann.vcf";done > snv_calling.sh
nohup ParaFly -c snv_calling.sh -CPU 20 >>out.log 2>>err.log &
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值