Problems with bedtools installation

1.1k views Asked by At

I am a very new beginner in bash programming and never succeed in installing tools on my computer.

I am trying to install bedtools without any success

I typed these following commands on my terminal

wget https://github.com/arq5x/bedtools2/releases/download/v2.29.1/bedtools-2.29.1.tar.gz
tar -zxvf bedtools-2.29.1.tar.gz
cd bedtools2
make

It seems everything is good at these steps and then in order to add it on my path I typed:

echo 'export PATH="$PATH:/Users/avitrac/my_bin/bedtools2"' >> ~/.bash_profile

but when I am testing some basic command such as bedtools -h it says bedtools command is not found.

I feel there is something wrong with the echo step or with my bash_profil. I tried to follow instruction that I have read on internet but I feel I may did some mistakes.

Could someone help me ? I don't understand what is wrong and how to fix it !

1

There are 1 answers

8
Jeff Schaller On BEST ANSWER

It looks like you accidentally downloaded and compiled the program under your my_bin directory. That creates some potential for confusion, so I would recommend running the wget and make commands from a temporary directory, such as /tmp or a tmp directory under your home directory. As a result, the compiled binaries are now under /Users/avitrac/my_bin/bedtools2/bin. I would recommend moving that directory outside of your my_bin directory, perhaps to a ~/tmp directory; you could then skip directly to step 5 below.

(You could leave it there and simply cp /Users/avitrac/my_bin/bedtools2/bin/bedtools ~/my_bin, but that would leave the source code and compilation artifacts under your bin directory for no good reason).

  1. mkdir ~/tmp ## if needed
  2. cd ~/tmp
  3. wget https://github.com/arq5x/bedtools2/releases/download/v2.29.1/bedtools-2.29.1.tar.gz
  4. make
  5. cp bin/bedtools ~/my_bin/

The bedtools-2.29.1.tar.gz file and bedtools2 directory can both be removed now. The "Compiling from source via Github" instructions gloss over this (fairly typical) use-case and omitted the explicit instructions to build the program in a temporary location.