(this["webpackJsonp@jbrowse/web"]=this["webpackJsonp@jbrowse/web"]||[]).push([[52],{2438:function(e,a,t){"use strict";t.r(a);var l=t(83),n=t(1),r=t.n(n),i=t(85),o=t(51),c=t(2373),u=t(2396),d=t(2399),s=t(2368),m=t(2400),p=t(2364),g=t(2415),v=t(2358),f=t(2363),h=t(131),E=t.n(h),b=Object(o.a)((function(e){return{root:{width:500},paper:{padding:e.spacing(2),margin:e.spacing(2)},closeButton:{position:"absolute",right:e.spacing(1),top:e.spacing(1),color:e.palette.grey[500]},field:{margin:e.spacing(2)}}})),y=["read paired","read mapped in proper pair","read unmapped","mate unmapped","read reverse strand","mate reverse strand","first in pair","second in pair","not primary alignment","read fails platform/vendor quality checks","read is PCR or optical duplicate","supplementary alignment"];function j(e){var a=e.flag,t=void 0===a?0:a,l=e.setFlag;return r.a.createElement(r.a.Fragment,null,r.a.createElement(c.a,{type:"number",value:t,onChange:function(e){return l(+e.target.value)}}),y.map((function(e,a){var n=t&1<<a,i="".concat(e,"_").concat(n);return r.a.createElement("div",{key:i},r.a.createElement("input",{type:"checkbox",checked:Boolean(n),onChange:function(e){e.target.checked?l(t|1<<a):l(t&~(1<<a))}}),r.a.createElement("label",{htmlFor:i},e))})))}a.default=Object(i.observer)((function(e){var a,t,i=e.model,o=e.handleClose,h=b(),y=i.filterBy,O=Object(n.useState)(null===y||void 0===y?void 0:y.flagInclude),N=Object(l.a)(O,2),F=N[0],k=N[1],C=Object(n.useState)(null===y||void 0===y?void 0:y.flagExclude),x=Object(l.a)(C,2),w=x[0],S=x[1],B=Object(n.useState)((null===y||void 0===y||null===(a=y.tagFilter)||void 0===a?void 0:a.tag)||""),P=Object(l.a)(B,2),R=P[0],A=P[1],L=Object(n.useState)((null===y||void 0===y||null===(t=y.tagFilter)||void 0===t?void 0:t.value)||""),z=Object(l.a)(L,2),I=z[0],J=z[1],Z=Object(n.useState)((null===y||void 0===y?void 0:y.readName)||""),q=Object(l.a)(Z,2),G=q[0],H=q[1],T=R.match(/^[A-Za-z][A-Za-z0-9]$/),U="https://broadinstitute.github.io/picard/explain-flags.html";return r.a.createElement(u.a,{open:!0,onClose:o},r.a.createElement(d.a,null,"Filter options",r.a.createElement(s.a,{"aria-label":"close",className:h.closeButton,onClick:o},r.a.createElement(E.a,null))),r.a.createElement(m.a,null,r.a.createElement(p.a,null,"Set filter bitmask options. Refer to ",r.a.createElement(g.a,{href:U},U)," ","for details"),r.a.createElement("div",{className:h.root},r.a.createElement(v.a,{className:h.paper,variant:"outlined"},r.a.createElement("div",{style:{display:"flex"}},r.a.createElement("div",null,r.a.createElement(p.a,null,"Read must have ALL these flags"),r.a.createElement(j,{flag:F,setFlag:k})),r.a.createElement("div",null,r.a.createElement(p.a,null,"Read must have NONE of these flags"),r.a.createElement(j,{flag:w,setFlag:S})))),r.a.createElement(v.a,{className:h.paper,variant:"outlined"},r.a.createElement(p.a,null,"Filter by tag name and value. Use * in the value field to get all reads containing any value for that tag. Example: filter tag name SA with value * to get all split/supplementary reads. Other examples include HP for haplotype, or RG for read group"),r.a.createElement(c.a,{className:h.field,value:R,onChange:function(e){A(e.target.value)},placeholder:"Enter tag name",inputProps:{maxLength:2,"data-testid":"color-tag-name-input"},error:2===R.length&&!T,helperText:2!==R.length||T?"":"Not a valid tag","data-testid":"color-tag-name"}),r.a.createElement(c.a,{className:h.field,value:I,onChange:function(e){J(e.target.value)},placeholder:"Enter tag value",inputProps:{"data-testid":"color-tag-name-input"},"data-testid":"color-tag-value"})),r.a.createElement(v.a,{className:h.paper,variant:"outlined"},r.a.createElement(p.a,null,"Filter by read name"),r.a.createElement(c.a,{className:h.field,value:G,onChange:function(e){H(e.target.value)},placeholder:"Enter read name",inputProps:{"data-testid":"color-tag-readname-input"},"data-testid":"color-tag-readname"})),r.a.createElement(f.a,{variant:"contained",color:"primary",onClick:function(){i.setFilterBy({flagInclude:F,flagExclude:w,readName:G,tagFilter:""!==R?{tag:R,value:I}:void 0}),o()}},"Submit"))))}))}}]);
//# sourceMappingURL=52.59a29e85.chunk.js.map