Striped Smith-Waterman Algorithm for Sequence Alignment using SIMD

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) developed the original 'C' and 'C++' implementation.


ssw-r

R-CMD-check CRAN status

ssw-r offers an R interface for SSW, a fast implementation of the Smith-Waterman algorithm for sequence alignment using SIMD. ssw-r is currently built on the Python package ssw-py.

Installation

You can install ssw-r from CRAN once available:

install.packages("ssw")

Or try the development version on GitHub:

remotes::install_github("nanxstats/ssw-r")

Install ssw-py

A simple way to install the Python package ssw-py that ssw-r can discover easily, is to run the helper function ssw::install_ssw_py(). By default, it installs ssw-py into an virtual environment named r-ssw-py.

ssw::install_ssw_py()

This follows the best practices suggested by the reticulate vignette Managing an R Package's Python Dependencies. There are also recommendations in the vignette on how to manage multiple R packages with different Python dependencies.

Usage

library("ssw")
"ACGT" |> align("TTTTACGTCCCCC")
CIGAR start index 4: 4M
optimal_score: 8
sub-optimal_score: 0
target_begin: 4	target_end: 7
query_begin: 0
query_end: 3

Target:        4    ACGT    7
                    ||||
Query:         0    ACGT    3
"ACGT" |> align("TTTTACTCCCCC", gap_open = 3)
CIGAR start index 4: 2M
optimal_score: 4
sub-optimal_score: 0
target_begin: 4	target_end: 5
query_begin: 0
query_end: 1

Target:        4    AC    5
                    ||
Query:         0    AC    1
"ACTG" |> force_align("TTTTCTGCCCCCACG") |> formatter(print = TRUE)
TTTTCTGCCCCCACG
   ACTG

For detailed usage, see the vignette.

Acknowledgements

ssw-r is built upon the work of two outstanding projects:

  1. SSW - Original C implementation. Author: Mengyao Zhao
  2. ssw-py - Python binding for SSW. Author: Nick Conway

We extend our sincere gratitude to Mengyao Zhao for developing the original SSW library and to Nick Conway for maintaining the ssw-py package. Their work forms the foundation of ssw-r. While ssw-r does not directly incorporate code from these projects, it serves as an R interface to their functionality. We encourage users to visit the original repositories for more information about the underlying implementation and to consider citing these works in publications that use ssw-r.

Code of Conduct

Please note that the ssw-r project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("ssw")

0.2.1 by Nan Xiao, 2 years ago


https://nanx.me/ssw-r/, https://github.com/nanxstats/ssw-r


Report a bug at https://github.com/nanxstats/ssw-r/issues


Browse source code at https://github.com/cran/ssw


Authors: Nan Xiao [aut, cre, cph]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports reticulate

Suggests knitr, rmarkdown

System requirements: Python (>= 3.6.0), ssw-py (>= 1.0.0). Detailed installation instructions can be found in the README file.


See at CRAN