Question: Alignment using bwa mem throws segmentation error
0
gravatar for shuksi1984
10 days ago by
shuksi198420
shuksi198420 wrote:

I am trying to run bwa-mem for human exome for hg38gatkbundle: HG100.1.exome.fastq 1.3G HG100.2.exome.fastq 1.3G

My machine configuration is:

RAM:16GB

HDD: 1TB

OS: Ubuntu 16.04.4 LTS, xenial

CPU: 64bit, 4 core

bwa version: BWA: 0.7.12-r1039

My command is:

 sudo bwa mem -t 2 -M -R '@RG\tID:sample_1\tLB:sample_1\tPL:ILLUMINA\tPM:HISEQ\tSM:sample_1' /data/ngs/references/hg38gatkbundle/Homo_sapiens_assembly38.fasta HG100.1.exome.fastq HG100.2.exome.fastq > HG100_bwamem.sam

The above command is throwing error: segmentation fault (core dumped)

ADD COMMENTlink modified 10 days ago by Vijay Lakhujani2.5k • written 10 days ago by shuksi198420
1

Use the -v <INT> to get more details.

ADD REPLYlink written 10 days ago by arup340

Hello shuksi1984,

segmentation fault is a very generic error message and makes quite hard to find the real problem. But you are are using sudo. Why? Never do this for running a program that has nothing to do with the system.

So first try running bwa without sudo and let's see what happens.

fin swimmer

ADD REPLYlink modified 10 days ago • written 10 days ago by finswimmer2.8k

Removed "sudo". Still getting error (same error)

ADD REPLYlink modified 10 days ago • written 10 days ago by shuksi198420

Ok, so next thing you should do is updating bwa. 0.7.12 was published 2014. The current version is 0.7.17.

If this doesn't help either try running without the -t parameter.

fin swimmer

ADD REPLYlink modified 10 days ago • written 10 days ago by finswimmer2.8k

Can to tell me steps to update the bwa? I tried updating from the given link and followed the given steps:

tar -xvf bwa-0.7.17.tar.bz2   

 cd bwa-0.7.17

./configure  
 make  
 make install

But got error: ./bash configure not found

If this doesn't help either try running without the -t parameter.

Also, tried with and without -t. But no use.

ADD REPLYlink modified 10 days ago • written 10 days ago by shuksi198420

Hello,

just do make. There is no ./configure nad make install for bwa. When then using this version of bwa make sure you type the complete path to the bwa binary.

ADD REPLYlink written 10 days ago by finswimmer2.8k

Installed bwa -0.7.17. Ran following command:

path/to/bwa-0.7.17/bwa mem -M -R '@RG\tID:sample_1\tLB:sample_1\tPL:ILLUMINA\tPM:HISEQ\tSM:sample_1' /data/ngs/references/hg38gatkbundle/Homo_sapiens_assembly38.fasta HG100.1.exome.fastq HG100.2.exome.fastq > HG100_bwamem.sam

Problem still persists.

ADD REPLYlink modified 10 days ago • written 10 days ago by shuksi198420

As arup suggested please run bwa with -v 4+ for getting debugging informations.

ADD REPLYlink written 10 days ago by finswimmer2.8k

I ran following command

/path/to/bwa-0.7.17/bwa mem -M -R '@RG\tID:sample_1\tLB:sample_1\tPL:ILLUMINA\tPM:HISEQ\tSM:sample_1' /data/ngs/references/hg38gatkbundle/Homo_sapiens_assembly38.fasta HG100.1.exome.fastq HG100.2.exome.fastq > HG100_bwamem.sam -v 4+

This is what I got:

[M::bwa_idx_load_from_disk] read 3171 ALT contigs [M::process] read 10000 sequences (1079584 bp)... Segmentation fault (core dumped)

Can Homo_sapiens_assembly38.fasta be problematic? I checked for other dependencies but could hardly find any problem.

ADD REPLYlink modified 10 days ago • written 10 days ago by shuksi198420

(core dumped) is mostly a memory issue. You should try to increase memory for that analysis.

ADD REPLYlink modified 10 days ago • written 10 days ago by Mehmet370

I ran the command with very small single end fastq file of 4.0K, still getting the same error. Hence belive RAM, HDD, or core is not the problem because bwa is running on other machines with same configuration. I dont understand the root cause. Updating the tool along with java version and samtools also didnt help.

ADD REPLYlink written 6 days ago by shuksi198420

The configuration with other machine may be the same, but what I mean is that you may not have permission to use enough memory for bwa to write. In most case we, lets say, have 16 GB memory but we do not have permission to use all those memory for a program/tool. We need to allocate a memory for bwa to write files. Mostly there are read and write memories in OS. For instance, in graphic user tools in configuration file there is a memory option and we can increase in case the tools need. My advice is to use a pieces of fastq files (the first 20 seqs) to check your program is running correctly when it needs less memory.

ADD REPLYlink written 6 days ago by Mehmet370
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 933 users visited in the last hour