pilon error, file .bam must be indexed BAM

192 Views Asked by At

I have an error to do this:

After Flye assembly I obtain the file assembly_DG_1.fasta

The I used:

bwa index assembly_DG_1.fasta 
bwa mem -pt16 assembly_DG_1.fasta DG_1_R1_001_val_1.fq.gz DG_1_R2_001_val_2.fq.gz | samtools sort -m4G -@4 -o align.bam -

Afterwards I used pilon:

pilon --genome flye_corrected_DG_1/assembly_DG_1.fasta --bam align.bam

ERROR: align.bam must be indexed BAM

1

There are 1 best solutions below

0
On

Using:

samtools index -bc align.bam

and then

pilon --genome flye_corrected_DG_1/assembly_DG_1.fasta --bam align.bam

Solved the problem.