What exactly is Biopython's alignment.score variable?
0
1
Entering edit mode
3 months ago
Tom ▴ 50

Hello,

I can see from reading onto that Biopython's Align.PairwiseAligner.align.score() variable is:

'Calling the "score" method on the aligner with two sequences as arguments will calculate the alignment score between the two sequences'.

So I implemented that here:

matrix_names = substitution_matrices.load()                
global_aligner = Align.PairwiseAligner(mode='global',substitution_matrix=substitution_matrices.load('PAM30'))
alignment = global_aligner.align(sequence1,sequence2)
alignment_score = alignment.score
alignment_identity = alignment[0].counts().identities

I wanted to ask two things:

  1. Each pair of sequences can produce multiple alignments, with different scores. Is this score function definitely telling me the best possible score that any two alignments for these sequences can make, considering the supplied substitution matrix?

  2. Is there a more elegant way of counting the number of identical residues between the two sequences than the way I did it above in the 'alignment_identity' variable. I presumed that this number would be identical between all of the potential alignments for two sequences, hence why I called 'alignment[0]' and checked the identical sequences in that one, but maybe that is not correct.

Thanks.

Biopython • 170 views
ADD COMMENT

Login before adding your answer.

Traffic: 1807 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

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

Powered by the version 2.3.6