Experiments in response to SO question.
In [1]:
from skbio.alignment import global_pairwise_align_nucleotide
seq_1 = 'ATCGATCGATCG'
seq_2 = 'ATCGATATCGATCG'
print "Sequences: "
print " %s" % seq_1
print " %s" % seq_2
In [2]:
alignment = global_pairwise_align_nucleotide(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
print
In [3]:
alignment = global_pairwise_align_nucleotide(seq_1, seq_2, penalize_terminal_gaps=True)
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
print
In [ ]: