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?
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
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?
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
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)
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.
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.
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).
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)
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.
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.
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.
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.
please post your commandlines and also the outputs / erros
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
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?
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
The manual says that you have to run commands like
$ sambamba view
$ sambamba markdup
http://lomereiter.github.io/sambamba/docs/sambamba-markdup.html
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.
Just for a check: did you try running
sambamba markup
instead of justmarkdup
? It might run for some commands, but not for others (it all depends how the main binary sambamba is calling other sub progs)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.
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.
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).
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.
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
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: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)
the
.
in the PATH above is CWD.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.
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.
ok, thanks. Will do and let you know.
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
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
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.
Thanks Vivek :-)
PS: This line is just to keep Biostars character count Nazi away