skbio.alignment.pair_align_nucl#

skbio.alignment.pair_align_nucl(seq1, seq2, /, **kwargs)[source]#

Align two nucleotide sequences.

This is a convenience wrapper of pair_align for nucleotide sequence alignment. It is preloaded with a scoring scheme consistent with BLASTN’s defaults [1]: match score = 2, mismatch score = -3, gap opening penalty = 5, gap extension penalty = 2. All parameters remain customizable. Refer to pair_align for full documentation.

References

Examples

>>> from skbio.sequence import DNA
>>> from skbio.alignment import pair_align_nucl
>>> seq1 = DNA('GATCGTC')
>>> seq2 = DNA('ATCGCTC')
>>> res = pair_align_nucl(seq1, seq2)
>>> res.score
5.0
>>> res.paths[0]
<PairAlignPath, positions: 8, segments: 4, CIGAR: '1D4M1I2M'>
>>> res.paths[0].to_aligned((seq1, seq2))
['GATCG-TC', '-ATCGCTC']