# sequence-alignment

> Sequence Alignment Algorithms implemented in Javascript, with a command line application

Latest version **0.0.8** (published 2020-09-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install sequence-alignment
pnpm add sequence-alignment
yarn add sequence-alignment
bun add sequence-alignment
```

Provides the command `align`.

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2020-09-07 |
| First published | 2020-08-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 132.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Tianyi Shi |
| Maintainers | shitianyi2001 |
| Keywords | bioinformatics, alignment, sequence, algorithm, science |

## Links

- npm: https://www.npmjs.com/package/sequence-alignment
- Repository: https://github.com/TianyiShi2001/sequence-alignment-js
- Homepage: https://github.com/TianyiShi2001/sequence-alignment-js#readme
- Issues: https://github.com/TianyiShi2001/sequence-alignment-js/issues
- npm.io page: https://npm.io/package/sequence-alignment

## Dependencies (2)

- [yargs](https://npm.io/package/yargs.md) ^15.4.1
- [inquirer](https://npm.io/package/inquirer.md) ^7.3.3

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.8 (latest) — 2020-09-07
- 0.0.7 — 2020-09-04
- 0.0.6 — 2020-09-04
- 0.0.5 — 2020-09-01
- 0.0.3 — 2020-08-29
- 0.0.2 — 2020-08-28
- 0.0.1 — 2020-08-28

## README

# sequence-alignment-js
[![npm](https://badge.fury.io/js/sequence-alignment.svg)](https://badge.fury.io/js/sequence-alignment)

Sequence Alignment Algorithms implemented in Javascript, with a command line application.

The core algorithm in this package, which is the space efficient version of Gotoh's algorithm, is based on [Eugene W. Myers and Webb Miller (1988) Optimal alignments in linear space, _Bioinformatics_ **4**, 11-17.](https://doi.org/10.1093/bioinformatics/4.1.11)


# Installation

```bash
npm i -g sequence-alignment
```

# Usage

## Help

Use `align -h` to show help page.

## Examples

### Global, Semiglobal and Local Alignment

Global alignment of DNA sequences, using default parameters of NCBI megablast (`match = 1, mismatch = -2, gap = linear`)

```bash
$ align ATCCGAACATCCAATCGAAGC AGCATGCAAT
ATCCGAACAT-CCAATCGAAGC
||||||||||||||||||||||
A---G--CATGC-AAT------
score: -4
```

Semiglobal and local alignment using `-M s` and `-M l`, respectively

```bash
$ align -M s ATCCGAACATCCAATCGAAGC AGCATGCAAT
ATCCGAACATC-CAA-TCGAAGC
|||||||||||||||||||||||
------AGC-ATGCAAT------
score: 5

$ align -M l ATCCGAACATCCAATCGAAGC AGCATGCAAT
A-CAT-CCAAT
|||||||||||
AGCATGC-AAT
score: 5
```

### DNA/RNA/Protein

Use the `-d`, `-r`, `-p` flags to specify the type of sequence to be DNA, RNA and protein, respectively. Defaults to DNA.

```bash
# DNA
align ACCGGT ACGCAT
align -d ACCGGT ACGCAT
# RNA
align -r AUGCGU AUGCUG
# protein
align -p ACGHKL ACGLKL
```

### Specifying Substitution Matrix or Match/Mismatch Scores

Use the `-m` option to specify the substitution **m**atrix (usually for aligning protein sequences) OR **m**atch/**m**ismatch scores (usually for DNA/RNA sequences).

```bash
# align protein sequences using BLOSUM62 matrix
align -p -m blosum62 ASDFG ASDGF
```

```bash
# align DNA sequences with match=2; mismatch=-1
align -d -m 2,-1 ACGTA AGTAC
```

### Gap Penalty

If you used a matrix such as BLOSUM62, the gap

The gap penalty should be a positive number.

Use a single number to specify a constant (linear) gap penalty.

```bash
$ align ACCGGT AT -m 5,-1 -g 3
ACCGGT
||||||
A----T
score: -2
```

Use a pair of numbers to specify the gap open penalty and gap extend penalty, so that the affine gap penalty is used.

```bash
$ align ACCGGT AT -m 5,-1 -g 3,1
ACCGGT
||||||
A----T
score: 3
```

---
_Source: https://npm.io/package/sequence-alignment · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
