Giter Site home page Giter Site logo

baliga-lab / sequencelogo.js Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 3.0 208 KB

Simple Javascript library for motif rendering

License: GNU Lesser General Public License v3.0

JavaScript 83.47% HTML 16.53%
motif logo pssm sequence logos html5 cross-browser

sequencelogo.js's Introduction

sequencelogo.js - simple sequence logo visualization in Javascript

Example image

Description

This is a simple Javascript library that renders a sequence logo into an HTML canvas element, given a PSSM. Advantages:

  • small
  • cross-browser
  • no dependencies on other Javascript libraries
  • renders graphics on the fly
  • default color sets for nucleotide and peptide sequences

Installation

Simply include the script in your pages with the script tag.

Node.js/NPM

This library is also available as an npm package:

  npm install --save @baliga-lab/sequencelogo.js

Documentation

Official documentation at http://baliga-lab.github.io/sequencelogo.js/

Usage

seqlogo.makeLogo(id, pssm, options);

Parameters

  • id: the id of a DOM element. This will be replaced with a canvas element
  • pssm: a Javascript object that represents a PSSM. The following format is used:
    • alphabet: list of single character strings
    • values: pssm values, columns correspond to the alphabet characters
  • options: a Javascript object containing the following attributes
    • width: canvas width
    • height: canvas height
    • glyphStyle: font used to display the motif characters

Example

seqlogo.makeLogo('mylogo',
                 {
                   alphabet: ['A', 'G', 'C', 'T'],
                   values: [[0.0, 0.1, 0.8, 0.1],
                            ...]
                 },
                 {
                   width: 100, height: 100,
                   glyphStyle: '20pt Helvetica'
                 });

sequencelogo.js's People

Contributors

weiju avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.