bwa-mem2 / bwa-mem2

The next version of bwa-mem
Other
712 stars 97 forks source link

nanopore sequencing data alignment fault #114

Open sen1019san opened 3 years ago

sen1019san commented 3 years ago

Hi, I am trying to align 16S/ITS read from nanopore sequencing against 16S/ITS reference. bwa-mem2 (v2.0pre2) do well in building index. But it fails in the alignment step. bwa-mem2 version: 2.0pre2_x64-linux os: Ubuntu 16.04.7 LTS cpu: Intel(R) Xeon(R) CPU E7-8867 v4 @ 2.40GHz ram: 503GB The reference genome size is 320Mb, and the read file size is 14Mb with 10000 reads.

Here shows the command.

bwa-mem2 mem -t 20 -k14 -W20 -r10 -A1 -B1 -O1 -E1 -L0 -M ${path}/database/bacteria_fungi_LY_16s_bwa \
$read > ${path}/${species}.sam

The error information shows as follows.

-----------------------------
Executing in AVX2 mode!!
-----------------------------
Ref file: xxx/database/bacteria_fungi_LY_16s_bwa
Entering FMI_search
reference seq len = 650945371
count
0,      1
1,      176416723
2,      325472686
3,      474528649
4,      650945371

Reading other elements of the index from files xxx/database/bacteria_fungi_LY_16s_bwa
prefix: xxx/database/bacteria_fungi_LY_16s_bwa
[M::bwa_idx_load_ele] read 0 ALT contigs
Done reading Index!!
Reading reference genome..
Binary seq file = xxx/database/bacteria_fungi_LY_16s_bwa.0123
Reference genome size: 650945370 bp
Done readng reference genome !!

[0000] 1: Calling process()

Threads used (compute): 20
Info: projected #read in a task: 1324513
------------------------------------------
Memory pre-allocation for chaining: 2786.7754 MB
Memory pre-allocation for BSW: 4792.3405 MB
Memory pre-allocation for BWT: 1546.2835 MB
------------------------------------------
No. of pipeline threads: 2
[0000] read_chunk: 200000000, work_chunk_size: 6796337, nseq: 10000
        [0000][ M::kt_pipeline] read 10000 sequences (6796337 bp)...
[0000] 2. Calling mem_process_seqs.., task: 0
[0000] 3. Calling kt_for - worker_bwt
[0000] read_chunk: 200000000, work_chunk_size: 0, nseq: 0
bwa-mem2: src/bntseq.cpp:442: unsigned char *bns_fetch_seq(const bntseq_t *, const unsigned char *, long *, long, long *, int *): Assertion `*beg <= mid && mid < *end' failed.
./bwa_align.sh: line 43: 104909 Aborted                 (core dumped) bwa-mem2 mem -t 20 -k14 -W20 -r10 -A1 -B1 -O1 -E1 -L0 -M ${path}/database/bacteria_fungi_LY_16s_bwa $read > ${path}/${species}.sam

The How can I solve this problem? Any advice would be appreciated.

keiranmraine commented 3 years ago

That is an older version with known issues. Please retry with the current version 2-2.1. You will need to rebuild the indexes. The memory requirement will be far lower as will index loading time.

This may not resolve the issue but it will be far easier to diagnose the problem on the current version.

colindaven commented 3 years ago

Why not use minimap2 as opposed to bwa mem1 or 2 for aligning nanopore data ?