How To Check That Bwa Index -A Bwasw Succeeded
2
1
Entering edit mode
13.8 years ago

Hi,

Is there a quick and easy way to check that bwa index succeeded, like in the command below?

bwa index -a bwtsw Homo_sapiens.GRCh37.61.dna.toplevel.fa.gz

Cheers

bwa • 5.5k views
ADD COMMENT
3
Entering edit mode
13.8 years ago
Michael 55k

On a unix-like system checking for the return value of the process should work, if 0 it's fine, if != 0 an error happened. At least that's how it is supposed to work in a shell script:

#!/bin/sh
bwa index <whatever>
ret=$?
if [ $ret != 0 ] ; then
   echo "an error happened"
fi

Edit: to check if the file is ok or not? I think bwa aln should throw an error, shouldn't it?

So what could have gone wrong, then, the file transmission, use md5sum to check that? If unsure, I would always run bwa index myself, if I could. Otherwise, the user giving you the index should be asked to monitor the output and return code of bwa index.

ADD COMMENT
1
Entering edit mode

Sorry, I meant once the file has been created with the command above, let's say by someone else, how would one go about checking if it was successfully indexed? Is there a command to check the files are fine after it's been run?

ADD REPLY
1
Entering edit mode
13.3 years ago
Pfudd ▴ 10

You could take random fragments of the original fasta file and use bwa to align them to the database; if it finds them all, then it's working. Then do the same with randomly generated fasta sequences, there should be almost no hits. That's the ol' positive-control/negative-control method of running an experiment! :-)

ADD COMMENT

Login before adding your answer.

Traffic: 1832 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6