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

@reservoirgenomics/resglass-sequence

v0.3.3

Published

Resgen flavored sequence tracks for HiGlass

Downloads

153

Readme

Nucleotide sequence tracks for HiGlass

Display nucleotide sequences in HiGlass!

Sequence track

Note: This is the source code for the sequence track only! You might want to check out the following repositories as well:

  • HiGlass viewer: https://github.com/higlass/higlass
  • HiGlass server: https://github.com/higlass/higlass-server
  • HiGlass docker: https://github.com/higlass/higlass-docker

Installation

npm install higlass-sequence

Usage

The live script can be found at:

Client

  1. Make sure you load this track prior to hglib.js. For example:
<script src="/higlass-sequence.js"></script>
<script src="hglib.js"></script>
<script>
  ...
</script>
  1. higlass-sequence can load sequence data in two ways:
  • Convert a FASTA file into the multivec format. Use this format if you need aggregation on lower zoom levels. See the colorAggregationMode option below. The script scripts/fasta_to_hdf5.py will convert your FASTA file into the hdf5 format which then can be converted to the multivec format (see the HiGlass docs for more information). After ingesting the multivec file into a HiGlass server, you can configure the track in your view config in the usual way, using a server and tilesetUid:
{
  "server": "http://localhost:8001/api/v1",
  "tilesetUid": "ScrlBGMbR_WJ0fzKXxKFzA",
  "uid": "seq_multivec_example",
  "type": "horizontal-sequence",
  "options": {
    ...
  },
  "width": 568,
  "height": 25
},
  • The sequence track can also load the data directly into the client using indexed FASTA files. No running HiGlass server is required in this case. The only additional data required (besides the FASTA file) is a fai index file and a chrom sizes file. The track then can be configured in the following way:
{
 "uid": "seq_fasta_example",
 "type": "horizontal-sequence",
 "data": {
   "type": "fasta",
   "fastaUrl": "https://aveit.s3.amazonaws.com/higlass/data/sequence/hg38.fa",
   "faiUrl": "https://aveit.s3.amazonaws.com/higlass/data/sequence/hg38.fa.fai",
   "chromSizesUrl": "https://aveit.s3.amazonaws.com/higlass/data/sequence/hg38.mod.chrom.sizes"
 },
 "options": {
   ...
 },
 "width": 568,
 "height": 25
},

Using indexed FASTA files is easier and faster than multivec files. If no aggregation is needed, this is the preferred way to load data in higlass-sequence.

For an example, see src/index.html.

  1. The following options are available:
{
   "colorAggregationMode": "none", // ['none', 'max', 'weighted']. Ignored when using indexed FASTA files. Determines how pixels are colored on lower zoom levels. 'max' colors the pixels according to the nucleotide with the highest occurence. 'weighted' uses a weighted interpolation of colors.
   "extendedPreloading": false, // More tiles than necessary are loaded. Leads to a smoother horizontal scrolling especially for multivec files.
   "labelPosition": "topLeft",
   "labelColor": "black",
   "labelTextOpacity": 0.4,
   "notificationText": "Zoom in to see nucleotides...", // Notification text if colorAggregationMode == "none" and user zooms out too far.
   "trackBorderWidth": 0,
   "trackBorderColor": "white",
   "backgroundColor": "white",
   "barBorder": true,
   "barBorderColor": "white",
   "fontSize": 16, // size of the letters
   "fontFamily": "Arial",
   "fontColor": "white",
   "colorScale": [
     "#007FFF", // color of A
     "#e8e500", // color of T
     "#008000", // color of G
     "#FF0038", // color of C
     "#800080", // color of N
     "#DCDCDC", // color of everything else
   ],
 }

ECMAScript Modules (ESM)

We also build out ES modules for usage by applications who may need to import or use higlass-sequence as a component.

Whenever there is a statement such as the following, assuming higlass-sequence is in your node_modules folder:

import { SequenceTrack } from 'higlass-sequence';

Then SequenceTrack would automatically be imported from the ./es directory (set via package.json's "module" value).

Support

For questions, please either open an issue or ask on the HiGlass Slack channel at http://bit.ly/higlass-slack

Development

Testing

To run the test suite:

npm run test-watch

Installation

$ git clone https://github.com/higlass/higlass-sequence.git
$ cd higlass-sequence
$ npm install

If you have a local copy of higlass, you can then run this command in the higlass-sequence directory:

npm link higlass

Commands

  • Developmental server: npm start
  • Production build: npm run build