This is a test version of Biostars. For the public version, visit https://www.biostars.org.
[Biopython] endweight, endopen and endextend equivalent for Bio.Align.PairwiseAligner()

I'm playing around with different aligners in Biopython. I initially used NeedleCommandline from Bio.Emboss.Application to align two sequences (JX205496.1, JX469991.1). Using the following settings, my optimal alignment score becomes 257 (which is my sought score):

NeedleCommandline(asequence="aseq.faa", bsequence="bseq.faa", gapopen=10, gapextend=1, \
                  endweight = True, endopen = 10, endextend = 1, outfile = "needle.txt")

I'd like to replicate this result using PairwiseAligner() from Bio.Align. Setting up my aligner as below I get an optimal alignment score of 534:

aligner = Bio.Align.PairwiseAligner()
aligner.mode = 'global'
aligner.open_gap_score = -10
aligner.extend_gap_score = -1

I get the same score with NeedleCommandline if I exclude endweight = True, endopen = 10, endextend = 1. I've tried adjusting the aligner.query/target_end_gap/extend_score settings, but I'm unable to replicate the result from NeedleCommandline.

Any ideas what I'm doing wrong, or what Bio.Align.PairwiseAligner() settings that are equivalent to the ones I used with NeedleCommandline?

alignment needle biopython

2 answers

Have you tried adding:

aligner.end_open_gap_score = -10
aligner.end_extend_gap_score = -1

Yes I have, but that doesn't change the result. It looks like setting aligner.open_gap_score = -10 and aligner.extend_gap_score = -1 also sets the end_open and end_extend scores by default.

Log in to answer this question.