Created
June 5, 2018 03:26
-
-
Save Ad115/d07c318a2f988845c57dcf98a02aa2e9 to your computer and use it in GitHub Desktop.
Introduction to BioPython's Seq objects.
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
from Bio.Seq import Seq | |
# Create sequence object | |
my_sequence = Seq("AGTACACTGGT") | |
# Show the sequence object | |
print("Sequence:", my_sequence) | |
# The sequence was created with a generic alphabet. | |
# The alphabet tells us whether it is a DNA, RNA or | |
# protein sequence and whether it is ambiguous or not. | |
print("Alphabet:", my_sequence.alphabet) | |
# We can easily get the complement | |
complement = my_sequence.complement() | |
print("Complement:", complement) | |
# Same with the reverse complement | |
rev_complement = my_sequence.reverse_complement() | |
print("Reverse complement:", rev_complement) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment