Last active
September 2, 2017 19:16
-
-
Save Vini2/8915ef70753e9c1c20892aca6daa6898 to your computer and use it in GitHub Desktop.
This file contains 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
# Import pairwise2 module | |
from Bio import pairwise2 | |
# Import format_alignment method | |
from Bio.pairwise2 import format_alignment | |
# Define two sequences to be aligned | |
X = "ACGGGT" | |
Y = "ACG" | |
# Get a list of the global alignments between the two sequences ACGGGT and ACG | |
# No parameters. Identical characters have score of 1, else 0. | |
# No gap penalties. | |
alignments = pairwise2.align.globalxx(X, Y) | |
# Use format_alignment method to format the alignments in the list | |
for a in alignments: | |
print(format_alignment(*a)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment