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

gwas-credible-sets

v0.1.0

Published

Summarize GWAS results

Downloads

124

Readme

gwas-credible-sets

A package for calculating Bayes factors and credible sets from genome-wide association study (GWAS) results.

Travis build status Dependency Status devDependency Status

Synopsis

This package provides functions for calculating Bayes factors and credible sets using p-values from GWAS results. These functions can be used separately, or combined with locuszoom.js for interactive credible set visualization.

LocusZoom implements a simple procedure based on this package. See the usage instructions, below, for an example. In the future, additional methods for identifying and annotating credible sets may be provided.

Usage

How to include in your project

This package may be directly incorporated into other javascript projects as a module, or by including dist/gwas-credible-sets.min.js directly into your page (as a standalone file, or via a CDN option such as unpkg).

gwas-credible-sets also supports several packaging environments and may be used in both client and server side applications, including Node.js, ES6 modules, and Webpack. It may be installed from NPM:

npm install --save gwas-credible-sets

For information about performance impacts of client-side computation, see timing and performance estimates.

Sample credible set calculation

The instructions below assume that the module is being sourced directly into a page:

<script src="https://cdn.example/gwas-credible-sets.min.js" type="application/javascript"></script>

The example below assumes that you are given an array of p-values, each representing a different data point. It returns a set of booleans saying whether each data point is a member of the 95% credible set.

    /// Calculate Bayes factors and process into a form that can be used for the credible set
    var scores = gwasCredibleSets.scoring.bayesFactors(nlogpvals);
    var posteriorProbabilities = gwasCredibleSets.scoring.normalizeProbabilities(scores);
    // Identify the credible set and apply filters for visualization
    var credibleSet = gwasCredibleSets.marking.findCredibleSet(posteriorProbabilities, 0.95);
    var credibleSetBoolean = gwasCredibleSets.marking.markBoolean(credibleSet);

The marking module contains several helper functions to control how the credible set is returned. Helper methods are provided to process the set members (posterior probabilities) in ways that support visualization needs. See full documentation for details.

Development

Requirements

This package has been developed and tested using Node.js 8 LTS (Carbon).

If you would like to make changes to the core functionality within this module for development, install package requirements as follows:

npm install

Some portions of the documentation (such as methods) require pandoc and a working LaTeX installation on your system; you must install these separately.

Useful Commands

The following commands are particularly useful during development

  • npm test: run unit tests and exit
  • npm run watch: auto-run tests whenever code changes
  • npm run build: build dist/ files and update documentation