This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Blast Result Matching Both Of Two Query Sequences?

If two short sequences (A and B) come from the same gene, but I don't know the name of the gene or the organism, can I perform a BLAST (or similar) search to find the gene which has best similarity with BOTH A and B? That is, only return results where A and B align to the same full length sequence.

I realise I can do a BLAST/BLAT search for each and look for the matching entries, but I wondered if there was an automated way already in existence.

blast alignment nucleotide sequence

"which has best homology with BOTH A and B" is wrong, should be "best similarity" ! Homology is qualitative, yes or no, cannot be higher or lower.

3 answers

One thing you can try is to concatenate A and B together and insert a '-' character between them. '-' will be considered as a gap of indeterminate length to blast.

You will have to try blasting A + '-' + B and also B + '-' + A.

Inferring that your sequences are DNA, I would suggest that you also run anti-sense A + - + B and A + - + anti-B, because you may not know the orientation of these 2 queries. In general, concatenation is a neat trick in BLAST.

Thanks - this worked. @Larry_Parnell good point about including anti-sense.

Try Blasting for a dummy sequence containing SeqA, a string of N, then SeqB. IE, SeqANNNNNNNSeqB or SeqBNNNNNNNNSeqA. The Blast program will automatically extend the string of Ns to any arbitrary length, so you'll get results who have matches to both your sequences anywhere in the gene.

Another possibility was to make a blastdb from the query A blast result, and then run blast on the new blastdb with the query B.

Log in to answer this question.