Code Monkey home page Code Monkey logo

protvista-viewer's Introduction

ncats-protvista-viewer

This component combines various custom and ProtVista Nightingale components to provide the user with a interactive view of aligned protein sequences. An example is shown on Pharos where the sequence variant data and protein annotations come from ProKinO.

To Install

npm install ncats-protvista-viewer

To Configure

Check out ./test.html for an example of how to set the appropriate attributes to visualize your data.

Data Format

sequence: Nested arrays with calculated values for the degree of conservation (in bits) for each residue, where each residue is an array of objects representing the proportion of each amino acid. Amino acids are represented in single letter abbreviations, and bits are floating point numbers. Totals for all amino acids at each residue maxes out at log_2 20 = 4.322 bits.

sequence = [[{aa: Amino_Acid_Abbreviation, bits: Float}]]

annotations: An array of features to show on the lower protvista-tracks. startResidue and endResidue are the start and end residues. name is the name that will show on hover. type is one of the following values that will determine the style in which the feature is display.

    alpha-helix
    alphaC-beta4 Loop
    beta-strand
    Activation Loop
    Activation Segment
    Catalytic Loop
    Glycine Loop
    Subdomain
    Linker
    KeyAA
    R-Spine
    C-Spine
    R-Spine Shell
    N-Lobe
    C-Lobe
    Gatekeeper
    CMGC Insert
    Motif

Easy Customizations

  • see mapIO in common.js to change the display for each type
  • see typeToTrack in viewer.js to change how different annotation types are sorted into tracks

Using the component in Angular SSR

  • The component only runs in the browser, so load it only in the browser.
  • Set your attributes then too, this is an example for the .js file
if (isPlatformBrowser(this.platformID)) {
    import("ncats-protvista-viewer").then(() => {
        if (this.hasVariants()) {
            this.weblogo.nativeElement.setAttribute('sequence', JSON.stringify(this.target.sequence_variants.residue_info));
        }
        if (this.hasAnnotations()) {
            this.weblogo.nativeElement.setAttribute('annotations', JSON.stringify(this.target.sequence_annotations));
        }
    });
}
  • while the html is like this
<ncats-protvista-viewer class="container" #weblogo></ncats-protvista-viewer>

Contact

  • Author: Keith Kelleher
  • Issues: Please post bugs and comments to the Issues tab

protvista-viewer's People

Contributors

keithkelleher avatar noghte avatar

Watchers

James Cloos 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.