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

vue-svg-msa

v3.7.3

Published

Vue component to create a sequence multiple alignment in SVG

Downloads

22

Readme

vue-svg-msa

VueJs component to build a svg multiple sequence alignment.

screenshot

Installation

npm install --save vue-svg-msa npm install --save vue-clipboard2

Usage

in main.js, add:

import VueClipboard from "vue-clipboard2";
Vue.use(VueClipboard);

Now you can use it in your component:

import {SvgMsa} from 'vue-svg-msa'
import 'vue-svg-msa/dist/vue-svg-msa.css'
<SvgMsa :seqs="seqs">
<SvgMsa
      :seqs="seqs"
      :type="nt"
      :start="start"
      :end="end"
      :tracks="tracks"
      :display-track-tooltip="false"
      :metadata="metadata"
      :glyphs="glyphs"
      :display-glyph-tooltip="true"
      :selectedseqs="getselectectids"
      :highlight-selection="always"
      :offset-x="200"
      coloring="auto"
      :resolution="sequence"
    ></SvgMsa>

Only the 'seqs' attribute is mandatory. seqs is an array as:

seqs: [
{
seq: 'ATCATCATCATCATCATACTCATTTTTACAT---CATCATACTACATCATCATATACTCATTTTTACATCATC-TCTT',
id: 'seqid1',
name: 'sequence1',
color: 'red',
titleColor: 'blue',
isConsensus: false,
isNode: false
},
...
],

Only the 'seq' and 'id' attributes are mandatory. If the 'titleColor' attribute is defined, the name of the sequence is written in this color. The 'color' attribute is the nucleotide background color only applied when the 'coloring' attribute of svg-msa is equal to 'seqcolor'. The sequences for which the attribute isConsensus is true are displayed in bold. The name of the sequences for which the attribute isNode is true can be clicked, and an event named 'select-node' emits the id of the sequence.

type is the composition of the sequences: 'nt' for nucleotides (value by default) or 'aa' for amino acids.

start and end are respectively the start and end positions (1-based) of the sequence regions to be displayed.

To display additional tracks in the top of the svg, complete the tracks array. tracks is an array as:

tracks: [
{
  "features": [
    {
      "positions": [[1,20],[52,80]],
      "type": "exon",
      "color": "green",
      "fill-opacity": "0.5"
    },
    {
      "positions": [[21,51]],
      "type": "intron",
      "color": "yellow"
    }
  ],
  "trackLabel": "exon/intron"
}]

If display-track-tooltip is true, display the type and the positions of the feature when hovering with the mouse

coloring allows to colored the nucleotides. The accepted values are 'no', 'seqcolor', 'auto', 'metadata'. It is allowed to mix the values, eg 'seqcolor|metadata' If the value is 'metadata', the styles described in the metadata array are apply to the svg image.

metadata: [
    {
          label: "Conservation level",
          categories: [
            {
              label: "high level",
              style: {
                fill: "red",
                "fill-opacity": 0.5,
                stroke: "black",
              },
              regions: [
                {
                  id: "seqid1",
                  ranges: [
                    [1, 31],
                    [35, 78],
                  ],
                },
                {
                  id: "seqid2",
                  ranges: [[1, 31]],
                },
              ],
            },
          ],
  }, {...}
]

In a region (=an element of the 'regions' array), if the 'id' attribute is empty or missing, the regions of all the sequences would be colored. In a region, if the 'ranges' attribute is empty or missing, all the sequence would be colored.

Note: 'label' attributes are not used.

selectedseqs is an array of sequence ids which will be highlighted in the msa.

glyphs is an array used to display glyphs to makes possible to add information to describe the sequences. for now, for all the sequences of a categorie, a colored circle is drawn to the left of the sequence

glyphs: [
  {
    label: 'resistant/not_resistant',
    categories: [
      { label: 'resistant', style: { fill: 'red' }, ids: ['seqid1'] },
      { label: 'not resistant', style: { fill: 'pink' }, ids: ['seqid2', 'seqid3'] }
    ]
  }, ...
]

If display-glyph-tooltip is true, display the label of the glyph when hovering the mouse over a circle

resolution allows the values 'sequence' (by default) and 'nt'. If "nt", the rendering quality would be better and hovering the mouse over a nucleotide gives access to its position in the sequence.

highlight-selection: by default, if there are selected sequences, metadata on non selected sequences will appear with less opacity. If the highlight-selection property is set to 'always', metadata on non selected sequences will appear with less opacity even if there is no selected sequences. On the contrary, if the highlight-selection property is set to 'never', metadata will appear always with the same opacity, whatever if the sequence is selected or not.

##Contributors

LIPM Bioinfo Team

  • Erika Sallet
  • Ludovic Cottret
  • Sebastien Carrere
  • Ludovic Legrand
  • Jerome Gouzy

##Contact

[email protected]