PoisonAlien/trackplot

R cannot locate bwtool - cannot run trackplot's functions

aspepin opened this issue · 2 comments

It seems like R cannot locate bwtool.
I configured and installed libz, libbeato and bwtool on a macOS (v. 10.14.5) using the following commands on the terminal:

git clone 'https://github.com/CRG-Barcelona/bwtool' 
git clone 'https://github.com/CRG-Barcelona/libbeato' 
git clone https://github.com/madler/zlib cd zlib/ 
./configure --prefix=$HOME ./configure --prefix=$HOME 
make 
cd .. 
cd libbeato/ 
git checkout 0c30432af9c7e1e09ba065ad3b2bc042baa54dc2 
./configure --prefix=$HOME make cd ../bwtool/ ./configure --prefix=$HOME CFLAGS='-I../libbeato -I../zlib' LDFLAGS='-L../libbeato/jkweb -L../libbeato/beato -L../zlib' 
make 
make install

Next, I ran the following on R (version 4.0.2):

source("https://github.com/PoisonAlien/trackplot/blob/master/trackplot.R?raw=true") 
source("./trackplot.R") 
bigWigs <- c("file1.bw", "file2.bw", "file3.bw", "file4.bw",) 
track_data <- track_extract(bigWigs = bigWigs, loci="chr6:56,561,043-56,576,527")

and I get the following error:

Error in .check_bwtool() :
Could not locate bwtool. Download it from here: https://github.com/CRG-Barcelona/bwtool/releases

How can I get R to locate bwtool?

Hi,
You just need to copy/move the binary to a PATH (e.g; /usr/local/bin) or to a directory under PATH

or just alter your last make command with,

sudo make install

In any case, make sure that when you run which bwtool from terminal, it shows the path

$ which bwtool 
/usr/local/bin/bwtool

Feel free to comment if its not working.

It worked! Thank you so much!!!