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 🙏

© 2024 – Pkg Stats / Ryan Hefner

higlass-dynseq

v0.1.9

Published

Dynamic sequence track for HiGlass

Downloads

16

Readme

higlass-dynseq

Dynamic sequence track for HiGlass

Installation

If you are using NPM:

npm install higlass-dynseq

Then you can load it by adding this import to your JavaScript:

import HorizontalDynseqTrack from 'higlass-dynseq';

// Alternatively, if you don't need access to the component
import 'higlass-dynseq';

Otherwise, load higlass-dynseq from a CDN. You can use this script tag:

<script src="https://unpkg.com/higlass-dynseq"></script>
<!-- Make sure to load higlass-dynseq before hglib.js -->
<script src="hglib.js"></script>

Usage

The DynSeq track depends on both a data source (e.g. bigWig) and a sequence source (FASTA). You should load them together with higlass-multi-tileset (follow the installation instructions before using it).

{
  // You must use a custom data config
  "data": {
    "type": "multi-tileset",
    "configs": [
      // The first config is the data source
      {
        "server": "http://localhost:8001/api/v1",
        "tilesetUid": "my-bigwig-tileset"
      },
      // The second config is the FASTA sequence source
      {
        "server": "https://my-higlass-server.com/api/v1",
        "tilesetUid": "my-fasta-tileset"
      }
    ]
  },
  "uid": "dynseq-example",
  "type": "horizontal-dynseq",
  // See below for list of options
  "options": {
    ...
  }
}

These options are available (beyond the standard ones such as labelColor and minHeight):

{
  // Style for line when sequence zoomed out
  "lineStrokeColor": "blue",
  "lineStrokeWidth": 1,
  "valueScaling": "linear", // can be "log"
  // The smallest font size where the sequence should be shown
  "minFontSize": 0,
  // When the sequence should start to fade out
  "fadeOutFontSize": 8,
  // Maximum font size to grow to
  "maxFontSize": 40,
  // Set to true if the sequence has more than A, T, C, G, N
  "nonStandardSequence": false,
  "fontFamily": "Arial",
  // Colors for each character (must be uppercase)
  "fontColors": {
    "A": "#89c738",
    "T": "#9238c7",
    "C": "#e05144",
    "G": "#3899c7",
    "N": "#858585"
  },
  // Color for characters not in fontColors
  "defaultFontColor": "#ffb347"
}

Features

The DynSeq track was designed with performance in mind. It only fetches the FASTA sequence when it is visible on screen and takes advantage of HiGlass' tiling system to minimize network requests and latency. Using efficient rendering techniques and debounced, batched updates, the track remains as fast as a standalone line track.

Multiple DynSeq tracks that use the same FASTA sequence but different datasets will remain fast due to the tile cache in HiGlass, which prevents duplicate tile requests, and the efficient Pixi.js-based rendering system, which reuses a high-resolution bitmap of each character to offer smooth, latency-free analysis even on low-end devices.

higlass-dynseq includes a configurable automatic hiding feature for the FASTA sequence when there are thousands of characters on screen. As a user zooms out, the sequence will fade out as it is replaced by a colored line, which will more accurately show the data. At low zoom levels, the DynSeq track is similar to the horizontal-line track built-in to HiGlass.

Support

File an issue if you have found a bug, would like help resolving a problem, or want to ask a question about using the track.

Alternatively, contact Arjun Barrett for more information.