Biopython pairwise2 alignment: is one_alignment the best alignment?
Entering edit mode
3.9 years ago
Chip ▴ 130

I started using pairwise2.align function from Biopyton with the one_alignment set to True. I was wondering if that single alignment returned is the best one. With Smith-Waterman it should be but I'm not sure if that's what's been implemented.

Biopython alignment • 4.1k views
Entering edit mode
3.9 years ago
rayoub ▴ 110

There may be multiple pairwise alignments that have the same optimal score with respect to gap penalty and match scoring. The function just returns the first it finds during the traceback of the dynamic programming matrix rather than returning all of them.

From the following link, several paragraphs down, you will find this quote:

"Our variable alignments now contains a list of alignments (at least one) which have the same optimal score for the given conditions."

More concretely, you can check the source code. The function you are interested in is _recover_alignments, where the parameter one_alignment_only is put to use.


Login before adding your answer.

Traffic: 3042 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6