npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@fishka/seqalgo

v1.9.0

Published

Sequence algorithms for bioinformatics — pairwise alignment (Needleman-Wunsch / EMBOSS-compatible) and related sequence analysis utilities

Readme

@fishka/seqalgo

Part of fishka.bio — free browser-based bioinformatics tools.

Sequence algorithms for browser and Node bioinformatics apps. It is the algorithmic companion to @fishka/seqio: seqio reads and writes sequence files, seqalgo analyses the sequences.

Current API:

  • Needleman-Wunsch global alignment with EDNAFULL scoring and IUPAC ambiguity-code support. Scores match EMBOSS needle.
  • Sequence utilities: gap removal/counting and IUPAC-aware reverse complement.
  • Quality trimming: modified Mott and sliding-window trim ranges.
  • Alignment utilities: coordinate conversion, gap-column cleanup, pairwise alignment combination, and gap-filled transforms.
  • Chromatogram utilities: reverse-complement traces and inject alignment gaps into chromatograms.
  • Pileup: place many reads on one short reference, stack them into columns, and read verdicts off those columns (coverage, consensus with IUPAC ambiguity, frequency-threshold variant calling). Reads can come from the built-in aligner or already placed by a mapper — placeFromCigar turns SAM/BAM start positions and CIGARs into the same column block, reconciling insertions across reads.

Planned: mutation classification, consensus calling, heteroplasmy detection.

Install

npm install @fishka/seqalgo

Needleman-Wunsch

import { needleAlign } from '@fishka/seqalgo';

const result = needleAlign('GATCACAGGT', 'GATCAGGT');

result.seqA; // aligned reference: "GATCACAGGT"
result.seqB; // aligned read:      "GAT--CAGGT"
result.score; // EMBOSS-equivalent score
needleAlign(ref, read, {
  gapOpen: 10,
  gapExtend: 0.5,
  gapAnchor: '5-prime',
});

gapAnchor only affects where equally-scoring indels land inside homopolymer/repeat tracts:

  • '5-prime' (default) matches EMBOSS needle tie-breaking.
  • '3-prime' right-anchors gaps for ISFG forensic mtDNA notation.

Sequence and quality helpers

import { mottTrim, reverseComplement, slidingWindowTrim } from '@fishka/seqalgo';

reverseComplement('ACGTRY'); // "RYACGT"

mottTrim([8, 12, 30, 31, 29, 10], { cutoff: 20 }); // { start, end }
slidingWindowTrim([8, 12, 30, 31, 29, 10], { threshold: 20, windowSize: 3 });

Alignment and chromatogram helpers

import {
  applyAlignmentGapsToChromatogram,
  combineAlignments,
  removeColumnsOfGaps,
  reverseComplementChromatogram,
} from '@fishka/seqalgo';

const cleaned = removeColumnsOfGaps(['A-C-', '--C-']);
const combined = combineAlignments(pairwiseAlignments);
const rc = reverseComplementChromatogram(chromatogram);
const gappedTrace = applyAlignmentGapsToChromatogram(rc, 'AC-GT');

Subpath imports are available for @fishka/seqalgo/needle, @fishka/seqalgo/sequence, and @fishka/seqalgo/alignment.

License

Apache-2.0