which samtools for the full path
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!
2 answers
If samtools is not available in $PATH then provide full path to samtools executable in your command.
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.
Log in to answer this question.