@genome-spy/app 0.56.1 → 0.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_commonjsHelpers-DjF3Plf2.js +26 -0
- package/dist/app.css +1 -0
- package/dist/index-BftNdA0O.js +27 -0
- package/dist/index-C08YCM2T.js +539 -0
- package/dist/index-CCJIjehY.js +218 -0
- package/dist/index-CalimFw3.js +2131 -0
- package/dist/index-DS2hvLgl.js +3425 -0
- package/dist/index-DTcHjAHp.js +505 -0
- package/dist/index-Dec7VcMU.js +626 -0
- package/dist/index-DnIkxb0L.js +1025 -0
- package/dist/index-DwLfOHEk.js +1319 -0
- package/dist/{index-HGQZ77IK.js → index-Ww3TAo6_.js} +7 -7
- package/dist/{index-CjesiOz_.js → index-vgGDWUPz.js} +24 -24
- package/dist/index.es.js +9704 -10544
- package/dist/index.js +598 -789
- package/dist/long-BviWyoZx.js +2387 -0
- package/dist/remoteFile-BuaqFGWk.js +94 -0
- package/package.json +3 -3
- package/dist/_commonjsHelpers-DSebQMb9.js +0 -28
- package/dist/index-B6haPltu.js +0 -1042
- package/dist/index-BhtH2nrr.js +0 -513
- package/dist/index-BpoXW6_f.js +0 -1370
- package/dist/index-COovE1Oo.js +0 -3997
- package/dist/index-WACuLhO6.js +0 -2136
- package/dist/index-_ftu0t0z.js +0 -500
- package/dist/index-nCZhu2o-.js +0 -613
- package/dist/long-BXK3UEks.js +0 -2375
- package/dist/remoteFile-DuIsnepi.js +0 -90
- package/dist/style.css +0 -1
@@ -0,0 +1,26 @@
|
|
1
|
+
function n(e) {
|
2
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
3
|
+
}
|
4
|
+
function c(e) {
|
5
|
+
if (e.__esModule) return e;
|
6
|
+
var o = e.default;
|
7
|
+
if (typeof o == "function") {
|
8
|
+
var t = function r() {
|
9
|
+
return this instanceof r ? Reflect.construct(o, arguments, this.constructor) : o.apply(this, arguments);
|
10
|
+
};
|
11
|
+
t.prototype = o.prototype;
|
12
|
+
} else t = {};
|
13
|
+
return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(e).forEach(function(r) {
|
14
|
+
var u = Object.getOwnPropertyDescriptor(e, r);
|
15
|
+
Object.defineProperty(t, r, u.get ? u : {
|
16
|
+
enumerable: !0,
|
17
|
+
get: function() {
|
18
|
+
return e[r];
|
19
|
+
}
|
20
|
+
});
|
21
|
+
}), t;
|
22
|
+
}
|
23
|
+
export {
|
24
|
+
c as a,
|
25
|
+
n as g
|
26
|
+
};
|
package/dist/app.css
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
.gs-modal{z-index:101;font-family:system-ui,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;font-size:14px;position:fixed;top:0;right:0;bottom:0;left:0;display:grid;justify-content:center;align-content:center}.gs-modal .backdrop{position:absolute;top:0;right:0;bottom:0;left:0;background-color:#4b4b4b;opacity:0;transition:opacity .3s ease-in-out}.gs-modal .content{z-index:1;box-shadow:0 3px 15px #00000036;background:#fff;border-radius:3px;min-width:300px;opacity:0;transform:translateY(-15px);transition:opacity .2s ease-in-out,transform .2s ease-in-out}.gs-modal.visible .backdrop{opacity:.4}.gs-modal.visible .content{transform:translate(0);opacity:1}.gs-modal .modal-body,.gs-modal .modal-title,.gs-modal .modal-buttons{padding:10px}.gs-modal .modal-title{font-weight:700;padding-bottom:0}.gs-modal .modal-body>:first-child{margin-top:0}.gs-modal .modal-body>:last-child{margin-bottom:0}.gs-modal .modal-buttons{display:flex;justify-content:flex-end;gap:10px;border-top:1px solid #d0d0d0}.gs-modal .btn{display:inline-block;padding:4px 12px;margin:0;font-size:1em;line-height:20px;color:#333;text-align:center;text-shadow:0 1px 1px rgba(255,255,255,.75);vertical-align:middle;background-image:linear-gradient(to bottom,#fff,#e6e6e6);border:1px solid #cccccc;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);border-bottom-color:#b3b3b3;border-radius:4px;box-shadow:inset 0 1px #fff3,0 1px 2px #0000000d;transition:color .15s}.gs-modal .btn:hover:not(:disabled){background-image:linear-gradient(to bottom,#f8f8f8,#d8d8d8)}.gs-modal .btn:active{border-color:rgba(0,0,0,.2) rgba(0,0,0,.2) rgba(0,0,0,.5)}.gs-modal .btn:disabled{color:#a0a0a0}.gs-modal .btn:not(:disabled){cursor:pointer}.gs-modal .btn svg:first-child:not(:last-child){font-size:85%;margin-right:.3em}.gs-modal .btn svg:last-child:not(:first-child){font-size:85%;margin-left:.3em}.gs-modal .btn-group{display:flex;font-size:1.3em;margin-bottom:10px}.gs-modal .btn-group .btn{flex-grow:1}.gs-modal .btn-group .btn:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}.gs-modal .btn-group .btn:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.gs-modal .btn-group .btn.chosen{background-image:linear-gradient(to bottom,#f0f0f0,#d8d8d8);box-shadow:inset 0 2px 3px #0000004d}.gs-modal a{color:#5570a2;text-decoration:none}.gs-modal a:hover{text-decoration:underline}.gs-modal *{box-sizing:border-box}.gs-menu,.gs-context-menu,.gs-dropdown-menu{margin:0;padding:7px 0;background:#f6f6f6;border:#e0e0e0;border-radius:2px;max-height:calc(100vh - 60px);overflow-y:auto;z-index:100;box-shadow:0 3px 15px #00000036;cursor:default;line-height:22px;font-size:13px;font-family:system-ui,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol}.gs-menu li,.gs-context-menu li,.gs-dropdown-menu li{display:block;list-style:none;position:relative;padding:0}.gs-menu li.active>:is(a:first-child,.submenu-item),.gs-context-menu li.active>:is(a:first-child,.submenu-item),.gs-dropdown-menu li.active>:is(a:first-child,.submenu-item){background-color:#e8e8e8}.gs-menu li>:is(a:first-child,label,.submenu-item):hover,.gs-context-menu li>:is(a:first-child,label,.submenu-item):hover,.gs-dropdown-menu li>:is(a:first-child,label,.submenu-item):hover{background-color:#e0e0e0}.gs-menu li>span.disabled-item,.gs-menu li>a:first-child,.gs-context-menu li>span.disabled-item,.gs-context-menu li>a:first-child,.gs-dropdown-menu li>span.disabled-item,.gs-dropdown-menu li>a:first-child{display:block}.gs-menu li>span.disabled-item svg:first-child,.gs-menu li>a:first-child svg:first-child,.gs-context-menu li>span.disabled-item svg:first-child,.gs-context-menu li>a:first-child svg:first-child,.gs-dropdown-menu li>span.disabled-item svg:first-child,.gs-dropdown-menu li>a:first-child svg:first-child{width:1em;margin-right:.2em}.gs-menu .context,.gs-context-menu .context,.gs-dropdown-menu .context{font-size:.9em;color:#666}.gs-menu .context:before,.gs-context-menu .context:before,.gs-dropdown-menu .context:before{content:"("}.gs-menu .context:after,.gs-context-menu .context:after,.gs-dropdown-menu .context:after{content:")"}.gs-menu .menu-divider,.gs-context-menu .menu-divider,.gs-dropdown-menu .menu-divider{margin:5px 0;border-top:1px solid #e0e0e0}.gs-menu .menu-header,.gs-menu li>:is(span.disabled-item,a:first-child,.submenu-item,label),.gs-context-menu .menu-header,.gs-context-menu li>:is(span.disabled-item,a:first-child,.submenu-item,label),.gs-dropdown-menu .menu-header,.gs-dropdown-menu li>:is(span.disabled-item,a:first-child,.submenu-item,label){padding-left:15px;padding-right:15px}.gs-menu .menu-header,.gs-context-menu .menu-header,.gs-dropdown-menu .menu-header{font-size:12px;color:#666}.gs-menu li>:is(div.submenu-item,.choice-item),.gs-context-menu li>:is(div.submenu-item,.choice-item),.gs-dropdown-menu li>:is(div.submenu-item,.choice-item){display:flex;justify-content:space-between;align-items:center}.gs-menu li>:is(div.submenu-item,.choice-item)>:first-child,.gs-context-menu li>:is(div.submenu-item,.choice-item)>:first-child,.gs-dropdown-menu li>:is(div.submenu-item,.choice-item)>:first-child{flex-grow:1}.gs-menu li>.submenu-item:after,.gs-context-menu li>.submenu-item:after,.gs-dropdown-menu li>.submenu-item:after{content:"";width:0;height:0;border-top:.4em solid transparent;border-bottom:.4em solid transparent;border-left:.4em solid black;margin-left:1em}.gs-menu li .kbd-shortcut,.gs-context-menu li .kbd-shortcut,.gs-dropdown-menu li .kbd-shortcut{color:#666;background-color:#ffffff80;font-size:.9em;border:1px solid #aaa;border-bottom-width:2px;border-radius:3px;padding:3px;line-height:.7em;margin-left:.5em}.gs-menu li>.disabled-item,.gs-context-menu li>.disabled-item,.gs-dropdown-menu li>.disabled-item{color:#999}.gs-menu a.menu-ellipsis,.gs-context-menu a.menu-ellipsis,.gs-dropdown-menu a.menu-ellipsis{padding:0;display:flex;align-items:center;position:absolute;top:0;right:7.5px;height:22px;background-color:#e0e0e0;border-radius:3em;color:#707070}.gs-menu a.menu-ellipsis svg,.gs-context-menu a.menu-ellipsis svg,.gs-dropdown-menu a.menu-ellipsis svg{margin:0;width:22px}.gs-menu a.menu-ellipsis:hover,.gs-context-menu a.menu-ellipsis:hover,.gs-dropdown-menu a.menu-ellipsis:hover{background-color:#e9e9e9}.gs-menu li:not(:hover) a.menu-ellipsis,.gs-context-menu li:not(:hover) a.menu-ellipsis,.gs-dropdown-menu li:not(:hover) a.menu-ellipsis{display:none}.gs-menu .gs-input-binding,.gs-context-menu .gs-input-binding,.gs-dropdown-menu .gs-input-binding{margin:0 15px;line-height:normal}.gs-menu .gs-input-binding .description,.gs-context-menu .gs-input-binding .description,.gs-dropdown-menu .gs-input-binding .description{margin-bottom:.2em}.gs-context-menu-backdrop{position:fixed;z-index:100;top:0;right:0;bottom:0;left:0}.gs-context-menu{position:fixed;z-index:100}.gs-dropdown-menu{overflow:auto;position:absolute;display:none;z-index:1;width:max-content}.gs-dropdown-menu ul{padding-left:1.5em;list-style:none}.gs-dropdown-menu>li>ul{padding-left:0}label.checkbox{display:flex;align-items:center}label.checkbox input[type=checkbox]{flex:none;margin-right:.5em}.gs-tabs{margin:0}.gs-tabs .tabs{display:flex;list-style:none;padding:0;margin-top:0}.gs-tabs .tabs:after{flex-grow:1;content:"";display:block;border-bottom:1px solid #d0d0d0}.gs-tabs .tabs button{font-size:1em;background-color:transparent;align-items:center;padding:.6em 10px;border:1px solid #d0d0d0;border-radius:5px 5px 0 0;cursor:pointer}.gs-tabs .tabs>li:not(:first-child)>button{margin-left:-1px}.gs-tabs .tabs .active-tab button{border-bottom-color:transparent}.gs-tabs .tabs :not(.active-tab) button{border-color:transparent;border-bottom-color:#d0d0d0}.gs-tabs .panes>:not(.active-tab){display:none}.gs-alert{display:flex;align-items:center;position:relative;padding:.8em;margin-bottom:1em;border:1px solid transparent;border-radius:.25rem}.gs-alert>svg:first-child{width:2em;height:2em;margin-right:.8em}.gs-alert.warning{color:#664d03;background-color:#fff3cd;border-color:#ffecb5}.gs-alert.info{color:#055160;background-color:#cff4fc;border-color:#b6effb}.gs-form-group>p:first-child{margin-top:0}.gs-form-group:not(:first-child){margin-top:.5em}.gs-form-group label{display:inline-block;margin-bottom:.5em}.gs-form-group input[type=text],.gs-form-group input[type=number],.gs-form-group select,.gs-form-group textarea{display:block;width:100%;padding:.375em .75em;font-size:1em;font-family:system-ui,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;line-height:1.5;color:#212529;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25em;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.gs-form-group input[type=text]:not(:last-child),.gs-form-group input[type=number]:not(:last-child),.gs-form-group select:not(:last-child),.gs-form-group textarea:not(:last-child){margin-bottom:10px}.gs-form-group input[type=text]::placeholder,.gs-form-group input[type=number]::placeholder,.gs-form-group select::placeholder,.gs-form-group textarea::placeholder{color:#a0a0a0}.gs-form-group select{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right .75rem center;background-size:16px 12px;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gs-form-group small{display:block;margin-top:.25rem;color:#606060}.gs-form-group .threshold-flex{display:flex;gap:10px}.gs-form-group .threshold-flex:not(:last-child){margin-bottom:10px}.gs-form-group .threshold-flex *{margin-bottom:0!important}.gs-form-group .threshold-flex>:first-child{width:5em}.gs-form-group .threshold-flex>:last-child{padding:0 10px}.gs-checkbox-list-wrapper{position:relative}.gs-checkbox-list-wrapper .search-note{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;justify-content:center;align-content:center;color:gray;font-size:85%;pointer-events:none}.gs-checkbox-list-wrapper .search-note>*{position:relative;top:.7em}.gs-checkbox-list{color:#212529;border:1px solid #ced4da;border-radius:.25em;overflow:auto;max-height:200px;padding:.375em .75em;margin:0}.gs-checkbox-list .color{display:inline-block;width:.5em;height:1em;margin-right:.4em}.gs-checkbox-list li{list-style:none}.gs-checkbox-list label.checkbox{margin-bottom:0}.gs-checkbox-list label.checkbox:hover{background-color:#f4f4f4}.gs-checkbox-list .hidden{display:none}.genome-spy-app{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;font-family:system-ui,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;font-size:14px}body>.genome-spy-app{background-color:#fff}.genome-spy-app .genome-spy-container{position:relative;flex-grow:1;overflow:hidden}.gs-toolbar,.gs-toolbar .btn-group{display:flex;flex-direction:row;align-items:center}.gs-toolbar{height:38px;background-color:#6c82ab;box-shadow:0 0 3px #00000080;border-top:1px solid rgb(156.6818181818,171.3961038961,198.8181818182);border-bottom:1px solid rgb(73.6363636364,92.9220779221,128.8636363636)}.gs-toolbar .spacer{flex-grow:1}.gs-toolbar .logo{display:block}.gs-toolbar .logo img{vertical-align:middle;width:34px}.gs-toolbar .vis-title,.gs-toolbar .version{color:#fff;font-weight:400;text-shadow:0 1px 2px rgba(0,0,0,.2)}.gs-toolbar .version{text-decoration:none;font-size:80%;opacity:50%}.gs-toolbar .version:visited{color:#fff}.gs-toolbar .search-input{font-size:1em;background-color:#5c74a1;color:#fff;border:1px solid rgb(82.9090909091,104.6233766234,145.0909090909);width:260px;padding:3px 6px;outline:none;position:relative;box-shadow:0 1px 3px #0000001a inset,1px 1px #798db2;text-shadow:0 1px 2px rgba(0,0,0,.3)}.gs-toolbar .search-help{box-sizing:border-box;position:absolute;border:none;background:#f6f6f6;padding:10px;z-index:1000;visibility:hidden;box-shadow:0 3px 14px #00000026;font-size:90%;opacity:0;transition:opacity .2s,transform .2s ease-in-out,visibility .2s;transform:translateY(13px)}.gs-toolbar .search-help>:first-child{margin-top:0}.gs-toolbar .search-help>:last-child{margin-bottom:0}.gs-toolbar .search-help p{margin-bottom:.5em}.gs-toolbar .search-help ul{margin-top:.5em;padding-left:2.5em}.gs-toolbar .search-help li{cursor:pointer}.gs-toolbar .search:focus-within .search-help{opacity:1;visibility:visible;transform:translateY(3px)}.gs-toolbar>*{padding-left:10px}.gs-toolbar>*:last-child{margin-right:10px}.gs-toolbar .tool-btn{padding:0;font-size:1.15em;transition:color .15s;background-color:#7c90b4;background-image:linear-gradient(to bottom,#8698ba,#7288af);color:#fff;height:26px;width:30px;border:1px solid;border-top-color:#9dabc7;border-left-color:#8395b8;border-right-color:#5c74a1;border-bottom-color:#4a5d81;box-shadow:0 1px 1px #00000026;border-radius:2px;margin-left:10px;display:flex;align-items:center;justify-content:center}.gs-toolbar .tool-btn>svg{filter:drop-shadow(0 0 1px rgba(0,0,0,.3))}.gs-toolbar .tool-btn:active>*{position:relative;top:1px}.gs-toolbar .tool-btn:disabled{color:#b6c1d5}.gs-toolbar .tool-btn:hover:not(:disabled){background-image:linear-gradient(to bottom,#8c9ebe,#7c90b4)}.gs-toolbar .tool-btn:hover:not(:disabled)>svg{filter:drop-shadow(0 0 3px rgb(150,200,255))}.gs-toolbar .tool-btn:focus{outline:none}.gs-toolbar .btn-group .tool-btn,.gs-toolbar .dropdown .tool-btn{margin-left:0}.gs-toolbar .dropdown{position:relative}.gs-toolbar .dropdown.show .gs-dropdown-menu{display:block}.gs-toolbar .dropdown.show>button{background-image:linear-gradient(to bottom,#93a3c1,#8698ba)}.provenance-menu .operator{font-size:125%;line-height:.8}.gs-dropdown-menu.provenance-menu .active-state{background-color:#e0e0e0;border-left:5px solid #c0c0c0;padding-left:10px}.group-by-thresholds-form{width:25em}.group-by-thresholds-form .group-color{display:inline-block;width:.7em;height:.7em}.group-by-thresholds-form .threshold-groups{margin-top:10px;text-align:left;font-size:90%}.group-by-thresholds-form .threshold-groups :is(th,td){padding-right:1em}.group-by-thresholds-form .threshold-groups :is(th,td):nth-child(2){min-width:9em}.group-arbitrarily-form span.na{color:gray;font-style:italic;font-size:90%}.group-arbitrarily-form span.color{display:inline-block;width:.7em;height:1em;margin-right:.7em}.group-arbitrarily-form div.table{color:#212529;border:1px solid #ced4da;border-radius:.25em;overflow-x:auto;max-height:20em;padding:0 .75em .375em;margin:0}.group-arbitrarily-form div.table table{position:relative;border-collapse:collapse}.group-arbitrarily-form div.table td:first-child{padding-right:.7em}.group-arbitrarily-form div.table th{text-align:left;background:#fff;background:linear-gradient(#fff,#fdfdff 90%,#fff0);position:sticky;top:0;padding-top:.55em;padding-bottom:.375em}.group-arbitrarily-form.gs-form-group select{padding-top:.1em;padding-bottom:.1em}.copy-url{position:relative}.copy-url button{position:absolute;right:.4em;top:.4em;bottom:.4em;box-shadow:0 0 .2em .2em #fff;border:1px solid rgb(66,127,240);border-radius:3px;color:#427ff0;background-color:#fff}.copy-url button:hover{color:#fff;background-color:#427ff0}.gs-suppress-tooltip .genome-spy .tooltip{display:none}.histogram-widget,.histogram-widget .histogram-plot{position:relative}.histogram-widget .histogram-bars{position:relative;height:4em;background-color:#f0f0f0;border-top-left-radius:.25em;border-top-right-radius:.25em;overflow:hidden}.histogram-widget .histogram-bars>div{position:absolute;background-color:gray}.histogram-widget .histogram-thresholds{position:absolute;height:100%;width:100%;top:0}.histogram-widget .histogram-thresholds .histogram-threshold{position:absolute;width:1px;height:100%;background-color:#000}.histogram-widget .histogram-thresholds .histogram-knob{position:absolute;top:-.6em;left:calc(.5px - .6em);width:1.2em;height:1.2em;border-radius:1.2em;background:#000;color:#fff;font-size:80%;text-align:center;vertical-align:middle;cursor:col-resize}.histogram-widget .histogram-domain{position:absolute;width:100%;height:.5em;border:1px solid #333;border-bottom-style:none}.histogram-widget .histogram-extent{display:flex;justify-content:space-between;font-size:90%}.histogram-widget .histogram-extent>div{margin:.1em .3em 0}.histogram-widget .histogram-hint{position:absolute;top:0;right:0;bottom:0;left:0;font-size:85%;display:flex;align-items:center;justify-content:center;pointer-events:none;opacity:0;transition:opacity .3s}.histogram-widget .histogram-hint.visible{opacity:1}.histogram-widget .histogram-hint span{position:relative;top:-30%;background-color:#f0f0f0b3;color:#333;cursor:default}.gs-modal.tour{pointer-events:none;justify-content:right;align-content:end}.gs-modal.tour.visible .backdrop{opacity:1}.gs-modal.tour .backdrop{pointer-events:none;background:linear-gradient(160deg,transparent 70%,rgba(0,0,0,.2))}.gs-modal.tour .content{pointer-events:all;margin:10px;box-shadow:0 3px 15px #00000036,0 2px 5px #00000036}.gs-modal.tour .modal-title{padding-right:3em}.gs-modal.tour .markdown img{max-width:350px;display:block;margin:1em auto}.gs-modal.tour .markdown p:first-child{margin-top:0}.gs-modal.tour .markdown p:last-child{margin-bottom:0}.gs-modal .collapse{all:unset;position:absolute;right:10px;top:10px;background:none;border:none;font-size:1.1em;border-radius:2px;padding:0 .2em;cursor:pointer}.gs-modal .collapse:focus{outline:revert}.gs-modal .collapse svg{transition:transform .5s}.gs-modal .collapse:hover{background-color:#e8e8e8}.gs-modal:not(.collapsed) .content:not(:hover) .collapse{animation:move .25s .5s 3 linear}@keyframes move{0%{transform:translateY(0)}25%{transform:translateY(-2px)}75%{transform:translateY(2px)}to{transform:translateY(0)}}.gs-modal.collapsed>.content>:not(:is(.modal-title,.collapse)){display:none}.gs-modal.collapsed .modal-title{padding-bottom:10px}.gs-modal.collapsed .collapse svg{transform:rotate(180deg)}.gs-data-flow-debugger ul.gs-data-flow-hierarchy{border:1px solid #ced4da;border-radius:.25em;max-height:calc(50vh - 5em);overflow:auto;padding-inline-start:2em}.gs-data-flow-debugger ul.gs-data-flow-hierarchy ul{padding-inline-start:1em}.gs-data-flow-debugger ul.gs-data-flow-hierarchy li{list-style-type:disc}.gs-data-flow-debugger ul.gs-data-flow-hierarchy .active{background-color:#a0c0ff}.gs-data-flow-debugger pre{font-size:90%}.gs-data-flow-debugger span[tabindex]{cursor:pointer}.gs-data-flow-debugger .inline-stats{color:#aaa}.gs-data-flow-debugger .panes{height:calc(30vh - 5em);overflow:auto}.gs-data-flow-debugger .panes>div>*:first-child{margin-top:0}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { g as i } from "./_commonjsHelpers-DjF3Plf2.js";
|
2
|
+
import { r as s } from "./index-DnIkxb0L.js";
|
3
|
+
function u(t, n) {
|
4
|
+
for (var o = 0; o < n.length; o++) {
|
5
|
+
const e = n[o];
|
6
|
+
if (typeof e != "string" && !Array.isArray(e)) {
|
7
|
+
for (const r in e)
|
8
|
+
if (r !== "default" && !(r in t)) {
|
9
|
+
const f = Object.getOwnPropertyDescriptor(e, r);
|
10
|
+
f && Object.defineProperty(t, r, f.get ? f : {
|
11
|
+
enumerable: !0,
|
12
|
+
get: () => e[r]
|
13
|
+
});
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}
|
17
|
+
return Object.freeze(Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }));
|
18
|
+
}
|
19
|
+
var a = s();
|
20
|
+
const c = /* @__PURE__ */ i(a), l = /* @__PURE__ */ u({
|
21
|
+
__proto__: null,
|
22
|
+
default: c
|
23
|
+
}, [a]);
|
24
|
+
export {
|
25
|
+
a as b,
|
26
|
+
l as i
|
27
|
+
};
|
@@ -0,0 +1,539 @@
|
|
1
|
+
const h = {
|
2
|
+
// INFO fields
|
3
|
+
InfoFields: {
|
4
|
+
// from the VCF4.3 spec, https://samtools.github.io/hts-specs/VCFv4.3.pdf
|
5
|
+
AA: { Number: 1, Type: "String", Description: "Ancestral allele" },
|
6
|
+
AC: {
|
7
|
+
Number: "A",
|
8
|
+
Type: "Integer",
|
9
|
+
Description: "Allele count in genotypes, for each ALT allele, in the same order as listed"
|
10
|
+
},
|
11
|
+
AD: {
|
12
|
+
Number: "R",
|
13
|
+
Type: "Integer",
|
14
|
+
Description: "Total read depth for each allele"
|
15
|
+
},
|
16
|
+
ADF: {
|
17
|
+
Number: "R",
|
18
|
+
Type: "Integer",
|
19
|
+
Description: "Read depth for each allele on the forward strand"
|
20
|
+
},
|
21
|
+
ADR: {
|
22
|
+
Number: "R",
|
23
|
+
Type: "Integer",
|
24
|
+
Description: "Read depth for each allele on the reverse strand"
|
25
|
+
},
|
26
|
+
AF: {
|
27
|
+
Number: "A",
|
28
|
+
Type: "Float",
|
29
|
+
Description: "Allele frequency for each ALT allele in the same order as listed (estimated from primary data, not called genotypes)"
|
30
|
+
},
|
31
|
+
AN: {
|
32
|
+
Number: 1,
|
33
|
+
Type: "Integer",
|
34
|
+
Description: "Total number of alleles in called genotypes"
|
35
|
+
},
|
36
|
+
BQ: {
|
37
|
+
Number: 1,
|
38
|
+
Type: "Float",
|
39
|
+
Description: "RMS base quality"
|
40
|
+
},
|
41
|
+
CIGAR: {
|
42
|
+
Number: 1,
|
43
|
+
Type: "Float",
|
44
|
+
Description: "Cigar string describing how to align an alternate allele to the reference allele"
|
45
|
+
},
|
46
|
+
DB: {
|
47
|
+
Number: 0,
|
48
|
+
Type: "Flag",
|
49
|
+
Description: "dbSNP membership"
|
50
|
+
},
|
51
|
+
DP: {
|
52
|
+
Number: 1,
|
53
|
+
Type: "Integer",
|
54
|
+
Description: "combined depth across samples"
|
55
|
+
},
|
56
|
+
END: {
|
57
|
+
Number: 1,
|
58
|
+
Type: "Integer",
|
59
|
+
Description: "End position (for use with symbolic alleles)"
|
60
|
+
},
|
61
|
+
H2: {
|
62
|
+
Number: 0,
|
63
|
+
Type: "Flag",
|
64
|
+
Description: "HapMap2 membership"
|
65
|
+
},
|
66
|
+
H3: {
|
67
|
+
Number: 0,
|
68
|
+
Type: "Flag",
|
69
|
+
Description: "HapMap3 membership"
|
70
|
+
},
|
71
|
+
MQ: {
|
72
|
+
Number: 1,
|
73
|
+
Type: null,
|
74
|
+
Description: "RMS mapping quality"
|
75
|
+
},
|
76
|
+
MQ0: {
|
77
|
+
Number: 1,
|
78
|
+
Type: "Integer",
|
79
|
+
Description: "Number of MAPQ == 0 reads"
|
80
|
+
},
|
81
|
+
NS: {
|
82
|
+
Number: 1,
|
83
|
+
Type: "Integer",
|
84
|
+
Description: "Number of samples with data"
|
85
|
+
},
|
86
|
+
SB: {
|
87
|
+
Number: 4,
|
88
|
+
Type: "Integer",
|
89
|
+
Description: "Strand bias"
|
90
|
+
},
|
91
|
+
SOMATIC: {
|
92
|
+
Number: 0,
|
93
|
+
Type: "Flag",
|
94
|
+
Description: "Somatic mutation (for cancer genomics)"
|
95
|
+
},
|
96
|
+
VALIDATED: {
|
97
|
+
Number: 0,
|
98
|
+
Type: "Flag",
|
99
|
+
Description: "Validated by follow-up experiment"
|
100
|
+
},
|
101
|
+
"1000G": {
|
102
|
+
Number: 0,
|
103
|
+
Type: "Flag",
|
104
|
+
Description: "1000 Genomes membership"
|
105
|
+
},
|
106
|
+
// specifically for structural variants
|
107
|
+
IMPRECISE: {
|
108
|
+
Number: 0,
|
109
|
+
Type: "Flag",
|
110
|
+
Description: "Imprecise structural variation"
|
111
|
+
},
|
112
|
+
NOVEL: {
|
113
|
+
Number: 0,
|
114
|
+
Type: "Flag",
|
115
|
+
Description: "Indicates a novel structural variation"
|
116
|
+
},
|
117
|
+
// For precise variants, END is POS + length of REF allele - 1,
|
118
|
+
// and the for imprecise variants the corresponding best estimate.
|
119
|
+
SVTYPE: {
|
120
|
+
Number: 1,
|
121
|
+
Type: "String",
|
122
|
+
Description: "Type of structural variant"
|
123
|
+
},
|
124
|
+
// Value should be one of DEL, INS, DUP, INV, CNV, BND. This key can
|
125
|
+
// be derived from the REF/ALT fields but is useful for filtering.
|
126
|
+
SVLEN: {
|
127
|
+
Number: null,
|
128
|
+
Type: "Integer",
|
129
|
+
Description: "Difference in length between REF and ALT alleles"
|
130
|
+
},
|
131
|
+
// One value for each ALT allele. Longer ALT alleles (e.g. insertions)
|
132
|
+
// have positive values, shorter ALT alleles (e.g. deletions)
|
133
|
+
// have negative values.
|
134
|
+
CIPOS: {
|
135
|
+
Number: 2,
|
136
|
+
Type: "Integer",
|
137
|
+
Description: "Confidence interval around POS for imprecise variants"
|
138
|
+
},
|
139
|
+
CIEND: {
|
140
|
+
Number: 2,
|
141
|
+
Type: "Integer",
|
142
|
+
Description: "Confidence interval around END for imprecise variants"
|
143
|
+
},
|
144
|
+
HOMLEN: {
|
145
|
+
Type: "Integer",
|
146
|
+
Description: "Length of base pair identical micro-homology at event breakpoints"
|
147
|
+
},
|
148
|
+
HOMSEQ: {
|
149
|
+
Type: "String",
|
150
|
+
Description: "Sequence of base pair identical micro-homology at event breakpoints"
|
151
|
+
},
|
152
|
+
BKPTID: {
|
153
|
+
Type: "String",
|
154
|
+
Description: "ID of the assembled alternate allele in the assembly file"
|
155
|
+
},
|
156
|
+
// For precise variants, the consensus sequence the alternate allele assembly
|
157
|
+
// is derivable from the REF and ALT fields. However, the alternate allele
|
158
|
+
// assembly file may contain additional information about the characteristics
|
159
|
+
// of the alt allele contigs.
|
160
|
+
MEINFO: {
|
161
|
+
Number: 4,
|
162
|
+
Type: "String",
|
163
|
+
Description: "Mobile element info of the form NAME,START,END,POLARITY"
|
164
|
+
},
|
165
|
+
METRANS: {
|
166
|
+
Number: 4,
|
167
|
+
Type: "String",
|
168
|
+
Description: "Mobile element transduction info of the form CHR,START,END,POLARITY"
|
169
|
+
},
|
170
|
+
DGVID: {
|
171
|
+
Number: 1,
|
172
|
+
Type: "String",
|
173
|
+
Description: "ID of this element in Database of Genomic Variation"
|
174
|
+
},
|
175
|
+
DBVARID: {
|
176
|
+
Number: 1,
|
177
|
+
Type: "String",
|
178
|
+
Description: "ID of this element in DBVAR"
|
179
|
+
},
|
180
|
+
DBRIPID: {
|
181
|
+
Number: 1,
|
182
|
+
Type: "String",
|
183
|
+
Description: "ID of this element in DBRIP"
|
184
|
+
},
|
185
|
+
MATEID: {
|
186
|
+
Number: null,
|
187
|
+
Type: "String",
|
188
|
+
Description: "ID of mate breakends"
|
189
|
+
},
|
190
|
+
PARID: {
|
191
|
+
Number: 1,
|
192
|
+
Type: "String",
|
193
|
+
Description: "ID of partner breakend"
|
194
|
+
},
|
195
|
+
EVENT: {
|
196
|
+
Number: 1,
|
197
|
+
Type: "String",
|
198
|
+
Description: "ID of event associated to breakend"
|
199
|
+
},
|
200
|
+
CILEN: {
|
201
|
+
Number: 2,
|
202
|
+
Type: "Integer",
|
203
|
+
Description: "Confidence interval around the inserted material between breakend"
|
204
|
+
},
|
205
|
+
DPADJ: { Type: "Integer", Description: "Read Depth of adjacency" },
|
206
|
+
CN: {
|
207
|
+
Number: 1,
|
208
|
+
Type: "Integer",
|
209
|
+
Description: "Copy number of segment containing breakend"
|
210
|
+
},
|
211
|
+
CNADJ: {
|
212
|
+
Number: null,
|
213
|
+
Type: "Integer",
|
214
|
+
Description: "Copy number of adjacency"
|
215
|
+
},
|
216
|
+
CICN: {
|
217
|
+
Number: 2,
|
218
|
+
Type: "Integer",
|
219
|
+
Description: "Confidence interval around copy number for the segment"
|
220
|
+
},
|
221
|
+
CICNADJ: {
|
222
|
+
Number: null,
|
223
|
+
Type: "Integer",
|
224
|
+
Description: "Confidence interval around copy number for the adjacency"
|
225
|
+
}
|
226
|
+
},
|
227
|
+
// FORMAT fields
|
228
|
+
GenotypeFields: {
|
229
|
+
// from the VCF4.3 spec, https://samtools.github.io/hts-specs/VCFv4.3.pdf
|
230
|
+
AD: {
|
231
|
+
Number: "R",
|
232
|
+
Type: "Integer",
|
233
|
+
Description: "Read depth for each allele"
|
234
|
+
},
|
235
|
+
ADF: {
|
236
|
+
Number: "R",
|
237
|
+
Type: "Integer",
|
238
|
+
Description: "Read depth for each allele on the forward strand"
|
239
|
+
},
|
240
|
+
ADR: {
|
241
|
+
Number: "R",
|
242
|
+
Type: "Integer",
|
243
|
+
Description: "Read depth for each allele on the reverse strand"
|
244
|
+
},
|
245
|
+
DP: {
|
246
|
+
Number: 1,
|
247
|
+
Type: "Integer",
|
248
|
+
Description: "Read depth"
|
249
|
+
},
|
250
|
+
EC: {
|
251
|
+
Number: "A",
|
252
|
+
Type: "Integer",
|
253
|
+
Description: "Expected alternate allele counts"
|
254
|
+
},
|
255
|
+
FT: {
|
256
|
+
Number: 1,
|
257
|
+
Type: "String",
|
258
|
+
Description: 'Filter indicating if this genotype was "called"'
|
259
|
+
},
|
260
|
+
GL: {
|
261
|
+
Number: "G",
|
262
|
+
Type: "Float",
|
263
|
+
Description: "Genotype likelihoods"
|
264
|
+
},
|
265
|
+
GP: {
|
266
|
+
Number: "G",
|
267
|
+
Type: "Float",
|
268
|
+
Description: "Genotype posterior probabilities"
|
269
|
+
},
|
270
|
+
GQ: {
|
271
|
+
Number: 1,
|
272
|
+
Type: "Integer",
|
273
|
+
Description: "Conditional genotype quality"
|
274
|
+
},
|
275
|
+
GT: {
|
276
|
+
Number: 1,
|
277
|
+
Type: "String",
|
278
|
+
Description: "Genotype"
|
279
|
+
},
|
280
|
+
HQ: {
|
281
|
+
Number: 2,
|
282
|
+
Type: "Integer",
|
283
|
+
Description: "Haplotype quality"
|
284
|
+
},
|
285
|
+
MQ: {
|
286
|
+
Number: 1,
|
287
|
+
Type: "Integer",
|
288
|
+
Description: "RMS mapping quality"
|
289
|
+
},
|
290
|
+
PL: {
|
291
|
+
Number: "G",
|
292
|
+
Type: "Integer",
|
293
|
+
Description: "Phred-scaled genotype likelihoods rounded to the closest integer"
|
294
|
+
},
|
295
|
+
PQ: {
|
296
|
+
Number: 1,
|
297
|
+
Type: "Integer",
|
298
|
+
Description: "Phasing quality"
|
299
|
+
},
|
300
|
+
PS: {
|
301
|
+
Number: 1,
|
302
|
+
Type: "Integer",
|
303
|
+
Description: "Phase set"
|
304
|
+
}
|
305
|
+
},
|
306
|
+
// ALT fields
|
307
|
+
AltTypes: {
|
308
|
+
DEL: {
|
309
|
+
Description: "Deletion relative to the reference"
|
310
|
+
},
|
311
|
+
INS: {
|
312
|
+
Description: "Insertion of novel sequence relative to the reference"
|
313
|
+
},
|
314
|
+
DUP: {
|
315
|
+
Description: "Region of elevated copy number relative to the reference"
|
316
|
+
},
|
317
|
+
INV: {
|
318
|
+
Description: "Inversion of reference sequence"
|
319
|
+
},
|
320
|
+
CNV: {
|
321
|
+
Description: "Copy number variable region (may be both deletion and duplication)"
|
322
|
+
},
|
323
|
+
"DUP:TANDEM": {
|
324
|
+
Description: "Tandem duplication"
|
325
|
+
},
|
326
|
+
"DEL:ME": {
|
327
|
+
Description: "Deletion of mobile element relative to the reference"
|
328
|
+
},
|
329
|
+
"INS:ME": {
|
330
|
+
Description: "Insertion of a mobile element relative to the reference"
|
331
|
+
},
|
332
|
+
NON_REF: {
|
333
|
+
Description: "Represents any possible alternative allele at this location"
|
334
|
+
},
|
335
|
+
"*": {
|
336
|
+
Description: "Represents any possible alternative allele at this location"
|
337
|
+
}
|
338
|
+
},
|
339
|
+
// FILTER fields
|
340
|
+
FilterTypes: {
|
341
|
+
PASS: {
|
342
|
+
Description: "Passed all filters"
|
343
|
+
}
|
344
|
+
}
|
345
|
+
};
|
346
|
+
function v(b) {
|
347
|
+
try {
|
348
|
+
return decodeURIComponent(b);
|
349
|
+
} catch {
|
350
|
+
return b;
|
351
|
+
}
|
352
|
+
}
|
353
|
+
class M {
|
354
|
+
constructor({ header: a = "", strict: r = !0 }) {
|
355
|
+
if (!a.length)
|
356
|
+
throw new Error("empty header received");
|
357
|
+
const n = a.split(/[\r\n]+/).filter((o) => o);
|
358
|
+
if (!n.length)
|
359
|
+
throw new Error("no non-empty header lines specified");
|
360
|
+
this.strict = r, this.metadata = JSON.parse(JSON.stringify({
|
361
|
+
INFO: h.InfoFields,
|
362
|
+
FORMAT: h.GenotypeFields,
|
363
|
+
ALT: h.AltTypes,
|
364
|
+
FILTER: h.FilterTypes
|
365
|
+
}));
|
366
|
+
let e;
|
367
|
+
if (n.forEach((o) => {
|
368
|
+
if (o.startsWith("#"))
|
369
|
+
o.startsWith("##") ? this.parseMetadata(o) : e = o;
|
370
|
+
else throw new Error(`Bad line in header:
|
371
|
+
${o}`);
|
372
|
+
}), !e)
|
373
|
+
throw new Error("No format line found in header");
|
374
|
+
const t = e.trim().split(" "), s = t.slice(0, 8), i = [
|
375
|
+
"#CHROM",
|
376
|
+
"POS",
|
377
|
+
"ID",
|
378
|
+
"REF",
|
379
|
+
"ALT",
|
380
|
+
"QUAL",
|
381
|
+
"FILTER",
|
382
|
+
"INFO"
|
383
|
+
];
|
384
|
+
if (t.length < 8)
|
385
|
+
throw new Error(`VCF header missing columns:
|
386
|
+
${e}`);
|
387
|
+
if (s.length !== i.length || !s.every((o, p) => o === i[p]))
|
388
|
+
throw new Error(`VCF column headers not correct:
|
389
|
+
${e}`);
|
390
|
+
this.samples = t.slice(9);
|
391
|
+
}
|
392
|
+
parseSamples(a, r) {
|
393
|
+
const n = {};
|
394
|
+
if (a) {
|
395
|
+
const e = r.split(" "), t = a.split(":"), s = t.map((i) => {
|
396
|
+
const o = this.getMetadata("FORMAT", i, "Type");
|
397
|
+
return o === "Integer" || o === "Float";
|
398
|
+
});
|
399
|
+
for (let i = 0; i < this.samples.length; i++) {
|
400
|
+
const o = this.samples[i];
|
401
|
+
n[o] = {};
|
402
|
+
const p = e[i].split(":");
|
403
|
+
for (let c = 0; c < p.length; c++) {
|
404
|
+
const m = p[c];
|
405
|
+
n[o][t[c]] = m === "" || m === "." ? void 0 : m.split(",").map((u) => u === "." ? void 0 : s[c] ? +u : u);
|
406
|
+
}
|
407
|
+
}
|
408
|
+
}
|
409
|
+
return n;
|
410
|
+
}
|
411
|
+
parseGenotypesOnly(a, r) {
|
412
|
+
const n = r.split(" "), e = {};
|
413
|
+
let t = 0;
|
414
|
+
const s = a.split(":");
|
415
|
+
if (s.length === 1)
|
416
|
+
for (const i of this.samples)
|
417
|
+
e[i] = n[t++];
|
418
|
+
else {
|
419
|
+
const i = s.findIndex((o) => o === "GT");
|
420
|
+
if (i === 0)
|
421
|
+
for (const o of this.samples) {
|
422
|
+
const p = n[t++], c = p.indexOf(":");
|
423
|
+
c !== -1 ? e[o] = p.slice(0, c) : console.warn("unknown");
|
424
|
+
}
|
425
|
+
else
|
426
|
+
for (const o of this.samples) {
|
427
|
+
const p = n[t++].split(":");
|
428
|
+
e[o] = p[i];
|
429
|
+
}
|
430
|
+
}
|
431
|
+
return e;
|
432
|
+
}
|
433
|
+
/**
|
434
|
+
* Parse a VCF metadata line (i.e. a line that starts with "##") and add its
|
435
|
+
* properties to the object.
|
436
|
+
*
|
437
|
+
* @param {string} line - A line from the VCF. Supports both LF and CRLF
|
438
|
+
* newlines.
|
439
|
+
*/
|
440
|
+
parseMetadata(a) {
|
441
|
+
const r = /^##(.+?)=(.*)/.exec(a.trim());
|
442
|
+
if (!r)
|
443
|
+
throw new Error(`Line is not a valid metadata line: ${a}`);
|
444
|
+
const [n, e] = r.slice(1, 3), t = n;
|
445
|
+
if (e != null && e.startsWith("<")) {
|
446
|
+
t in this.metadata || (this.metadata[t] = {});
|
447
|
+
const [s, i] = this.parseStructuredMetaVal(e);
|
448
|
+
this.metadata[t][s] = i;
|
449
|
+
} else
|
450
|
+
this.metadata[t] = e;
|
451
|
+
}
|
452
|
+
/**
|
453
|
+
* Parse a VCF header structured meta string (i.e. a meta value that starts
|
454
|
+
* with "<ID=...")
|
455
|
+
*
|
456
|
+
* @param {string} metaVal - The VCF metadata value
|
457
|
+
*
|
458
|
+
* @returns {Array} - Array with two entries, 1) a string of the metadata ID
|
459
|
+
* and 2) an object with the other key-value pairs in the metadata
|
460
|
+
*/
|
461
|
+
parseStructuredMetaVal(a) {
|
462
|
+
const r = this.parseKeyValue(a.replace(/^<|>$/g, ""), ","), n = r.ID;
|
463
|
+
return delete r.ID, "Number" in r && (Number.isNaN(Number(r.Number)) || (r.Number = Number(r.Number))), [n, r];
|
464
|
+
}
|
465
|
+
/**
|
466
|
+
* Get metadata filtered by the elements in args. For example, can pass
|
467
|
+
* ('INFO', 'DP') to only get info on an metadata tag that was like
|
468
|
+
* "##INFO=<ID=DP,...>"
|
469
|
+
*
|
470
|
+
* @param {...string} args - List of metadata filter strings.
|
471
|
+
*
|
472
|
+
* @returns {any} An object, string, or number, depending on the filtering
|
473
|
+
*/
|
474
|
+
getMetadata(...a) {
|
475
|
+
let r = this.metadata;
|
476
|
+
for (const n of a)
|
477
|
+
if (r = r[n], !r)
|
478
|
+
return r;
|
479
|
+
return r;
|
480
|
+
}
|
481
|
+
/**
|
482
|
+
* Sometimes VCFs have key-value strings that allow the separator within the
|
483
|
+
* value if it's in quotes, like:
|
484
|
+
* 'ID=DB,Number=0,Type=Flag,Description="dbSNP membership, build 129"'
|
485
|
+
*
|
486
|
+
* Parse this at a low level since we can't just split at "," (or whatever
|
487
|
+
* separator). Above line would be parsed to: {ID: 'DB', Number: '0', Type:
|
488
|
+
* 'Flag', Description: 'dbSNP membership, build 129'}
|
489
|
+
*/
|
490
|
+
parseKeyValue(a, r = ";") {
|
491
|
+
const n = {};
|
492
|
+
let e = "", t = "", s = 1;
|
493
|
+
for (const i of a)
|
494
|
+
s === 1 ? i === "=" ? s = 2 : i !== r ? e += i : t === "" && (n[e] = void 0, e = "") : s === 2 ? i === r ? (n[e] = t, e = "", t = "", s = 1) : i === '"' ? s = 3 : t += i : s === 3 && (i !== '"' ? t += i : s = 2);
|
495
|
+
return s === 2 || s === 3 ? n[e] = t : s === 1 && (n[e] = void 0), n;
|
496
|
+
}
|
497
|
+
/**
|
498
|
+
* Parse a VCF line into an object like { CHROM POS ID REF ALT QUAL FILTER
|
499
|
+
* INFO } with SAMPLES optionally included if present in the VCF
|
500
|
+
*
|
501
|
+
* @param {string} line - A string of a line from a VCF. Supports both LF and
|
502
|
+
* CRLF newlines.
|
503
|
+
*/
|
504
|
+
parseLine(a) {
|
505
|
+
var r, n;
|
506
|
+
let e = 0;
|
507
|
+
for (let l = 0; e < a.length && (a[e] === " " && (l += 1), l !== 9); e += 1)
|
508
|
+
;
|
509
|
+
const t = a.slice(0, e).split(" "), s = a.slice(e + 1), [i, o, p, c, m, u, T] = t, g = i, I = +o, A = p === "." ? void 0 : p.split(";"), S = c, R = m === "." ? void 0 : m.split(","), E = u === "." ? void 0 : +u, y = T === "." ? void 0 : T.split(";");
|
510
|
+
if (this.strict && !t[7])
|
511
|
+
throw new Error("no INFO field specified, must contain at least a '.' (turn off strict mode to allow)");
|
512
|
+
const F = (r = t[7]) === null || r === void 0 ? void 0 : r.includes("%"), f = t[7] === void 0 || t[7] === "." ? {} : this.parseKeyValue(t[7]);
|
513
|
+
for (const l of Object.keys(f)) {
|
514
|
+
const D = (n = f[l]) === null || n === void 0 ? void 0 : n.split(",").map((d) => d === "." ? void 0 : d).map((d) => d && F ? v(d) : d), N = this.getMetadata("INFO", l, "Type");
|
515
|
+
N === "Integer" || N === "Float" ? f[l] = D == null ? void 0 : D.map((d) => d === void 0 ? void 0 : Number(d)) : N === "Flag" ? f[l] = !0 : f[l] = D;
|
516
|
+
}
|
517
|
+
return {
|
518
|
+
CHROM: g,
|
519
|
+
POS: I,
|
520
|
+
ALT: R,
|
521
|
+
INFO: f,
|
522
|
+
REF: S,
|
523
|
+
FILTER: y && y.length === 1 && y[0] === "PASS" ? "PASS" : y,
|
524
|
+
ID: A,
|
525
|
+
QUAL: E,
|
526
|
+
SAMPLES: () => {
|
527
|
+
var l;
|
528
|
+
return this.parseSamples((l = t[8]) !== null && l !== void 0 ? l : "", s);
|
529
|
+
},
|
530
|
+
GENOTYPES: () => {
|
531
|
+
var l;
|
532
|
+
return this.parseGenotypesOnly((l = t[8]) !== null && l !== void 0 ? l : "", s);
|
533
|
+
}
|
534
|
+
};
|
535
|
+
}
|
536
|
+
}
|
537
|
+
export {
|
538
|
+
M as default
|
539
|
+
};
|