Question: Problem with using tabix
0
gravatar for Chenglin
5.0 years ago by
Chenglin110
United States
Chenglin110 wrote:

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 • 6.5k views
ADD COMMENTlink modified 5.0 years ago by russhh4.8k • written 5.0 years ago by Chenglin110
1

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 REPLYlink modified 5.0 years ago by Devon Ryan92k • written 5.0 years ago by iraun3.6k

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

ADD REPLYlink written 5.0 years ago by Devon Ryan92k

Yes you're right, thanks ;)

ADD REPLYlink written 5.0 years ago by iraun3.6k

Thank you very much, I will try.

ADD REPLYlink written 5.0 years ago by Chenglin110

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 REPLYlink written 5.0 years ago by Chenglin110

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 REPLYlink modified 5.0 years ago • written 5.0 years ago by iraun3.6k
2
gravatar for Cytosine
5.0 years ago by
Cytosine450
Ljubljana, Slovenia
Cytosine450 wrote:

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

 

Best,

Cytosine

ADD COMMENTlink written 5.0 years ago by Cytosine450

Thank you! :)

ADD REPLYlink written 5.0 years ago by Chenglin110

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 REPLYlink modified 5 weeks ago by RamRS24k • written 5.0 years ago by Chenglin110

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 REPLYlink written 5.0 years ago by Cytosine450

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 REPLYlink written 5.0 years ago by Chenglin110

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 REPLYlink modified 5 weeks ago by RamRS24k • written 5.0 years ago by Cytosine450

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 REPLYlink written 5.0 years ago by Chenglin110

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 REPLYlink modified 5 weeks ago • written 5 weeks ago by RamRS24k
1
gravatar for russhh
5.0 years ago by
russhh4.8k
UK, U. Glasgow
russhh4.8k wrote:

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 downlaoded 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 COMMENTlink modified 5.0 years ago • written 5.0 years ago by russhh4.8k

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 REPLYlink written 5.0 years ago by Chenglin110
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1265 users visited in the last hour