0

I am using samtools faidx to extract the sequences matching the ranges given by a BLAST output file (format is tabular -outfmt 6). Unfortunately, there are BLAST matches forward and reverse. The forward ranges are processed without problems by samtools faidx. The reverse ranges are causing samtools to give and error message.

The syntax is:

samtools faidx  file.faa  "$scaffold":"$start"-"$end"

And in the case of a reverse match ("$start" > "$end"), the error message is:

>$Scaffold:$start-$end/rc
[faidx] Zero length sequence: $Scaffold:$start-$end

Would anyone know if samtools can process the reverse inputs, with a specific flag? I have not found a script yep for this situation that should be quite common in biological science!

1 Answers1

0

I have not seen any specific "tag" in samtools which cloud process the reverse inputs.

Try:

samtools faidx file.faa "$scaffold": "$end"-"$start"

It's still the region you want. If you want the extracted sequence in a reverse (and complement) direction, try some online tools.

Also, here's explanation about BLAST output reversed

Forrest Vigor
  • 157
  • 1
  • 6