sambamba markdup command not working
1
0
Entering edit mode
4.2 years ago
mirza ▴ 130

Hi, I downloaded the pre-compiled binary for sambamba (sambamba_v0.6.6_linux.tar.bz2) from https://github.com/lomereiter/sambamba/releases and untarred it. "view" command is working but when I try "markdup," it says "comand not found." can anyone help here?

sambamba markdup • 2.1k views
0
Entering edit mode

0
Entering edit mode

Sorry for late reply, our server was down for a whole week. Here is the command and the error, (I used the example file provided in sambamba i.e. issue225.bam) When I use

$markdup issue225.bam -o 225_markdup.bam it gives the following error, markdup: command not found ADD REPLY 0 Entering edit mode looks like a PATH problem. Which directory did you install sambamba. Are you able to run view command from the same directory where the markdup failed? ADD REPLY 0 Entering edit mode I have sambamba in bin dir in Home from where I run all other tools. I am able to run sort but not markdup ~/bin/sambamba-0.6.6$ sort -n issue225.bam -o issue225.sorted.bam

0
Entering edit mode

The manual says that you have to run commands like

$sambamba view$ sambamba markdup

http://lomereiter.github.io/sambamba/docs/sambamba-markdup.html

0
Entering edit mode

yeah, if I run these commands from some other directory or home, but when I am running the command within my sambamba dir, I don't need $sambamba view$ view should work.

and the bin directory is already in path.

0
Entering edit mode

Just for a check: did you try running sambamba markup instead of just markdup? It might run for some commands, but not for others (it all depends how the main binary sambamba is calling other sub progs)

0
Entering edit mode

yes, I did. I was first using sambamba with the commands but it didn't work. Then I removed it and run sort without it, it's running. I also tried building the tool from the source code according to the instructions given and again, I am facing the same issue. "sort" is working but with "markdp" same error. I must admit I am new to this tool. I am learning to use the view command.

0
Entering edit mode

I think there was some problem in your build and it was somehow incomplete. However, I am able to run the precompiled binary from https://github.com/lomereiter/sambamba/releases (linux version). it gives only one command (sambamba_v0.6.6), as I was expecting, and you can run it like what I said in earlier comment.

0
Entering edit mode

I too downloaded the precompiled binaries sambamba_v0.6.6_linux.tar.bz2 from the above link and untarred it in my bin directory. Now I have a sambamba-0.6.6 directory in my bin. Do, I need to add the directory to the PATH? and what command should I use to do that? (I have been using vim to add to the .bashrc in my Ubuntu16.04).

0
Entering edit mode

yes, you need to add that directory to PATH (using VIM or any other editor) in .bashrc and also in .bash_profile

Open a new terminal and check that the PATH is properly set echo $PATH Here you should see the path just added. And also then you should be able to run the command from anywhere. ADD REPLY 0 Entering edit mode Hi, I added it to the PATH, My path /home/gjjha/bin:/home/gjjha/bin:/home/gjjha/bin:/home/gjjha/bin:/home/gjjha/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/home/gjjha/bin:/home/gjjha/ncbi-blast-2.6.0+/bin:/home/gjjha/bin/blastdb:/home/gjjha/bin/sambamba-0.6.6/sambamba Now, when I try to run any command, it say sambamba: command not found ADD REPLY 1 Entering edit mode Here is the correct way to add path: Suppose your binary program is called sambamba_v0.6.6 and it resides in /tmp/bin directory, then set the PATH like this: PATH=$PATH:/tmp/bin


Note that you give the complete path to the directory, not to the executable or binary.

Note 2: You may also like to add the Current Working Directory (CWD) in PATH. It will allow you to run any command which is in the current directory by just typing the name of the command (else you'll need to give full path)

PATH=$PATH:/tmp/bin:.  the . in the PATH above is CWD. ADD REPLY 0 Entering edit mode Santosh, I am a novice in linux and NGS analysis so, thanks for explaining, however, I didn't completely understand Note 2. Can you give an example. More importantly, my sambamba binaries are here, /home/gjjha/bin/sambamba-0.6.6 and as I told you earlier, this bin directory is already in the PATH. So, what do I need to do now? should I remove /home/gjjha/bin/sambamba-0.6.6/sambamba from the path? But, then that was the situation earlier and I used to get the same error that sambamba: command not found. ADD REPLY 0 Entering edit mode should I remove /home/gjjha/bin/sambamba-0.6.6/sambamba in path, there should be only /home/gjjha/bin/sambamba-0.6.6 Only the name of the directory where your binaries are. After setting the PATH, you should start a new terminal to make it effective. ADD REPLY 0 Entering edit mode ok, thanks. Will do and let you know. ADD REPLY 0 Entering edit mode Still the same errors, I don't understand wats the problem :( I edited the PATH. Now, the path contains :/home/gjjha/bin/sambamba-0.6.6 but, again sambamba:command not found. And when I try to execute the commands from the sambamba-0.6.6 directory, sort is working ~/bin/sambamba-0.6.6$ sort -n issue225.bam -o nsorted_issue225.bam

but not markdup,

gjjha@gjj-107:~/bin/sambamba-0.6.6$markdup -r issue225.bam -o duprem_issue225.bam markdup: command not found ADD REPLY 0 Entering edit mode I have used the following command for editing my path in vim .bashrc PATH=${PATH/":/home/gjjha/bin/sambamba-0.6.6/sambamba"/":/home/gjjha/bin/sambamba-0.6.6"}

${variable/find/replacement} command ADD REPLY 0 Entering edit mode Just to say @mirza if your are finding the comments and answers helpful from any of the users please upvote or accept them as answers. Everyone of them deserves those credits when they are helping you out and you indeed get your problems resolved. ADD REPLY 0 Entering edit mode Thanks Vivek :-) PS: This line is just to keep Biostars character count Nazi away ADD REPLY 3 Entering edit mode 4.2 years ago I'll describe the whole process better here: 1. Dload sambamba precompiled binary from here https://github.com/lomereiter/sambamba/releases 2. unzip and untar it$ tar -axvf sambamba_v0.6.6_linux.tar.bz2

3. Check if the commands run properly. Remember that the main program is sambamba_v0.6.6. So run it like this

$sambamba_v0.6.6 markdup$ sambamba_v0.6.6 sort

4. If everything runs fine, now you can add the binary sambamba_v0.6.6 to path as described earlier.

0
Entering edit mode

Santosh, plz don't mind me asking, is it

$tar -axvf or$ tar xvjf file.tar.gz

coz' as far as I have searched, I always find the later command to unzip a .bz2 file (& have used it to untar my sambamba file earlier). I am using Ubuntu16.04.

1
Entering edit mode

tar can also handle zipped files directly. Here the -a (automatic) flag in tar is to guess the zipping format (which is bzip2 here). Otherwise you need to write two commands

$bunzip2 file.tar.gz$ tar xvf file.tar


The beauty of -a flag is that it handles most of the zipping formats (gzip, bzip, zip etc.) without you need to figure out how to unzip first and then untar.

0
Entering edit mode

-a option for tar may only be there for newer versions

0
Entering edit mode

since 2008-04-14 ;-)

https://www.gnu.org/software/tar/

0
Entering edit mode

Thank you very much Santosh. It's working now :) I had used,

\$ tar xvjf file.tar.gz

which untarred the file as a simple directory (with multiple sub-directories) and not in the executable format, hence all the trouble. Also, need to use "sambamba_v0.6.6" instead of just "sambamba" in the commands as you have stated above. I am really grateful for your continuous help.

0
Entering edit mode

My pleasure. Happy that it helped!