How To Install Bedtools In A User Directory
3
1
Entering edit mode
11.4 years ago
alittleboy ▴ 220

I am trying to install Bedtools in a user directory, however I looked at the manual for its makefile, and there is no such argument like "--prefix" for me to change. Is there a way to install all Bedtools in a directory that I specify? Thanks!

bedtools • 12k views
ADD COMMENT
1
Entering edit mode

Couldn't you just compile it and then put the executable files wherever you want? Then add that directory to your path? That's how I normally do it.

ADD REPLY
0
Entering edit mode

thanks! but I cannot add the directory to my path due to permission limitations...

ADD REPLY
1
Entering edit mode

if you run SETENV or EXPORT in order to set your environment variables, what exactly shell tells you? I didn't know one can disable user's ability to set those.

ADD REPLY
0
Entering edit mode

yes it's possible to prevent setting PATH using restricted shell:

bash -r
$ export PATH=~/bin
bash: PATH: readonly variable
$ ~/bin/myprog
bash: /export/home/michaeld/bin/myprog: restricted: cannot specify `/' in command names

but you should quarrel with your sysadmin, because it's just annoying (and not more secure unless installed absolutely the correct way) or try to break out of it, how to is in the wikipedia article. So, I guess that you are in some sort of 'high-security' setting, like a hospital server with personal genomics data. If restricted shell is used correctly, you will possibly not be able to install and run any software from your home but need to ask your IT guy to install it.

ADD REPLY
1
Entering edit mode

Run echo $PATH to find directories from which you can run binaries. Copy your binaries-of-interest to one of these folders. If you have no permissions to change the contents of these folders, edit your shell's profile to add a local directory (one which you have control over) to your PATH variable (e.g., http://www.troubleshooters.com/linux/prepostpath.htm). Copy your binaries-of-interest to this local directory.

ADD REPLY
2
Entering edit mode

Or just write the whole path when you invoke the programs

ADD REPLY
0
Entering edit mode
10.6 years ago
jurgnjn ▴ 70

According to the manual, the make procedure will place all binaries into /BEDTools.<version>./bin/, so you can just copy all the files from there to the directory of your choosing (as discussed in the comments, the target directory should presumably be contained in your $PATH variable).

ADD COMMENT
0
Entering edit mode
10.6 years ago
Michael 55k

From what you are telling it looks like you are bound to use a restricted login shell. This might be a rare situation, but under these circumstances you will be unable to build and run any program that is not on the predefined path already (unless your admin is a dummy) or change that path, this has nothing to do with bedtools. You need to contact your sysadmin to install any additional program you want to run.

Sorry, just saw that this was posted 9 months ago.

ADD COMMENT
0
Entering edit mode
10.6 years ago
paulr ▴ 80

You might want to discuss with your systems administrator the restriction about changing environment variables. But if you can't change your PATH environment variable, then perhaps you could try using the 'alias' command:

alias bedtools=/path/to/bin/bedtools

Are you allowed to edit your shell's profile? You should be able to add this alias (among the other shell wrappers in the bedtools/bin).

[EDIT]

As pointed out by @Michael Dondrup, alias solution as is above will not work. However, there is a caveat in the restrictions, namely, the following from the bash manual

When a command that is found to be a shell script is executed (see COMMAND EXECUTION above), rbash turns off any restrictions in the shell spawned to execute the script

So to take advantage of this, one could create an alias prepending 'bash' to the bedtools scripts, like so,

alias intersectbed="bash /path/to/intersectbed.sh"

This should work; but please let me know if it doesn't!

ADD COMMENT
0
Entering edit mode

Alias doesn't break out of it, once the alias is entered, it is expanded and then denied.

ADD REPLY
0
Entering edit mode

If the OP is seeking to use his home folder as the installation path, then the assumption is that he should have all privileges to run executables within his home folder. So when the alias is expanded, his account should still have the proper privileges to execute the program.

ADD REPLY
0
Entering edit mode

Try it out (using bash -r), it doesn't work.

ADD REPLY
0
Entering edit mode

Thanks for pointing that out. I've revised by answer. Could you verify, just in case? Thanks!

ADD REPLY
0
Entering edit mode

If the admin isn't a complete noob that won't work either, because bash will be taken out of the path as well. In fact if such restrictions are in place there is most likely a reason for it an op shouldn't try to circumvent them.

ADD REPLY
0
Entering edit mode

The "-r" alone doesn't restrict that though, at least in my system. It's an old post so maybe the OP has had a chance to chat with his sys admin.

ADD REPLY

Login before adding your answer.

Traffic: 2471 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