view x/static/js/8109.344e1845.chunk.js.map @ 125:49f3d3878413 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 5ea1f9c1eef1de76232e69aa6d34cda77d90d566
author fubar
date Sat, 05 Oct 2024 23:58:05 +0000
parents
children
line wrap: on
line source

{"version":3,"file":"static/js/8109.344e1845.chunk.js","mappings":"kfAsBA,SAASA,GAAc,QACrBC,EAAO,OACPC,EAAM,UACNC,IAMA,OACEC,EAAAA,cAAAA,EAAAA,SAAA,KACEA,EAAAA,cAACC,EAAAA,EAAU,KAAC,kQAMXJ,EAAQK,KAAI,EAAGC,WACdH,EAAAA,cAACI,EAAAA,EAAS,CACRC,IAAK,UAAUF,IACfG,YAAa,UAAUH,IACvBI,MAAOT,EAAOK,IAAU,GACxBK,SAAUC,IACRV,EAAU,IAAKD,EAAQ,CAACK,GAAQM,EAAMC,OAAOH,OAAQ,MAMjE,CAEe,SAASI,EAAeC,GAIrC,MAAM,QAAEC,EAAO,aAAEC,EAAe,CAAC,GAAMF,GAChCd,EAAQC,IAAagB,EAAAA,EAAAA,UAAkB,CAAC,GACzCC,EAAWH,EAAQG,SAAW,CAAC,EAC/BC,EAAkBC,OAAOC,QAAQH,GAEvC,IAAII,EACAC,EAAO,GACX,MAAMC,EAAUJ,OAAOK,KAAKzB,GAK5B,IACEuB,EAAOJ,EACJf,KAAIsB,IACI,IACFN,OAAOO,YACRP,OAAOC,QAAQK,EAAI,IAAItB,KAAIwB,GAAK,CAACA,EAAE,GAAI,GAAGA,EAAE,SAE9CC,OAAQH,EAAI,GACZI,GAAIJ,EAAI,OAGX1B,QAAO0B,IACNF,EAAQO,QACJP,EAAQQ,OAAMzB,IACZ,MAAM0B,EAAajC,EAAOO,GAC1B,OAAO0B,GACH,IAAIC,OAAOD,EAAY,KAAKE,KAAKT,EAAInB,GACjC,KAIpB,CAAE,MAAOqB,GACPN,EAAQM,CACV,CAEA,MAAMH,EAAO,CAAC,YAAaL,OAAOK,KAAKN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B,CAClBtE,QAASuF,EACTF,MAAOA,EACPY,WAAY,CAAC,GAAGV,EAAKgB,KAAKC,WAAWjB,EAAKgB,KAAKE,WAE/C,KACHd,EAAKe,SAAS,cACff,EAAKe,SAAS,aACdf,EAAKe,SAAS,gBACdf,EAAKe,SAAS,QACdf,EAAKe,SAAS,MACZvH,EAAAA,cAACmF,EAAmB,CAClBtE,QAAS,CACP2G,SAAU,SACVH,QAASjB,EAAKiB,QACdC,MAAOlB,EAAKkB,MACZG,IAAKrB,EAAKkB,MAAQ,EAClBF,KAAM,CACJC,QAASjB,EAAKiB,QACdC,MAAOlB,EAAKqB,IACZA,IAAKrB,EAAKqB,IAAM,IAGpBvB,MAAOA,EACPY,WAAY,CAAC,GAAGV,EAAKiB,WAAWjB,EAAKqB,SAErC,MAENzH,EAAAA,cAAC0H,EAAiB7E,EAAA,CAChBhC,QAASuF,GACLxF,EAAK,CACTE,aAAcA,KAItB,G","sources":["../../../plugins/variants/src/VariantFeatureWidget/VariantSampleGrid.tsx","../../../plugins/variants/src/VariantFeatureWidget/AnnotGrid.tsx","../../../plugins/variants/src/VariantFeatureWidget/VariantAnnotationTable.tsx","../../../plugins/variants/src/VariantFeatureWidget/variantFieldDescriptions.ts","../../../plugins/variants/src/VariantFeatureWidget/VariantFeatureWidget.tsx"],"sourcesContent":["import React, { useState } from 'react'\n\nimport {\n  FormControlLabel,\n  Checkbox,\n  TextField,\n  Typography,\n} from '@mui/material'\n\nimport { DataGrid, GridToolbar } from '@mui/x-data-grid'\nimport { BaseCard } from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail'\nimport { measureGridWidth, SimpleFeatureSerialized } from '@jbrowse/core/util'\n\ninterface Entry {\n  sample: string\n  id: string\n  [key: string]: string\n}\n\ntype InfoFields = Record<string, unknown>\ntype Filters = Record<string, string>\n\nfunction SampleFilters({\n  columns,\n  filter,\n  setFilter,\n}: {\n  columns: { field: string }[]\n  filter: Filters\n  setFilter: (arg: Filters) => void\n}) {\n  return (\n    <>\n      <Typography>\n        These filters can use a plain text search or regex style query, e.g. in\n        the genotype field, entering 1 will query for all genotypes that include\n        the first alternate allele e.g. 0|1 or 1|1, entering [1-9]\\d* will find\n        any non-zero allele e.g. 0|2 or 2/33\n      </Typography>\n      {columns.map(({ field }) => (\n        <TextField\n          key={`filter-${field}`}\n          placeholder={`Filter ${field}`}\n          value={filter[field] || ''}\n          onChange={event => {\n            setFilter({ ...filter, [field]: event.target.value })\n          }}\n        />\n      ))}\n    </>\n  )\n}\n\nexport default function VariantSamples(props: {\n  feature: SimpleFeatureSerialized\n  descriptions?: { FORMAT?: Record<string, { Description?: string }> } | null\n}) {\n  const { feature, descriptions = {} } = props\n  const [filter, setFilter] = useState<Filters>({})\n  const samples = (feature.samples || {}) as Record<string, InfoFields>\n  const preFilteredRows = Object.entries(samples)\n\n  let error: unknown\n  let rows = [] as Entry[]\n  const filters = Object.keys(filter)\n\n  // catch some error thrown from regex\n  // note: maps all values into a string, if this is not done rows are not\n  // sortable by the data-grid\n  try {\n    rows = preFilteredRows\n      .map(row => {\n        return {\n          ...Object.fromEntries(\n            Object.entries(row[1]).map(e => [e[0], `${e[1]}`]),\n          ),\n          sample: row[0],\n          id: row[0],\n        } as Entry\n      })\n      .filter(row =>\n        filters.length\n          ? filters.every(key => {\n              const currFilter = filter[key]\n              return currFilter\n                ? new RegExp(currFilter, 'i').exec(row[key]!)\n                : true\n            })\n          : true,\n      )\n  } catch (e) {\n    error = e\n  }\n\n  const keys = ['sample', ...Object.keys(preFilteredRows[0]?.[1] || {})]\n  const [checked, setChecked] = useState(false)\n  const widths = keys.map(e => measureGridWidth(rows.map(r => r[e])))\n  const columns = keys.map((field, index) => ({\n    field,\n    description: descriptions?.FORMAT?.[field]?.Description,\n    width: widths[index],\n  }))\n\n  // disableRowSelectionOnClick helps avoid\n  // https://github.com/mui-org/material-ui-x/issues/1197\n  return !preFilteredRows.length ? null : (\n    <BaseCard {...props} title=\"Samples\">\n      {error ? <Typography color=\"error\">{`${error}`}</Typography> : null}\n      <FormControlLabel\n        control={\n          <Checkbox\n            checked={checked}\n            onChange={event => {\n              setChecked(event.target.checked)\n            }}\n          />\n        }\n        label={<Typography variant=\"body2\">Show options</Typography>}\n      />\n      {checked ? (\n        <SampleFilters\n          setFilter={setFilter}\n          columns={columns}\n          filter={filter}\n        />\n      ) : null}\n\n      <DataGrid\n        autoHeight\n        rows={rows}\n        hideFooter={rows.length < 100}\n        columns={columns}\n        disableRowSelectionOnClick\n        rowHeight={25}\n        columnHeaderHeight={35}\n        disableColumnMenu\n        slots={{ toolbar: checked ? GridToolbar : null }}\n        slotProps={{\n          toolbar: {\n            printOptions: {\n              disableToolbarButton: true,\n            },\n          },\n        }}\n      />\n    </BaseCard>\n  )\n}\n","import React, { useState } from 'react'\nimport {\n  DataGrid,\n  GridColDef,\n  GridToolbar,\n  GridValidRowModel,\n} from '@mui/x-data-grid'\nimport { Checkbox, FormControlLabel, Typography } from '@mui/material'\nimport { measureGridWidth } from '@jbrowse/core/util'\n\nexport default function VariantAnnotPanel({\n  rows,\n  columns,\n}: {\n  rows: GridValidRowModel[]\n  columns: GridColDef[]\n}) {\n  const [checked, setChecked] = useState(false)\n  const widths = columns.map(e => measureGridWidth(rows.map(r => r[e.field])))\n\n  return rows.length ? (\n    <div>\n      <FormControlLabel\n        control={\n          <Checkbox\n            checked={checked}\n            onChange={event => {\n              setChecked(event.target.checked)\n            }}\n          />\n        }\n        label={<Typography variant=\"body2\">Show options</Typography>}\n      />\n\n      <DataGrid\n        rowHeight={25}\n        rows={rows}\n        columns={columns.map((c, i) => ({ ...c, width: widths[i] }))}\n        slots={{ toolbar: checked ? GridToolbar : null }}\n      />\n    </div>\n  ) : null\n}\n","import React from 'react'\nimport { BaseCard } from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail'\nimport AnnotGrid from './AnnotGrid'\n\nexport default function VariantAnnotationTable({\n  data,\n  fields,\n  title,\n}: {\n  data: string[]\n  fields: string[]\n  title: string\n}) {\n  return data.length ? (\n    <BaseCard title={title}>\n      <AnnotGrid\n        rows={data.map((elt, id) => ({\n          id,\n          ...Object.fromEntries(elt.split('|').map((e, i) => [fields[i], e])),\n        }))}\n        columns={fields.map(c => ({ field: c }))}\n      />\n    </BaseCard>\n  ) : null\n}\n","export const variantFieldDescriptions = {\n  CHROM: 'chromosome: An identifier from the reference genome',\n  POS: 'position: The reference position, with the 1st base having position 1',\n  ID: 'identifier: Semi-colon separated list of unique identifiers where available',\n  REF: 'reference base(s): Each base must be one of A,C,G,T,N (case insensitive).',\n  ALT: 'alternate base(s): Comma-separated list of alternate non-reference alleles',\n  QUAL: 'quality: Phred-scaled quality score for the assertion made in ALT',\n  FILTER:\n    'filter status: PASS if this position has passed all filters, otherwise a semicolon-separated list of codes for filters that fail',\n}\n","import React, { lazy, Suspense } from 'react'\nimport { observer } from 'mobx-react'\nimport { Paper } from '@mui/material'\nimport { FeatureDetails } from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail'\nimport { parseBreakend } from '@gmod/vcf'\n\n// locals\nimport VariantSampleGrid from './VariantSampleGrid'\nimport VariantAnnotationTable from './VariantAnnotationTable'\nimport { VariantFeatureWidgetModel } from './stateModelFactory'\nimport { variantFieldDescriptions } from './variantFieldDescriptions'\n\n// lazies\nconst LaunchBreakendPanel = lazy(() => import('./LaunchBreakendPanel'))\n\nfunction AnnPanel({\n  descriptions,\n  feature,\n}: {\n  descriptions?: {\n    INFO?: {\n      ANN?: {\n        Description?: string\n      }\n    }\n  }\n  feature: {\n    INFO?: {\n      ANN?: string[]\n    }\n  }\n}) {\n  const annDesc = descriptions?.INFO?.ANN?.Description\n  const annFields =\n    annDesc?.match(/.*Functional annotations:'(.*)'$/)?.[1]?.split('|') || []\n  const ann = feature.INFO?.ANN || []\n  return (\n    <VariantAnnotationTable\n      fields={annFields}\n      data={ann}\n      title=\"Variant ANN field\"\n    />\n  )\n}\n\nfunction CsqPanel({\n  descriptions,\n  feature,\n}: {\n  descriptions?: { INFO?: { CSQ?: { Description?: string } } }\n  feature: { INFO?: { CSQ?: string[] } }\n}) {\n  const csqDescription = descriptions?.INFO?.CSQ?.Description\n  const csqFields =\n    csqDescription?.match(/.*Format: (.*)/)?.[1]?.split('|') || []\n  const csq = feature.INFO?.CSQ || []\n  return (\n    <VariantAnnotationTable\n      fields={csqFields}\n      data={csq}\n      title=\"Variant CSQ field\"\n    />\n  )\n}\n\nconst VariantFeatureWidget = observer(function (props: {\n  model: VariantFeatureWidgetModel\n}) {\n  const { model } = props\n  const { featureData, descriptions } = model\n  const feat = JSON.parse(JSON.stringify(featureData))\n  const { samples, ALT, type = '', ...rest } = feat\n\n  return (\n    <Paper data-testid=\"variant-side-drawer\">\n      <FeatureDetails\n        feature={rest}\n        descriptions={{ ...variantFieldDescriptions, ...descriptions }}\n        {...props}\n      />\n      <CsqPanel feature={rest} descriptions={descriptions} />\n      <AnnPanel feature={rest} descriptions={descriptions} />\n      <Suspense fallback={null}>\n        {type === 'breakend' ? (\n          <LaunchBreakendPanel\n            feature={feat}\n            locStrings={feat.ALT.map(\n              (alt: string) => parseBreakend(alt)?.MatePosition || '',\n            )}\n            model={model}\n          />\n        ) : null}\n        {type === 'translocation' ? (\n          <LaunchBreakendPanel\n            feature={feat}\n            model={model}\n            locStrings={[`${feat.INFO.CHR2[0]}:${feat.INFO.END}`]}\n          />\n        ) : null}\n        {type === 'paired_feature' ? (\n          <LaunchBreakendPanel\n            feature={feat}\n            model={model}\n            locStrings={[`${feat.mate.refName}:${feat.mate.start}`]}\n          />\n        ) : null}\n        {type.includes('inversion') ||\n        type.includes('deletion') ||\n        type.includes('duplication') ||\n        type.includes('cnv') ||\n        type.includes('sv') ? (\n          <LaunchBreakendPanel\n            feature={{\n              uniqueId: 'random',\n              refName: feat.refName,\n              start: feat.start,\n              end: feat.start + 1,\n              mate: {\n                refName: feat.refName,\n                start: feat.end,\n                end: feat.end + 1,\n              },\n            }}\n            model={model}\n            locStrings={[`${feat.refName}:${feat.end}`]}\n          />\n        ) : null}\n      </Suspense>\n      <VariantSampleGrid\n        feature={feat}\n        {...props}\n        descriptions={descriptions}\n      />\n    </Paper>\n  )\n})\n\nexport default VariantFeatureWidget\n"],"names":["SampleFilters","columns","filter","setFilter","React","Typography","map","field","TextField","key","placeholder","value","onChange","event","target","VariantSamples","props","feature","descriptions","useState","samples","preFilteredRows","Object","entries","error","rows","filters","keys","row","fromEntries","e","sample","id","length","every","currFilter","RegExp","exec","checked","setChecked","widths","measureGridWidth","r","index","description","FORMAT","Description","width","BaseCard","_extends","title","color","FormControlLabel","control","Checkbox","label","variant","DataGrid","autoHeight","hideFooter","disableRowSelectionOnClick","rowHeight","columnHeaderHeight","disableColumnMenu","slots","toolbar","GridToolbar","slotProps","printOptions","disableToolbarButton","VariantAnnotPanel","c","i","VariantAnnotationTable","data","fields","AnnotGrid","elt","split","variantFieldDescriptions","CHROM","POS","ID","REF","ALT","QUAL","FILTER","LaunchBreakendPanel","lazy","AnnPanel","annDesc","INFO","ANN","annFields","match","ann","CsqPanel","csqDescription","CSQ","csqFields","csq","observer","model","featureData","feat","JSON","parse","stringify","type","rest","Paper","FeatureDetails","Suspense","fallback","locStrings","alt","parseBreakend","MatePosition","CHR2","END","mate","refName","start","includes","uniqueId","end","VariantSampleGrid"],"sourceRoot":""}