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

@gmod/nclist

v1.0.0

Published

Read features from JBrowse 1 format nested containment list JSON

Downloads

1,335

Readme

nclist-js

Read legacy JBrowse 1 nested containment list JSON.

Status

Build Status Coverage Status NPM version

Usage

import { RemoteFile } from 'generic-filehandle'
import NCList from '@gmod/nclist'
;(async () => {
  const store = new NCList({
    baseUrl: `http://my.server/path/to/data/dir/`,
    urlTemplate: 'volvox_genes/{refseq}/trackData.json',
    readFile: url => new RemoteFile(url).readFile(),
  })

  for await (const feature of store.getFeatures({
    refName: 'ctgA',
    start: 0,
    end: 50000,
  })) {
    console.log(
      `got feature at ${feature.get('seq_id')}:${feature.get(
        'start',
      )}-${feature.get('end')}`,
    )
  }
})()

API

Table of Contents

NCListStore

Sequence feature store using nested containment lists held in JSON files that are lazily read.

Parameters

  • args object constructor args

    • args.baseUrl string base URL for resolving relative URLs
    • args.urlTemplate string Template string for the root file of each reference sequence. The reference sequence name will be interpolated into this string where {refseq} appears.
    • args.readFile function function to use for reading remote from URLs.
    • args.cacheSize (optional, default 10)

getRegionFeatureDensities

fetch binned counts of feature coverage in the given region.

Parameters
  • query object

    • query.refName string reference sequence name
    • query.start number region start
    • query.end number region end
    • query.numBins number number of bins desired in the feature counts
    • query.basesPerBin number number of bp desired in each feature counting bin

Returns object as: { bins: hist, stats: statEntry }

getFeatures

Fetch features in a given region. This method is an asynchronous generator yielding feature objects.

Parameters
  • args object

    • args.refName string reference sequence name
    • args.start number start of region. 0-based half-open.
    • args.end number end of region. 0-based half-open.