"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[354],{70354:function(e,a,t){t.r(a);var l=t(96234),n=t(30969),r=t(90550),i=t(22714),s=t(7690),o=t(83483),d=t(64501),c=t(32343),u=t(93138),p=t(80975),g=t(24940),h=t(51526),v=t(53033),m=t(28599),f=t(14008),x=t(37574),j=(0,i.Z)((function(e){return{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)}}})),Z=["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 b(e){var a=e.flag,t=void 0===a?0:a,l=e.setFlag;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(s.Z,{type:"number",value:t,onChange:function(e){return l(+e.target.value)}}),Z.map((function(e,a){var n=t&1<<a,r="".concat(e,"_").concat(n);return(0,x.jsxs)("div",{children:[(0,x.jsx)("input",{type:"checkbox",checked:Boolean(n),onChange:function(e){e.target.checked?l(t|1<<a):l(t&~(1<<a))}}),(0,x.jsx)("label",{htmlFor:r,children:e})]},r)}))]})}a.default=(0,r.observer)((function(e){var a,t,r=e.model,i=e.handleClose,Z=j(),y=r.filterBy,C=(0,n.useState)(null===y||void 0===y?void 0:y.flagInclude),F=(0,l.Z)(C,2),k=F[0],N=F[1],S=(0,n.useState)(null===y||void 0===y?void 0:y.flagExclude),w=(0,l.Z)(S,2),E=w[0],B=w[1],P=(0,n.useState)((null===y||void 0===y||null===(a=y.tagFilter)||void 0===a?void 0:a.tag)||""),R=(0,l.Z)(P,2),_=R[0],A=R[1],L=(0,n.useState)((null===y||void 0===y||null===(t=y.tagFilter)||void 0===t?void 0:t.value)||""),z=(0,l.Z)(L,2),I=z[0],O=z[1],q=(0,n.useState)((null===y||void 0===y?void 0:y.readName)||""),G=(0,l.Z)(q,2),H=G[0],T=G[1],U=_.match(/^[A-Za-z][A-Za-z0-9]$/),$="https://broadinstitute.github.io/picard/explain-flags.html";return(0,x.jsxs)(o.Z,{open:!0,onClose:i,children:[(0,x.jsxs)(d.Z,{children:["Filter options",(0,x.jsx)(c.Z,{"aria-label":"close",className:Z.closeButton,onClick:i,children:(0,x.jsx)(f.Z,{})})]}),(0,x.jsxs)(u.Z,{children:[(0,x.jsxs)(p.Z,{children:["Set filter bitmask options. Refer to ",(0,x.jsx)(g.Z,{href:$,children:$})," ","for details"]}),(0,x.jsx)(h.Z,{className:Z.paper,variant:"outlined",children:(0,x.jsxs)("div",{style:{display:"flex"},children:[(0,x.jsxs)("div",{children:[(0,x.jsx)(p.Z,{children:"Read must have ALL these flags"}),(0,x.jsx)(b,{flag:k,setFlag:N})]}),(0,x.jsxs)("div",{children:[(0,x.jsx)(p.Z,{children:"Read must have NONE of these flags"}),(0,x.jsx)(b,{flag:E,setFlag:B})]})]})}),(0,x.jsxs)(h.Z,{className:Z.paper,variant:"outlined",children:[(0,x.jsx)(p.Z,{children:"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"}),(0,x.jsx)(s.Z,{className:Z.field,value:_,onChange:function(e){A(e.target.value)},placeholder:"Enter tag name",inputProps:{maxLength:2,"data-testid":"color-tag-name-input"},error:2===_.length&&!U,helperText:2!==_.length||U?"":"Not a valid tag","data-testid":"color-tag-name"}),(0,x.jsx)(s.Z,{className:Z.field,value:I,onChange:function(e){O(e.target.value)},placeholder:"Enter tag value",inputProps:{"data-testid":"color-tag-name-input"},"data-testid":"color-tag-value"})]}),(0,x.jsxs)(h.Z,{className:Z.paper,variant:"outlined",children:[(0,x.jsx)(p.Z,{children:"Filter by read name"}),(0,x.jsx)(s.Z,{className:Z.field,value:H,onChange:function(e){T(e.target.value)},placeholder:"Enter read name",inputProps:{"data-testid":"color-tag-readname-input"},"data-testid":"color-tag-readname"})]}),(0,x.jsxs)(v.Z,{children:[(0,x.jsx)(m.Z,{variant:"contained",color:"primary",autoFocus:!0,type:"submit",onClick:function(){r.setFilterBy({flagInclude:k,flagExclude:E,readName:H,tagFilter:""!==_?{tag:_,value:I}:void 0}),i()},children:"Submit"}),(0,x.jsx)(m.Z,{variant:"contained",color:"secondary",onClick:function(){return i()},children:"Cancel"})]})]})]})}))}}]);
//# sourceMappingURL=354.282bda17.chunk.js.map