skbio.alignment.global_pairwise_align_nucleotide

skbio.alignment.global_pairwise_align_nucleotide(seq1, seq2, gap_open_penalty=5, gap_extend_penalty=2, match_score=1, mismatch_score=-2, substitution_matrix=None, penalize_terminal_gaps=False)[source]

Globally align pair of nuc. seqs or alignments with Needleman-Wunsch

Parameters:

seq1 : str, BiologicalSequence, or Alignment

The first unaligned sequence(s).

seq2 : str, BiologicalSequence, or Alignment

The second unaligned sequence(s).

gap_open_penalty : int or float, optional

Penalty for opening a gap (this is substracted from previous best alignment score, so is typically positive).

gap_extend_penalty : int or float, optional

Penalty for extending a gap (this is substracted from previous best alignment score, so is typically positive).

match_score : int or float, optional

The score to add for a match between a pair of bases (this is added to the previous best alignment score, so is typically positive).

mismatch_score : int or float, optional

The score to add for a mismatch between a pair of bases (this is added to the previous best alignment score, so is typically negative).

substitution_matrix: 2D dict (or similar)

Lookup for substitution scores (these values are added to the previous best alignment score). If provided, this overrides match_score and mismatch_score.

penalize_terminal_gaps: bool, optional

If True, will continue to penalize gaps even after one sequence has been aligned through its end. This behavior is true Needleman-Wunsch alignment, but results in (biologically irrelevant) artifacts when the sequences being aligned are of different length. This is False by default, which is very likely to be the behavior you want in all or nearly all cases.

Returns:

skbio.Alignment

Alignment object containing the aligned sequences as well as details about the alignment.

Notes

Default match_score, mismatch_score, gap_open_penalty and gap_extend_penalty parameters are derived from the NCBI BLAST Server [R107].

This function can be use to align either a pair of sequences, a pair of alignments, or a sequence and an alignment.

References

[R107](1, 2) http://blast.ncbi.nlm.nih.gov/Blast.cgi