Thank you! :)
Dear all,
I have a problem with using tabix-0.2.6. Since I am going to use VCFtools, I need to install and use tabix-0.2.6 to compress and index vcf files. I download the latest version of tabix (tabix-0.2.6.tar.bz2.1) and decompress the software with command "tar xjvf" . Then I tried using the command bgzip my_file.vcf to compress my vcf file but ended up with an error tabix: command not found. I think I need to add some paths in order to achieve this but I don't know how. I am just a beginner in NGS data analysis, so this question may seem silly. Actually the "PATH" problem have been one of my big problem, I tried hard to search on line to find a solution. But until now I still did not get. However, please kindly help me out with this question. Your help will be greatly appreciated.
Best regards,
Chenglin
2 answers
I believe this link will be very informative to you: http://www.linfo.org/path_env_var.html
Best,
Cytosine
Yes, the link you provided is very informative. Thank you! There are two types of ways of setting up PATH (see below), I understand the first one, but don't understand the second one. Can you please tell me the difference between the two? Tanks!
PATH=$PATH:/path/to/a/toolPATH=/path/to/a/tool:$PATH
Thats two different ways of string concatenation.
The string in the $PATH variable can be placed either in front or in the back of the path to your program, it does not matter where. Both ways achieve the same thing.
HTH
Thank you very much! I have one more question. People put export in front of PATH=$PATH:/path/to/a/tool and some people don't , do they do the same thing?
It's a bit technical, but I don't think you'll notice the difference when using either of them.
If you really want to know the details: I'll quote the good folks from Unix & Linux Stack Exchange:
Exported variables get passed on to child processes, not-exported variables do not.
Thank you! I read it.
Best regards,
Chenglin Chai Ph.D., School of Plant, Environmental, and Soil Sciences Louisiana State University Agricultural Center 207C M.B. Sturgis Hall Baton Rouge, LA 70803, USA Tel: (225) 578-9703
For future visitors, please be aware that "they achieve the same thing" is not accurate, strictly speaking. The shell scans all locations in the path variable when a command is typed. It uses the first matching executable that it encounters. By putting one's location before the existing $PATH, the newly added location is given more priority. By adding it to the end, we are essentially asking the shell to only look there if no other PATH locations has a matching executable.
It may not matter for uniquely named executables, but if one wishes for a custom executable to override a built-in, that is done by prepending the custom location to $PATH.
This is how I set up my bioinformatics tools, this may not be the best choice for this stuff, but it works for me (apologies if you understand this sort of basic stuff already):
I put all my downloaded bioinformatics tools () in a directory ~/Tools/ and expand all the zips etc within there. I put a subfolder ~/Toos/bin/ in there where I put links to the binaries
For example, I have
ls -l ~/Tools
....
drwxrwxr-x. 3 russell russell 4096 Nov 11 12:55 bin
....
drwxr-x---. 4 russell russell 4096 Sep 15 11:07 tabix-0.2.6
-rw-rw-r--. 1 russell russell 54403 Jun 18 2012 tabix-0.2.6.tar.bz2
......
and
ls -l ~/Tools/bin
....
lrwxrwxrwx. 1 russell russell 37 Sep 15 11:06 bgzip -> /home/russell/Tools/tabix-0.2.6/bgzip
....
lrwxrwxrwx. 1 russell russell 37 Sep 15 11:03 tabix -> /home/russell/Tools/tabix-0.2.6/tabix
....
Those links were created using
ln -s ${HOME}/Tools/tabix-0.2.6/bgzip ${HOME}/Tools/bin/bgzip
ln -s ${HOME}/Tools/tabix-0.2.6/tabix ${HOME}/Tools/bin/tabix
I've added ~/Tools/bin to my PATH so that I can call any binary that is linked to from that folder, so within my ~/.bash_profile script I have the line
PATH=${PATH}:/home/russell/Tools/bin
Hope that helps
Please no apologies. I am just a beginner and I appreciate your time.Thank you very much, russ_hyde. I will try and let you if it works.
Log in to answer this question.
Have you export the tabix folder path to your PATH? If not, add the following line to your
.bashrcfile, save your.bashrcfile, and type source on the UNIX command line:I updated your post to mention the directory with tabix, which is probably what you meant :)
Yes you're right, thanks ;)
Thank you very much, I will try.
Hi airan,
I added the line to the .bashrc file and saved it. What do you by "type the source"? Sorry, this question may be silly :)
No worries. I had same question time ago. Type this:
It is executed in order to reload your changed bash setting (bashrc file).