Extract sequence from multifasta file using samtools
2
1
Entering edit mode
8.8 years ago

Hej there :)

I tried to extract some sequences from a multifasta file using a text file with desired sequence ids. I tried this using the following command:

 xargs samtools faidx all_my_sequences.fa < wanted_seq_ids.txt > wanted_seq_only.fa

This is a command I saw here : BIOSTAR Question: How To Extract A Sequence From A Big (6Gb) Multifasta File ?

It works fine for everyone, but my trial resulted in following error message:

xargs: samtools: No such file or directory

What is going on? Googled it with zero results. I installed samtools and used it before, also with faidx. Also I can use the command xargs.

Thanks for your help!

sequence software error • 6.1k views
ADD COMMENT
1
Entering edit mode
8.8 years ago
GenoMax 148k

If samtools is not available in $PATH then provide full path to samtools executable in your command.

ADD COMMENT
0
Entering edit mode

which samtools for the full path

ADD REPLY
0
Entering edit mode
6.6 years ago
roblogan6 ▴ 50

You need to navigate to the samtools folder. Confirm by typing "pwd" in the terminal, meaning "print working directory". It would indicate that you are in the samtools directory. Once there you can run your command by simply removing the "samtools". IE xargs faidx all_my_sequences.fa < wanted_seq_ids.txt > wanted_seq_only.fa I had the same problem using faidx and this solved it for me. Good luck.

ADD COMMENT

Login before adding your answer.

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