This is a test version of Biostars. For the public version, visit https://www.biostars.org.
BWA command not found

I followed this tutoral (https://icb.med.cornell.edu/wiki/index.php/Elementolab/BWA_tutorial) 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
/Library/Frameworks/Python.framework/Versions/3.7/bin:/Library/Frameworks/Python.framework/
Versions/3.7/bin:/anaconda3/bin:/anaconda3/condabin:/Library/Frameworks/Python.framework/Versions/
3.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/Admin/Library/Python/3.7/bin://Users/Admin/Desktop/BWA/bwa-0.7.17://Users/Admin/Desktop/BWA/bwa-0.7.17source:/Users/Admin/Desktop/BWA/bwa-0.7.17:/Users/Admin/Desktop/BWA/bwa-0.7.17

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 answer

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.

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
NEWS.md     bwamem.c    bwt.o       bwtsw2_chain.o  kstring.c   pemerge.o
QSufSort.c  bwamem.h    bwt_gen.c   bwtsw2_core.c   kstring.h   qualfa2fq.pl
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
README-alt.md   bwamem_extra.o  bwt_lite.h  bwtsw2_main.o   ksw.h       rle.o
README.md   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      xa2multi.pl
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.

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.

The problem solved. Thank you ATpoint!

Log in to answer this question.