Where is the index command?
1
0
Entering edit mode
12 weeks ago
luque007 • 0

I unpacked Samtools in Ubuntu using apt install make.

The directory is listed below and includes folders and files.

There is no index function.

I have bam file and am trying to make bai file, not sure what to do next?

enter image description here

samtools • 861 views
ADD COMMENT
0
Entering edit mode

samtools index ran but returned

samtools index: failed to create or write index

I will look for solution to that

Progress made!!!

ADD REPLY
0
Entering edit mode

That's a tarball of the C source code you've just unpacked.

There's an "INSTALL" file with detailed instructions of how to compile the software, listing all the prerequisites needed.

If you don't want to compile it from source, just use the Ubuntu prebuilt package.

ADD REPLY
0
Entering edit mode
12 weeks ago
Michael 54k

There is a ready-made package for samtools, simply do

apt install samtools

Also, your screenshot shows you are using the root account. You should not do that, especially if you are not very sure about the commands you are issuing or are copy-pasting commands from the internet into your console. After you installed the package, the samtools index command will be available for a normal user on the machine.

ADD COMMENT
0
Entering edit mode

Thanks for comment on root. This is ubuntu running in windows and I had not yet set a user account (and added to sudoers) The error I get is "Unable to locate samtools package" After unpacking samtools-1.18.tar.bz2 I did not see a samtools package. Maybe I am starting in the wrong place? Where can I find that package?

ADD REPLY
0
Entering edit mode

I didn't know you were using WSL. Possibly the damage you can do with that is limited to the WSL environment and the worst thing that can happen is that you need to re-install Ubuntu. Still, it is a good idea not to work as root to get good habits. Also, I am trying not to include the sudo part in the commands I give as examples, because users should make the decision themselves as to which privileges a command requires and whether to add the sudo or not.

See https://security.stackexchange.com/questions/113627/what-is-the-risk-of-copy-and-pasting-linux-commands-from-a-website-how-can-some and an example: https://thejh.net/misc/website-terminal-copy-paste

ADD REPLY
0
Entering edit mode

ran sudo apt update (never used this windows ubuntu before)

Holy Hell 111 updateable

Ran sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade

Wallah!

apt install samtools worked !!!!

Yippie!!!!

ADD REPLY
0
Entering edit mode

Running this is always a good idea.

ADD REPLY
0
Entering edit mode

ran the index with sudo and it worked !!!

ADD REPLY
1
Entering edit mode

samtools index (like genral programs you install on your machine) should run without sudo, if it doesn't, you might want to check the access privileges.

ADD REPLY
0
Entering edit mode

Please accept @Michael's answer (green check mark) to provide closure to this thread.

ADD REPLY

Login before adding your answer.

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