Last active
September 2, 2017 19:17
-
-
Save Vini2/aea8bf00210a567b18034d23021943e6 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
# 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 local alignments between the two sequences ACGGGT and ACG | |
# No parameters. Identical characters have score of 1, else 0. | |
# No gap penalties. | |
alignments = pairwise2.align.localxx(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