Question: BWA command not found
gravatar for cabioc
11 months ago by
cabioc0 wrote:

I followed this tutoral ( to installed BWA (bwa-0.7.17.tar) on my Mac. After I did everything (till "execute the command", ~/.bash_profile), BWA still couldn't be run. When I type bwa, it shows "-bash: bwa: command not found".

the use path for the Terminal is:

(base) mean-machine:bwa-0.7.17 Admin$ echo $PATH

It looks lots of repeats exist in my terminal PATH. I'm not sure if that's the reason I can't run BWA?

Can someone guid me to correct the problem? Thanks

alignment • 1.1k views
ADD COMMENTlink modified 11 months ago by ATpoint39k • written 11 months ago by cabioc0
gravatar for ATpoint
11 months ago by
ATpoint39k wrote:

The error is clear, bwa is not in PATH or at least in those folders in PATH there is no bwa executable. Go into the folders and check if the executable is indeed there. Did you run source ~/.bash_profile? Alternatively, simply open a new tab on Terminal.

ADD COMMENTlink modified 11 months ago • written 11 months ago by ATpoint39k

Thank you ATpoint.
I did run source ~/.bash_profile and it didn't say anything wrong in the Terminal.

I tried to list what it contains in the folder:

(base) mean-machine:bwa-0.7.17 Admin$ ls
COPYING     bwa.h       bwashm.o    bwtsw2_aux.c    kopen.o     maxk.c
ChangeLog   bwa.o       bwt.c       bwtsw2_aux.o    kseq.h      maxk.o
Makefile    bwakit      bwt.h       bwtsw2_chain.c  ksort.h     pemerge.c     bwamem.c    bwt.o       bwtsw2_chain.o  kstring.c   pemerge.o
QSufSort.c  bwamem.h    bwt_gen.c   bwtsw2_core.c   kstring.h
QSufSort.h  bwamem.o    bwt_gen.o   bwtsw2_core.o   kstring.o   rle.c
QSufSort.o  bwamem_extra.c  bwt_lite.c  bwtsw2_main.c   ksw.c       rle.h   bwamem_extra.o  bwt_lite.h  bwtsw2_main.o   ksw.h       rle.o   bwamem_pair.c   bwt_lite.o  bwtsw2_pair.c   ksw.o       rope.c
bamlite.c   bwamem_pair.o   bwtaln.c    bwtsw2_pair.o   kthread.c   rope.h
bamlite.h   bwape.c     bwtaln.h    example.c   kthread.o   rope.o
bamlite.o   bwape.o     bwtaln.o    fastmap.c   kvec.h      utils.c
bntseq.c    bwase.c     bwtgap.c    fastmap.o   libbwa.a    utils.h
bntseq.h    bwase.h     bwtgap.h    is.c        main.c      utils.o
bntseq.o    bwase.o     bwtgap.o    is.o        main.o
bwa     bwaseqio.c  bwtindex.c  kbtree.h    malloc_wrap.c
bwa.1       bwaseqio.o  bwtindex.o  khash.h     malloc_wrap.h
bwa.c       bwashm.c    bwtsw2.h    kopen.c     malloc_wrap.o
(base) mean-machine:bwa-0.7.17 Admin$

As you can see, these is a "bwa" in the list, but I couldn't found in the folder. By the way, the folder I placed on the desktop.

What can I do to add "bwa" to the PATH? Sorry, the question is so stupid, but I just know very little about computer and computer programming.

ADD REPLYlink modified 11 months ago by ATpoint39k • written 11 months ago by cabioc0

Go into the folder where the executable is, then type pwd, copy the output, e.g. /path/to/this/folder, then add this to .bash_profile:

export PATH=$PATH:/path/to/this/folder then save and close .bash_profile, open a new tab and it should be ok.

ADD REPLYlink written 11 months ago by ATpoint39k

The problem solved. Thank you ATpoint!

ADD REPLYlink written 11 months ago by cabioc0
Please log in to add an answer.


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