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.
Have you export the tabix folder path to your PATH? If not, add the following line to your .bashrc file, save your .bashrc file, and type source on the UNIX command line:
export PATH=$PATH:/path_to_directory_with_tabix
ADD REPLY
• link
updated 2.8 years ago by
Ram
44k
•
written 10.1 years ago by
iraun
6.2k
0
Entering edit mode
I updated your post to mention the directory with tabix, which is probably what you meant :)
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/tool
PATH=/path/to/a/tool:$PATH
ADD REPLY
• link
updated 5.1 years ago by
Ram
44k
•
written 10.0 years ago by
Chenglin
▴
260
0
Entering edit mode
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.
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?
ADD REPLY
• link
updated 2.8 years ago by
Ram
44k
•
written 10.0 years ago by
Chenglin
▴
260
0
Entering edit mode
It's a bit technical, but I don't think you'll notice the difference when using either of them.
Exported variables get passed on to child processes, not-exported variables do not.
ADD REPLY
• link
updated 5.1 years ago by
Ram
44k
•
written 10.0 years ago by
Cytosine
▴
460
0
Entering edit mode
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
....
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
Have you export the tabix folder path to your PATH? If not, add the following line to your
.bashrc
file, save your.bashrc
file, 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).