JSPM

msa-colorschemes

1.0.10
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1407
  • Score
    100M100P100Q117306F
  • License Apache 2

Color schemes for residues

Package Exports

  • msa-colorschemes

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (msa-colorschemes) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

msa-colorschemes

A bundle of different biological color schemes.

NPM version Build Status

npm install msa-colorschemes --save

How to use

var schemes = require("msa-colorschemes");
// pure mappings
var Clustal = schemes.getScheme("clustal");
> {A: "orange", B: "#fff", ...} 

// dynamic color management
var schemeMgr = new schemes();

var Clustal = schemeMgr.getScheme("clustal");
> { default: "#ffffff",
    type: "static",
    map: {A: "orange", ... },
    getColor = function(letter)
  }
Clustal.getColor("B")
> "#fff"

Add your own scheme

schemeMgr.addStaticScheme("bscheme", {B: "#bbb"})
schemeMgr.getScheme("bscheme").getColor("B")
> "#bbb"

Add a dynamic scheme

var fun = schemeMgr.addDynScheme("fscheme", function(letter,info){
    return info.pos % 2 == 0 ? "#ccc" : "#ddd";
})

var scheme = schemeMgr.getScheme("dscheme")
scheme.type
> "dyn"

scheme.getColor("A", {pos: 1})
> "#ccc"
scheme.getColor("A", {pos: 2})
> "#ddd"

What default schemes are provided?

Have a look in the source code.

  • buried_index (aka buried)
  • cinema
  • clustal2
  • clustal
  • helix_propensity (aka helix)
  • hydro
  • lesk
  • mae
  • nucleotide
  • purine_pyrimidine (aka purine)
  • strand_propensity (aka strand)
  • taylor
  • turn_propensity (aka turn)
  • zappo

Contributions

You have another color scheme or want to improve this package - contributions are highly welcome.

References