Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <script async src="https://ga.jspm.io/npm:es-module-shims@1.6.2/dist/es-module-shims.js"></script>

<script type="importmap">
  {
    "imports": {
      "@nightingale-elements/": "https://cdn.jsdelivr.net/npm/@nightingale-elements/"
    }
  }
</script>

<h1>Domain visualisation using Nightingale v4</h1>

<section class="feature-viewer">
  <nightingale-manager>
    <div>
      <nightingale-navigation id="navigation" height="50" show-highlight>
      </nightingale-navigation>
    </div>
    <div>
      <nightingale-sequence id="sequence" height="30"></nightingale-sequence>
    </div>
    <div style="line-height: 0">
      <nightingale-interpro-track id="track" height="20" highlight-event="onmouseover" show-label use-ctrl-to-zoom>
      </nightingale-interpro>
    </div>

  </nightingale-manager>
</section>

<!-- <nightingale-saver id="saver"
  element-id="just-tracks"
  file-name="tracks"
  file-format="jpeg"
  background-color="#ddddee"
>
  <button>Download</button>
</nightingale-saver> -->
              
            
!

CSS

              
                .feature-viewer {
/*   border: 1px solid grey; */
}
nightingale-manager > div {
  line-height: 0;
  width: 1000px;
}

              
            
!

JS

              
                import "@nightingale-elements/nightingale-new-core@latest";
import "@nightingale-elements/nightingale-sequence@latest";
import "@nightingale-elements/nightingale-manager@latest";
import "@nightingale-elements/nightingale-navigation@latest";
import "@nightingale-elements/nightingale-colored-sequence@latest";
import "@nightingale-elements/nightingale-interpro-track@latest";

// 1) paste your protein sequence
const sequence =  "MADNGNAKPGGGGSGAYTINLDNFSKRLKVFYDHWKEHNSDLWGSSNAIAIATPPPSEDLRYLKSSALDVWLLGYEFPETIIVFMHKQIHFLCSQKKANLIGTLKKAANDAVGADIVLHVKAKNDSGVGLMEDIVRAVCAQSKSDDPIVGHIAKEAPEGKLLEAWADKLSSSSVQLTDITNGFSELFAMKDTSEITCVKKASYLTSSVMKNFVVPKLEKVIDEERKVTHSSLMDETEKAILDPLKVKVKLKAENVDICYPPVFQSGGKFDLKPGASSNDDYLYYDSASVIICAIGARYGNYCSNMARTFLIDATPTQIKAYETLMKAHEAALEALKPGNRMSAVYQAAVDVIEKNAPELLRNLTKSAGTGIGLEFRESGLNLNPKNDRIIKAGMVFNVSLGLHNLQAEKKSEKTKQYSLLLADTCLVPLENLTASCSKLVKDVAYSFNDEDEVLPVKKVEVNAKEALPPTKATLRSDNQEMSKEELRRQHQAELARQKNEETARRLAGVGSGSGDGRGPSRSSNELVAYKNVNDVPYARELVIQVDQKNEAVLLPIYGSMVPFHVSTVKSVTSHQDNRTCTIRIFFNVPGMPFSNDSNLKSQGAIYLKEITFRSKDPRHSSEVVQQIKTLRRQVASRESERAERATLVTQEKLQLTSNRNKPVRLSDVWIRPAFGGRGRKLTGTLESHVNGFRYSTSRADERVDIMYGNVKHAFFQPAEKEMITLLHFHLHNHIMVGNKKTKDVQFYVEVMDVVQTLGGNRRSALDPDEIEEEQRERDRKNRINMDFQNFVNKVNDHWSQPQFKGLDLEFDVPLRELGFHGVPYKASAFIIPTSTCLVELIETPFLVVTLSEIEIVNLERVGFGTKNFDMAIVFKDFKKDVLRIDSIPSTSLDAIKEWLDTTDLKYYESRLNLNWRPILKTIIDDPQKFIDDGGWEFLNMEASDSETEETEESDQGYEPSDAEPESESEDEDSDSESLVESDEDDEDDSEEDSEEEKGKTWEELEREASNADRENGAESDSEEERRRRKVKTFSKSRPPPERSSFKGGPSKKPKFR";

// 2) specify the family or different domains found in the protein
const feature = [
  {
    accession: "PF14826",
    start: 19,
    end: 181,
    color: "blue",
    short_name: "FACT-Spt16_Nlob",
    shape:"roundRectangle"
  },
  {
    accession: "PF00557",
    start: 197,
    end: 426,
    color: "red",
    short_name: "Peptidase_M24",
    shape:"roundRectangle"
  },
  // {
  //   accession: "xxx",
  //   start: 350,
  //   end: 398,
  //   color: "blue",
  //   // short_name: "bridge1",
  //   shape:"bridge"
  // },
  {
    accession: "xxx",
    start: 1,
    end: 10,
    color: "#ff9c00",
    shape:"diamond"
  },
  {
    accession: "PF08644",
    locations: [{ fragments: [{ start: 520, end: 616 }, { start: 725, end: 810 }] }], // use for discontinuous domains
    color: "#A42ea2",
    short_name: "SPT16",
    shape:"roundRectangle"
  }
];

const len_seq = sequence.length;

customElements.whenDefined("nightingale-navigation").then(() => {
  document.getElementById("navigation").setAttribute('length', len_seq);
  document.getElementById("navigation").setAttribute('display-end', len_seq);
});

customElements.whenDefined("nightingale-sequence").then(() => {
  document.getElementById("sequence").sequence = sequence;
  document.getElementById("sequence").setAttribute('length', len_seq);
});

customElements.whenDefined("nightingale-interpro-track").then(() => {
  document.getElementById("track").setAttribute('length', len_seq);
  document.getElementById("track").data = feature;
  document.getElementById("track").setAttribute('label', ".feature.short_name");
});

// document.querySelector("#saver").preSave = () => {
//   const base = document.querySelector("#track");
//   const title = document.createElement("h2");
//   title.setAttribute("id", "tmp_title_element");
//   title.innerHTML = "ProtVista Snapshot";
//   base.insertBefore(title, base.firstChild);
// };

// //removes the title from the DOM
// document.querySelector("#saver").postSave = () => {
//   document
//     .querySelector("#track")
//     .removeChild(document.getElementById("tmp_title_element"));
// };

              
            
!
999px

Console