Many thanks for your help.
Unfortunately I still can't get it to work,
When indexing the fasta file, I get the following error:
zsh: segmentation fault samtools faidx motif_search.txt
And when indexing the query each region, I get a number of lines of:
[fai_load] build FASTA index.
Does the fasta file have to be in fasta format - currently it has no word wrap (i.e. the sequence ID is on one line and the Sequence on the next; I suppose I could write a script to convert it to fasta format if necessary...
Or does the problem lie somewhere else altogether.
Many Thanks once again - I'm a total beginner in bioinformatics and really appreciate this help.
EDIT:
I have now reinstalled samtools. When typing samtools into the terminal, it gives me that half a page of text, telling me of the version installed and the commands that I can use... Nevertheless, when trying to index the files I still get the same errors
This works for me with the sample files in your question, with both samtools 0.1.19 and the current development version. Does it work for you with these sample files? If so, you may need to post the actual problematic files you're using, or extent these samples until they too fail.
Thank You,
I have now got the samtools to work - the problem was that there was a space between the > and the sequence ID. in both files. So, I just changes the script that is used to make the motif_seach.txt to remove the space and it now works.
Many thanks for all your help