It would be fairly trivial to work that out from the sequence representations of the alignments, something like the zip approach I used here comes to mind: A: How to display mismatched sequences from alignment when using Biopython
To be honest, I've never actually used the PairwiseAligner() class. I've always used pairwise2 and parsed the outputs. If I'm doing any serious alignment task, I probably wouldn't reach to do it in python anyway, since the speed would not scale brilliantly with large datasets which is not uncommon if you're trying to do things like all-vs-all pairwise alignments. I'd just find a commandline tool for it.
To the best of my assessment, this may just be some deprecated functionality that has been missed in the docs.
Could you post what python and biopython versions you're using, and I'll try to draw this thread to the attention of the biopython devs.
Not deprecated(?):
From the cookbook (16 July 2019) applied on your code:
https://biopython.org/DIST/docs/tutorial/Tutorial.html
That doesn't appear to address the issue of the
.alignedattribute being missing?I can emulate the problem on Biopython 1.73, and the online cookbook does indeed seem to suggest this functionality still exists, in section 6.5.2.7 Alignment object:
https://biopython.org/DIST/docs/tutorial/Tutorial.html#htoc88
Update:
Biopython devs on twitter asked for it to be placed as a github issue. You can follow its progress here: https://github.com/biopython/biopython/issues/2294
EDIT, resolved and closed.