0%

Extract mutations and INDEL error rates from next-generation sequencing results

Alignment

Ensure there is bwa in the environment. If not, install using this:

1
2
3
git clone https://github.com/lh3/bwa.git
cd bwa
make

or

1
sudo apt install bwa

Ensure there are reference in .fasta and reads_R1 & reads_R2 in .fastq or .fq.

1
2
3
4
#Create Index Files
bwa index reference.fasta

bwa mem reference.fasta reads_R1.fq reads_R2.fq > aln-pe.sam

Follow-up processing

Ensure there are samtools and bcftools in the environment. If not, install using this:

1
2
sudo apt install samtools
sudo apt install bcftools

then use samtools,

1
2
3
4
5
6
7
8
9
10
11
# Convert SAM to BAM
samtools view -Sb aln-pe.sam > aln-pe.bam

# Sort BAM file
samtools sort aln-pe.bam -o aln-pe.sorted.bam

# Index BAM file
samtools index aln-pe.sorted.bam

# .mpileup contains information about each locus
samtools mpileup -f reference.fasta aln-pe.sorted.bam > aln-pe.mpileup

and use bcftools to process .mpileup file and call mutations.

1
bcftools mpileup -f reference.fasta aln-pe.sorted.bam | bcftools call -mv -Ov > variants.vcf

Error rate calculating