Title: | Striped Smith-Waterman Algorithm for Sequence Alignment using SIMD |
---|---|
Description: | Provides an R interface for 'SSW' (Striped Smith-Waterman) via its 'Python' binding 'ssw-py'. 'SSW' is a fast 'C' and 'C++' implementation of the Smith-Waterman algorithm for pairwise sequence alignment using Single-Instruction-Multiple-Data (SIMD) instructions. 'SSW' enhances the standard algorithm by efficiently returning alignment information and suboptimal alignment scores. The core 'SSW' library offers performance improvements for various bioinformatics tasks, including protein database searches, short-read alignments, primary and split-read mapping, structural variant detection, and read-overlap graph generation. These features make 'SSW' particularly useful for genomic applications. Zhao et al. (2013) <doi:10.1371/journal.pone.0082138> developed the original 'C' and 'C++' implementation. |
Authors: | Nan Xiao [aut, cre, cph] |
Maintainer: | Nan Xiao <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.2.1 |
Built: | 2024-11-16 06:06:32 UTC |
Source: | https://github.com/nanxstats/ssw-r |
Perform Smith-Waterman alignment of a read against a reference sequence
align( read, reference, gap_open = 3L, gap_extension = 1L, start_idx = 0L, end_idx = 0L, match_score = 2L, mismatch_penalty = 2L )
align( read, reference, gap_open = 3L, gap_extension = 1L, start_idx = 0L, end_idx = 0L, match_score = 2L, mismatch_penalty = 2L )
read |
A character string of the read. |
reference |
A character string of the reference. |
gap_open |
Penalty for opening a gap. Default is 3. |
gap_extension |
Penalty for extending a gap. Default is 1. |
start_idx |
Index to start the alignment search. Default is 0. |
end_idx |
Index to end the alignment search. The default value 0 means using the entire reference length. |
match_score |
An integer for scoring matches, ranging from 0 to 255. Default is 2. |
mismatch_penalty |
An integer for mismatch penalties, ranging from 0 to 255. Default is 2. |
A list of class ssw
containing the ssw aligner object
and the alignment results.
a <- align("ACGT", "TTTTACGTCCCCC") a a$alignment$optimal_score a$alignment$sub_optimal_score
a <- align("ACGT", "TTTTACGTCCCCC") a a$alignment$optimal_score a$alignment$sub_optimal_score
Perform forced alignment with increased gap open penalty
force_align( read, reference, force_overhang = FALSE, match_score = 2L, mismatch_penalty = 2L )
force_align( read, reference, force_overhang = FALSE, match_score = 2L, mismatch_penalty = 2L )
read |
A character string of the read. |
reference |
A character string of the reference. |
force_overhang |
Logical. If |
match_score |
An integer for scoring matches, ranging from 0 to 255. Default is 2. |
mismatch_penalty |
An integer for mismatch penalties, ranging from 0 to 255. Default is 2. |
A list of class ssw
containing the input sequences,
the ssw aligner object, and the alignment results.
# Results are truncated a <- force_align("ACTG", "TTTTCTGCCCCCACG") a # Format the results b <- a |> formatter() b # Print the formatted results directly a |> formatter(print = TRUE)
# Results are truncated a <- force_align("ACTG", "TTTTCTGCCCCCACG") a # Format the results b <- a |> formatter() b # Print the formatted results directly a |> formatter(print = TRUE)
Format and pretty-print SSW forced alignment results without truncation
formatter(x, print = FALSE)
formatter(x, print = FALSE)
x |
An object of class |
print |
Pretty-print the results? Default is |
The formatted forced alignment results.
a <- force_align("ACTG", "TTTTCTGCCCCCACG") b <- a |> formatter() b a |> formatter(print = TRUE)
a <- force_align("ACTG", "TTTTCTGCCCCCACG") b <- a |> formatter() b a |> formatter(print = TRUE)
Install ssw-py and its dependencies
install_ssw_py( ..., envname = "r-ssw-py", new_env = identical(envname, "r-ssw-py") )
install_ssw_py( ..., envname = "r-ssw-py", new_env = identical(envname, "r-ssw-py") )
... |
Other arguments passed to |
envname |
The name or full path of the environment in which
ssw-py is installed. Default is |
new_env |
Logical. If |
Invisibly returns NULL
. Primarily used for its side effect
of installing the Python package in the specified environment.
install_ssw_py()
install_ssw_py()
Is ssw-py installed?
is_installed_ssw_py()
is_installed_ssw_py()
TRUE
if installed, FALSE
if not.
is_installed_ssw_py()
is_installed_ssw_py()
Print SSW alignment results
## S3 method for class 'ssw' print(x, start_idx = 0L, ...)
## S3 method for class 'ssw' print(x, start_idx = 0L, ...)
x |
An object of class |
start_idx |
Index to start printing from. |
... |
Additional parameters for |
Invisibly returns the input object.
a <- align("ACGT", "TTTTACGTCCCCC") a
a <- align("ACGT", "TTTTACGTCCCCC") a
Global reference to ssw-py which will be initialized in .onLoad
.
ssw_py
ssw_py
An object of class python.builtin.module
(inherits from python.builtin.object
) of length 0.
ssw-py reference object