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.
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.
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.
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.
Thanks - this also worked. Great tip!
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.
"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.
Good point, thanks. Question updated.