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

cttv.genome

v0.0.29

Published

Lightweight genome browser for CTTV targets based on TnT Genome

Downloads

29

Readme

CTTV Target Genome Browser

Minimal genome browser built for the CTTV web application.

Installation

From Git

git clone https://github.com/CTTV/targetGenomeBrowser
cd targetGenomeBrowser
npm install
npm build-browser

From npm

npm install cttv.genome

Usage

cttvGenomeBrowser is based on tnt.genome, a library for making minimal genome browsers and displaying genome annotation. Check its documentation for more options. Example of usage:

// Define an instance of tnt.genome
var gB = tnt.board.genome()
    .species("human")
    .gene("ENSG00000157764")
    .width(950);

// Define and instance of cttv.targetGenomeBrowser
var cttvGB = targetGenomeBrowser()
    .show_snps(false)
    .show_nav(true);

// Start the genome browser using the tnt.genome in the given div element
cttvGB (gB, document.getElementById("genomeBrowser"));

More examples available in the examples folder

API

cttvGenomeBrowser exposes the following methods:

show_nav

If the buttons-based navigation is included in the display. Defaults to true.

var cttvGB = targetGenomeBrowser()
    .show_nav(false);

show_links

If the link to the Ensembl Genome browser in included in the display. Defaults to true.

var cttvGB = targetGenomeBrowser()
    .show_links(false);

show_snps

If the SNPs tracks are displayed. Defaults to true.

var cttvGB = targetGenomeBrowser()
    .show_snps(false);

track

Returns a given track by name. The following names are available:

| Name | Track | | :------------- | :-------------------------------- | | gene | The Gene / Transcript track | | common_snps | The track containing SNPs associating the gene to common diseases | | rare_snps | The track containing SNPs associating the gene to reare diseases |

var cttvGB = targetGenomeBrowser();
var geneTrack = cttvGB.track("gene");

geneTrack.display().on("click", function (gene) {
    var elem = this;
    var tooltip_obj = function (g) {
        var obj = {};
        obj.header = (g.display_name || g.external_name) + " (" + g.id + ")";
        obj.rows = [];

        obj.rows.push( {
            "label" : "Biotype",
            "value" : g.biotype
        });

        obj.rows.push( {
            "label" : "Description",
            "value" : g.description || g.gene.description
        });

        return obj;
    }
    tnt.tooltip.table()
        .call(elem, tooltip_obj(gene));
});

If any change is made to the track after the plug-in has been initialised (see tnt.genome and tnt.board for examples), the visualisation needs to be re-started using the start method

start

Re-start the genome browser after making any change. For example, the following snippet change the gene to be displayed as transcripts when a gene is clicked:

gBTheme(gB, document.getElementById("genomeBrowser"));

var geneTrack = gBTheme.track("gene");
geneTrack.display().on("click", function (gene) {
    if (!gene.gene) { // It is not a transcript
        gB.gene (gene.id);
        gBTheme.start();
    }
});

Feedback

Please, send any comments, bug reports or features request to support (AT) targetvalidation.org