BWA安装,BWA-ALN使用,修正contigs

发布时间:2024年01月07日

BWA安装

git clone https://github.com/lh3/bwa.git
cd bwa; make

BWA-ALN使用

安装依赖项

#bcftools
wegt https://github.com/samtools/bcftools/releases/download/1.19/bcftools-1.19.tar.bz2
tar -xvjf bcftools-1.19.tar.bz2
cd bcftools-1.19
./configure
make 
sudo make install
(完整路径)/bcftools-1.19/bcftools
#seqtk
git clone https://github.com/lh3/seqtk.git;
cd seqtk; make
#bgzip
git clone https://github.com/samtools/htslib.git
cd htslib
autoreconf -i
./configure
make
sudo make install
(完整路径)/bwa/bwa index contig.fa
(完整路径)/bwa/bwa aln -t 180 contig.fa r1.fq r2.fq > sample_bwa_aln.sai
(完整路径)/bwa/bwa samse contig.fa sample_bwa_aln.sai r1.fq r2.fq > sample_bwa_aln.sam
samtools view -Sb -@180 sample_bwa_aln.sam > sample_bwa_aln.bam
samtools sort -@180 sample_bwa_aln.bam -o sample_bwa_aln_sorted.bam
samtools index sample_bwa_aln_sorted.bam
(完整路径)/bcftools mpileup --threads 180 -f contig.fa sample_bwa_aln_sorted.bam | bcftools call -c > sample_variants.vcf
(完整路径)/bcftools filter -e 'DP<5' sample_variants.vcf > sample_filtered_variants.vcf
(完整路径)/bgzip -c sample_filtered_variants.vcf > sample_filtered_variants.vcf.gz
(完整路径)/tabix -p vcf sample_filtered_variants.vcf.gz
(完整路径)/bcftools consensus -f contig.fa sample_filtered_variants.vcf > corrected_contig.fa

文章来源:https://blog.csdn.net/m0_53945548/article/details/135407246
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。