Last active
June 28, 2022 15:21
-
-
Save elowy01/79f13cade08bfc0bb7d4794649ad07af to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# global alignment between 2 sequences | |
from Bio import pairwise2 | |
alignments = pairwise2.align.globalxx("ACCGT", "ACG") # returns a list of alignments | |
# you can format the alignments | |
from Bio.pairwise2 import format_alignment | |
print(format_alignment(*alignments[0])) | |
ACCGT | |
| || | |
A-CG- | |
Score=3 | |
# Local alignment | |
for a in pairwise2.align.localxx("ACCGT", "ACG"): | |
print(format_alignment(*a)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment