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