Can you provide some more details. (1) By "local blast algorithm", you mean a local installation of BLAST, not something that you have written yourself? (2) It's unclear where Biopython is used: are you calling BLAST from the Biopython wrapper? (3) Are you also using Biopython to parse the BLAST output?
Thanks for the details. I've not used Biopython for this, but I'm sure others will have some ideas. In the meantime I'd suggest first to run standalone BLAST and see if it gives the same alignment. If it does, you may need to experiment with the parameters, such as gap open/extend penalty, see http://www.plexdb.org/modules/documentation/NCBIblastall.htm. If you're aligning short sequences (guessing you might be, since you use PAM30), BLAST may not be the best tool.
Following up on Neil's comments, it sounds like you are looking for a global alignment algorithm. BLAST does local alignments with plenty of heuristics and is a good tool for searching, but you'll likely want a dedicated aligner to assess an alignment at the level you are looking to do. If you have two sequences, Needle or Stretcher from EMBOSS would be useful:
If you are doing multiple alignments, check out MAFFT or PROBCONS.
You can leverage Biopython and Python for running and parsing the output of these. Biopython has commandline wrappers for Needle, MAFFT and PROBCONS in Bio.Emboss.Applications and Bio.Align.Applications; this is a good place to get started.
Right - I wasn't sure in the original question if the example sequences were full-length. If so, you should certainly be using the tools Brad describes, not BLAST.
Can you provide some more details. (1) By "local blast algorithm", you mean a local installation of BLAST, not something that you have written yourself? (2) It's unclear where Biopython is used: are you calling BLAST from the Biopython wrapper? (3) Are you also using Biopython to parse the BLAST output?
Yes sorry:
I am indeed using Biopython wrapper with a cline that looks like this:
To parse the output file I use
Thanks for the details. I've not used Biopython for this, but I'm sure others will have some ideas. In the meantime I'd suggest first to run standalone BLAST and see if it gives the same alignment. If it does, you may need to experiment with the parameters, such as gap open/extend penalty, see http://www.plexdb.org/modules/documentation/NCBIblastall.htm. If you're aligning short sequences (guessing you might be, since you use PAM30), BLAST may not be the best tool.