"use strict";(self.webpackChunkbio=self.webpackChunkbio||[]).push([[288],{9288(n,t,e){e.d(t,{extractAnnotatedRegion:()=>r,filterByLiabilityHits:()=>a});var o=e(4328),i=e(6082),l=e(4517),s=e(3736);function a(n,t){const e=(0,s.VT)(t.name);let l=null;try{l=n.columns.byName(e)}catch{}if(!l)return void o.shell.warning("No annotation data found. Run liability scanning first.");const a=(0,s.wi)(l),r=i.BitSet.create(n.rowCount);for(let t=0;t<n.rowCount;t++)a[t]&&a[t].length>0&&r.set(t,!0);n.filter.copyFrom(r),o.shell.info(`Filtered to ${r.trueCount} rows with liability hits`)}function r(n,t,e,a){const r=(0,s.Ln)(t).find(n=>n.name===e&&n.category===l.eI.Structure);if(!r)return o.shell.warning(`Region annotation "${e}" not found.`),null;const u=a.getSeqHandler(t),d=`${t.name}(${e})`,c=(0,s.VT)(t.name);let f=null;try{f=n.columns.byName(c)}catch{}if(f){const t=(0,s.wi)(f);if(t.some(n=>n?.some(n=>n.annotationId===r.id&&null!=n.endPositionIndex))){const l=i.Column.fromType(i.COLUMN_TYPE.STRING,d,n.rowCount);for(let e=0;e<n.rowCount;e++){const n=t[e],o=n?.find(n=>n.annotationId===r.id&&null!=n.endPositionIndex);if(o){const n=u.getSplitted(e),t=[];for(let e=o.positionIndex;e<=o.endPositionIndex;e++)e<n.length&&t.push(n.getOriginal(e));l.set(e,t.join(u.separator||""))}else l.set(e,"")}return n.columns.add(l),o.data.detectSemanticTypes(n),o.shell.info(`Extracted region ${e} as column "${d}"`),l}}if(null==r.start||null==r.end)return o.shell.warning(`Region annotation "${e}" has no position range.`),null;const g=u.posList.indexOf(r.start),m=u.posList.indexOf(r.end);if(g<0||m<0)return o.shell.warning(`Position names "${r.start}" or "${r.end}" not found in position list.`),null;const h=u.getRegion(g,m,d);return n.columns.add(h),o.data.detectSemanticTypes(n),o.shell.info(`Extracted region ${e} as column "${d}"`),h}}}]);
//# sourceMappingURL=288.js.map