[](https://travis-ci.org/rvaser/spoa)
[](https://doi.org/10.1101/gr.214270.116)
Spoa (SIMD POA) is a c++ implementation of the partial order alignment (POA) algorithm (as described in 10.1093/bioinformatics/18.3.452) which is used to generate consensus sequences (as described in 10.1093/bioinformatics/btg109). It supports three alignment modes: local (Smith-Waterman), global (Needleman-Wunsch) and semi-global alignment (overlap). It supports Intel SSE4.1+ and AVX2 vectorization (marginally faster due to high latency shifts).
Spoa (SIMD POA) is a c++ implementation of the partial order alignment (POA) algorithm (as described in 10.1093/bioinformatics/18.3.452) which is used to generate consensus sequences (as described in 10.1093/bioinformatics/btg109). It supports three alignment modes: local (Smith-Waterman), global (Needleman-Wunsch) and semi-global alignment (overlap), and three gap modes: linear, affine and convex (piecewise affine). It supports Intel SSE4.1+ and AVX2 vectorization (marginally faster due to high latency shifts).
## Dependencies
@@ -45,6 +45,7 @@ To build unit tests add `-Dspoa_build_tests=ON` while running `cmake`. After ins
Usage of spoa is as following:
```bash
spoa [options ...] <sequences>
<sequences>
@@ -52,15 +53,26 @@ Usage of spoa is as following:
containing sequences
options:
-m, --match <int>
-m <int>
default: 5
score for matching bases
-x, --mismatch <int>
-n <int>
default: -4
score for mismatching bases
-g, --gap <int>
-g <int>
default: -8
gap penalty (must be negative)
gap opening penalty (must be non-positive)
-e <int>
default: -6
gap extension penalty (must be non-positive)
-q <int>
default: -10
gap opening penalty of the second affine function
(must be non-positive)
-c <int>
default: -4
gap extension penalty of the second affine function
(must be non-positive)
-l, --algorithm <int>
default: 0
alignment mode:
@@ -80,6 +92,12 @@ Usage of spoa is as following:
-h, --help
prints the usage
gap mode:
linear if g >= e
affine if g <= q or e >= c
convex otherwise (default)
```
### Library
Simple library usage can be seen in the following `example.cpp` file. This code shows how to get consensus and multiple sequence alignment for a set of sequences without quality values.
@@ -99,12 +117,12 @@ int main(int argc, char** argv) {
@@ -136,7 +154,7 @@ g++ example.cpp -std=c++11 -lspoa -o example
The executable can be run with:
```bash
./example 0 5 -4-8
./example 0 5 -4-8-6
```
On the other hand, if you are using `cmake` you can add spoa to your project by adding commands `add_subdirectory(vendor/spoa EXCLUDE_FROM_ALL)` and `target_link_libraries(your_exe spoa)` to your main CMakeLists file.