Skip to contents

Align a read to the reference with optional index offsetting

Usage

align(
  read = NULL,
  reference = NULL,
  gap_open = 3L,
  gap_extension = 1L,
  start_idx = 0L,
  end_idx = 0L,
  match_score = 2L,
  mismatch_penalty = 2L
)

Arguments

read

The read, character string

reference

The reference, character string

gap_open

Penalty for gap_open

gap_extension

Penalty for gap_extension

start_idx

Index to start search

end_idx

Index to end search (trying to avoid a target region). The default value 0 means using the whole reference length.

match_score

For scoring matches, integer

mismatch_penalty

For scoring mismatches, integer

Value

A list containing the ssw aligner object and the alignment results.

Examples

a <- align("ACGT", "TTTTACGTCCCCC")
a
a$alignment$optimal_score
#> [1] 8
a$alignment$sub_optimal_score
#> [1] 0