Problem with using tabix
2
0
Entering edit mode
10.0 years ago
Chenglin ▴ 260

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

SNP software-error • 17k views
ADD COMMENT
1
Entering edit mode

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
0
Entering edit mode

I updated your post to mention the directory with tabix, which is probably what you meant :)

ADD REPLY
0
Entering edit mode

Yes you're right, thanks ;)

ADD REPLY
0
Entering edit mode

Thank you very much, I will try.

ADD REPLY
0
Entering edit mode

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 :)

ADD REPLY
0
Entering edit mode

No worries. I had same question time ago. Type this:

source ~/.bashrc

It is executed in order to reload your changed bash setting (bashrc file).

ADD REPLY
2
Entering edit mode
10.0 years ago
Cytosine ▴ 460

I believe this link will be very informative to you: http://www.linfo.org/path_env_var.html

Best,
Cytosine

ADD COMMENT
0
Entering edit mode

Thank you! :)

ADD REPLY
0
Entering edit mode

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!

  1. PATH=$PATH:/path/to/a/tool
  2. PATH=/path/to/a/tool:$PATH
ADD REPLY
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.

HTH

ADD REPLY
0
Entering edit mode

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
0
Entering edit mode

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.

ADD REPLY
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

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
1
Entering edit mode
10.0 years ago
russhh 5.7k

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

ADD COMMENT
0
Entering edit mode

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.

ADD REPLY

Login before adding your answer.

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