global_align: (Semi-) Global alignment with Needleman-Wunsch algorithm

View source: R/global_align.R

global_alignR Documentation

(Semi-) Global alignment with Needleman-Wunsch algorithm

Description

The frame of this function has been taken from the "needles"-function from CRANs NameNeedle package. Modifications were necessary to allow semi-global alignment and to implement additional arguments for performance optimization.

Usage

global_align(
  seq1,
  seq2,
  semi_global = T,
  score_matrix_centering = NULL,
  min_score_for_backtrace = NULL,
  match = 1,
  mismatch = -1,
  gap = -1
)

Arguments

seq1

character sequence 1 (string) to align with seq2

seq2

character sequence 2 (string) to align with seq1

semi_global

logical whether to perform a semi-global alignment which means that there is not penalty for terminal gaps

score_matrix_centering

NULL or numeric; only fill the diagonal center of the score matrix to increase computational speed; this is a heuristic and may omit to find the optimal alignment. score_matrix_centering = 10 means that for one residue in seq1 the scores for +/- 10 residues away from that position of seq2 are calculated. if NULL the whole matrix is caculated

min_score_for_backtrace

NULL or numeric; minimal score to initiate the backtracing; intended to increase performance if 1000s of alignments are to be computed and a minimal score per alignment is expected/wished for

match

numeric; score for match

mismatch

numeric; score for mismatch

gap

numeric; score for gap

Value

list of score, aligned sequences, score matrix and direction matrix


Close-your-eyes/igsc documentation built on Jan. 28, 2024, 10:28 p.m.