Last active
August 29, 2015 14:05
-
-
Save meren/f321fa2e6643dc436528 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
from cogent.align.algorithm import nw_align as nw_align_cogent | |
from skbio.alignment import global_pairwise_align_nucleotide as nw_align_scikit | |
seq_1 = 'ATCGATCGATCG' | |
seq_2 = 'ATCGATATCGATCG' | |
print "Sequences: " | |
print " %s" % seq_1 | |
print " %s" % seq_2 | |
alignment = nw_align_scikit(seq_1, seq_2) | |
al_1, al_2 = [alignment.get_seq(_id).__str__() for _id in alignment.ids()] | |
print " nw alignment using scikit:" | |
print " %s" % al_1 | |
print " %s" % al_2 | |
al_1, al_2 = nw_align_cogent(seq_1, seq_2) | |
print " nw alignment using cogent:" | |
print " %s" % al_1 | |
print " %s" % al_2 | |
# meren ~ $ python -W ignore test.py | |
# Sequences: | |
# ATCGATCGATCG | |
# ATCGATATCGATCG | |
# | |
# nw alignment using scikit: | |
# ------ATCGATCGATCG | |
# ATCGATATCGATCG---- | |
# | |
# nw alignment using cogent: | |
# ATCGAT--CGATCG | |
# ATCGATATCGATCG | |
# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment