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 🙏

© 2025 – Pkg Stats / Ryan Hefner

hyphy-scope

v1.7.2

Published

Reusable Svelte components for HyPhy analysis visualization

Readme

HyPhy Scope

CI npm version License: MIT

Reusable Svelte components for HyPhy analysis visualization

Overview

HyPhy Scope provides a collection of Svelte 5 components for visualizing results from HyPhy (Hypothesis Testing using Phylogenies) analyses. These components help researchers create interactive, publication-ready visualizations for various selection analysis methods.

Features

  • 📊 Interactive Visualizations: Built with Observable Plot and D3.js
  • 🧬 Comprehensive Analysis Support: FEL, MEME, aBSREL, BUSTED, RELAX, SLAC, BGM, FADE, GARD
  • 🌳 Phylogenetic Tree Viewer: Interactive tree visualization with phylotree.js
  • 🎨 Customizable: Control thresholds, colors, and display options
  • 📱 Responsive: Components adapt to different screen sizes
  • 🧪 Well-tested: Comprehensive test suite with Vitest
  • 📚 TypeScript Support: Full type definitions included
  • 📖 Storybook Documentation: Interactive component playground

Installation

npm install hyphy-scope

Quick Start

import { FelVisualization } from 'hyphy-scope';

// Use with your HyPhy results
<FelVisualization 
  data={felResults} 
  pvalueThreshold={0.1}
/>

Available Components

Selection Analysis Components

  • FelVisualization: Fixed Effects Likelihood site-level selection analysis
  • MemeVisualization: Mixed Effects Model of Evolution episodic selection analysis
  • AbsrelVisualization: adaptive Branch-Site REL branch-level selection analysis
  • BustedVisualization: Gene-wide selection test visualization
  • RelaxVisualization: Selection intensity changes visualization
  • SlacVisualization: Single Likelihood Ancestor Counting analysis
  • BgmVisualization: Bayesian Graphical Model for coevolution
  • FadeVisualization: FUBAR Approach to Directional Evolution
  • GardVisualization: Genetic Algorithm for Recombination Detection

Tree Visualization

  • PhylogeneticTreeViewer: Interactive phylogenetic tree visualization with zoom, pan, and node selection

Data Format

All components expect data in HyPhy's standard JSON output format. You can load data using the provided utilities:

import { loadDataFromUrl, loadDataFromStorage } from 'hyphy-scope';

// Load from URL
const data = await loadDataFromUrl('https://example.com/hyphy-results.json');

// Load from local storage
const data = loadDataFromStorage('analysis-key');

Component Props

Most visualization components share common props:

| Prop | Type | Default | Description | |------|------|---------|-------------| | data | object | required | HyPhy analysis results in JSON format | | pvalueThreshold | number | 0.1 | P-value threshold for significance | | width | number | 800 | Chart width in pixels | | height | number | 600 | Chart height in pixels |

Development

Prerequisites

  • Node.js 18 or later
  • npm 9 or later

Setup

# Clone the repository
git clone https://github.com/stevenweaver/hyphy-scope.git
cd hyphy-scope

# Install dependencies
npm install

# Generate SvelteKit files
npx svelte-kit sync

# Start development server
npm run dev

# Run tests
npm test

# Run Storybook
npm run storybook

Building

# Build the library
npm run build

# Build and package for distribution
npm run package

Testing

# Run tests
npm test

# Run tests in watch mode
npm run test:watch

# Run tests with UI
npm run test:ui

Storybook

View the interactive component documentation:

npm run storybook

Then open http://localhost:6006 to see all components with live examples.

Examples

FEL Visualization

import { FelVisualization } from 'hyphy-scope';

<FelVisualization 
  data={felData}
  pvalueThreshold={0.05}
  width={900}
  height={700}
/>

Phylogenetic Tree Viewer

import { PhylogeneticTreeViewer } from 'hyphy-scope';

<PhylogeneticTreeViewer 
  data={treeData}
  width={800}
  height={600}
  showBranchLengths={true}
  enableZoom={true}
/>

Loading Data from URL

import { FelVisualization, loadDataFromUrl } from 'hyphy-scope';

let data;

onMount(async () => {
  data = await loadDataFromUrl('https://example.com/fel-results.json');
});

{#if data}
  <FelVisualization {data} />
{/if}

Browser Support

HyPhy Scope supports all modern browsers (Chrome, Firefox, Safari, Edge). Internet Explorer is not supported.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Support

Citation

If you use HyPhy Scope in your research, please cite:

@software{hyphy-scope,
  author = {Steven Weaver},
  title = {HyPhy Scope: Reusable Svelte components for HyPhy analysis visualization},
  url = {https://github.com/stevenweaver/hyphy-scope},
  year = {2024}
}