Mercurial > repos > fubar > jbrowse2
view x/static/js/6999.3486cca0.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/6999.3486cca0.chunk.js","mappings":"oMAEO,MAGMA,EAAW,mBACXC,EAAoB,oBAG1B,SAASC,GAAY,IAC1BC,EAAG,iBACHC,EAAgB,gBAChBC,EAAe,cACfC,EAAgB,EAAC,UACjBC,EAAY,KASZ,MAAMC,EAAYC,KAAKC,KAAKP,EAAIQ,OAASP,GACnCQ,EAAS,IAAIC,MAAML,GACzB,IAAIM,EAAaR,EAAgB,GAE7BS,EAAO,EACPC,EAAS,EACb,KAAOD,EAAOP,EAAY,IAAKO,EAAM,CACnC,MAAME,EAAe,IAATF,EAAaX,EAAmBE,EAAgBF,EACtDc,EAAIf,EAAIgB,MAAMH,EAAQA,EAASC,GACrC,IAAKC,EACH,MAEF,GAAIb,EAAiB,CACnB,IAAIe,EAAM,GACV,IAAK,IAAIC,EAAI,EAAGC,EAAIR,EAAYO,EAAIH,EAAEP,OAAQU,IAAKC,IAG7CA,EAAIf,GAAc,IACpBa,GAAO,IACPE,EAAI,GAENF,GAAOF,EAAEG,GAEPD,IACFR,EAAOG,GAAQK,EAEnB,MACER,EAAOG,GAAQG,EAEjBJ,EAAa,EACbE,GAAUC,CACZ,CAEA,MAAO,CACLM,SAAUX,EACVY,YACIZ,EAAOa,IAAI,IAAIC,WAAW,IAAK,IAAIf,QAAU,IAC5CI,EAAO,EAAIT,EAAgB,IAC9BF,EAEN,CC3DA,MA2CA,GA3CwBuB,EAAAA,EAAAA,WAAS,UAAU,OACzCf,EAAM,MACNgB,EAAK,MACLC,EAAK,OACLC,EAAS,EAAC,WACVC,EAAaH,EAAK,MAClBI,IASA,MAAM,iBAAE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A,cAAA,WAAK,kBAjMjB,IAAmBT,CAsMjB,I","sources":["../../../packages/core/BaseFeatureWidget/SequenceFeatureDetails/util.ts","../../../packages/core/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.tsx","../../../packages/core/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.tsx","../../../packages/core/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.tsx","../../../packages/core/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.tsx","../../../packages/core/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.tsx","../../../packages/core/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.tsx"],"sourcesContent":["// note that these are currently put into the style section instead of being\n// defined in classes to aid copy and paste to an external document e.g. word\nexport const intronColor = undefined\nexport const utrColor = 'rgb(200,240,240)'\nexport const proteinColor = 'rgb(220,160,220)'\nexport const cdsColor = 'rgb(220,220,180)'\nexport const updownstreamColor = 'rgba(250,200,200)'\nexport const genomeColor = 'rgb(200,280,200)'\n\nexport function splitString({\n str,\n charactersPerRow,\n showCoordinates,\n currRemainder = 0,\n splitSize = 10,\n}: {\n str: string\n charactersPerRow: number\n showCoordinates: boolean\n currRemainder?: number\n splitStart?: number\n splitSize?: number\n}) {\n const numChunks = Math.ceil(str.length / charactersPerRow)\n const chunks = new Array(numChunks)\n let splitStart = currRemainder % 10\n\n let iter = 0\n let offset = 0\n for (; iter < numChunks + 1; ++iter) {\n const inc = iter === 0 ? charactersPerRow - currRemainder : charactersPerRow\n const r = str.slice(offset, offset + inc)\n if (!r) {\n break\n }\n if (showCoordinates) {\n let res = ''\n for (let i = 0, j = splitStart; i < r.length; i++, j++) {\n // note: this adds a space at the start but it causes trouble to try to\n // say e.g. j%splitSize==0 && j to try to only add non-zero spaces\n if (j % splitSize === 0) {\n res += ' '\n j = 0\n }\n res += r[i]\n }\n if (res) {\n chunks[iter] = res\n }\n } else {\n chunks[iter] = r\n }\n splitStart = 0 // after newline, reset\n offset += inc\n }\n\n return {\n segments: chunks,\n remainder:\n ((chunks.at(-1)?.replaceAll(' ', '').length || 0) +\n (iter < 2 ? currRemainder : 0)) %\n charactersPerRow,\n }\n}\n","import React from 'react'\nimport { SequenceFeatureDetailsModel } from '../model'\nimport { observer } from 'mobx-react'\n\nconst SequenceDisplay = observer(function ({\n chunks,\n start,\n color,\n strand = 1,\n coordStart = start,\n model,\n}: {\n chunks: string[]\n start: number\n coordStart?: number\n strand?: number\n color?: string\n model: SequenceFeatureDetailsModel\n}) {\n const { charactersPerRow, showCoordinates } = model\n\n return chunks.map((chunk, idx) => {\n const f = coordStart - (start % charactersPerRow)\n const prefix =\n (idx === 0 && start % charactersPerRow === 0) || idx > 0\n ? `${`${f + idx * strand * charactersPerRow}`.padStart(4)} `\n : ''\n const postfix =\n idx === chunks.length - 1 &&\n (chunks.at(-1)?.replaceAll(' ', '').length || 0) +\n (idx === 0 ? start % charactersPerRow : 0) !==\n charactersPerRow\n ? null\n : showCoordinates\n ? ' \\n'\n : ''\n return (\n /* biome-ignore lint/suspicious/noArrayIndexKey: */\n <React.Fragment key={`${chunk}-${idx}`}>\n {showCoordinates ? prefix : null}\n <span style={{ background: color }}>{chunk}</span>\n {postfix}\n </React.Fragment>\n )\n })\n})\n\nexport default SequenceDisplay\n","import React from 'react'\nimport { observer } from 'mobx-react'\n\n// locals\nimport { Feat } from '../../util'\nimport { splitString, cdsColor, updownstreamColor, utrColor } from '../util'\nimport { SequenceFeatureDetailsModel } from '../model'\nimport SequenceDisplay from './SequenceDisplay'\nimport { SimpleFeatureSerialized } from '../../../util'\n\nconst CDNASequence = observer(function ({\n utr,\n cds,\n exons,\n sequence,\n upstream,\n downstream,\n feature,\n includeIntrons,\n collapseIntron,\n model,\n}: {\n utr: Feat[]\n cds: Feat[]\n exons: Feat[]\n sequence: string\n upstream?: string\n downstream?: string\n feature: SimpleFeatureSerialized\n includeIntrons?: boolean\n collapseIntron?: boolean\n model: SequenceFeatureDetailsModel\n}) {\n const {\n upperCaseCDS,\n intronBp,\n charactersPerRow,\n showCoordinates,\n showCoordinatesSetting,\n } = model\n const hasCds = cds.length > 0\n const chunks = (\n cds.length ? [...cds, ...utr].sort((a, b) => a.start - b.start) : exons\n ).filter(f => f.start !== f.end)\n const toLower = (s: string) => (upperCaseCDS ? s.toLowerCase() : s)\n const toUpper = (s: string) => (upperCaseCDS ? s.toUpperCase() : s)\n\n const strand = feature.strand === -1 ? -1 : 1\n const fullGenomicCoordinates =\n showCoordinatesSetting === 'genomic' && includeIntrons && !collapseIntron\n\n const mult = fullGenomicCoordinates ? strand : 1\n let coordStart = fullGenomicCoordinates\n ? strand > 0\n ? feature.start + 1 - (upstream?.length || 0)\n : feature.end + (upstream?.length || 0)\n : 0\n let currStart = 0\n let currRemainder = 0\n\n let upstreamChunk = null as React.ReactNode\n if (upstream) {\n const { segments, remainder } = splitString({\n str: toLower(upstream),\n charactersPerRow,\n showCoordinates,\n })\n upstreamChunk = (\n <SequenceDisplay\n model={model}\n color={updownstreamColor}\n strand={mult}\n start={currStart}\n coordStart={coordStart}\n chunks={segments}\n />\n )\n currRemainder = remainder\n currStart = currStart + upstream.length * mult\n coordStart = coordStart + upstream.length * mult\n }\n\n const middleChunks = [] as React.ReactNode[]\n for (let idx = 0; idx < chunks.length; idx++) {\n const chunk = chunks[idx]!\n const intron = sequence.slice(chunk.end, chunks[idx + 1]?.start)\n const s = sequence.slice(chunk.start, chunk.end)\n const { segments, remainder } = splitString({\n str: hasCds\n ? chunk.type === 'CDS'\n ? toUpper(s)\n : toLower(s)\n : toUpper(s),\n charactersPerRow,\n currRemainder,\n showCoordinates,\n })\n\n middleChunks.push(\n <SequenceDisplay\n key={`${JSON.stringify(chunk)}-mid`}\n model={model}\n color={chunk.type === 'CDS' ? cdsColor : utrColor}\n strand={mult}\n start={currStart}\n coordStart={coordStart}\n chunks={segments}\n />,\n )\n currRemainder = remainder\n currStart = currStart + s.length * mult\n coordStart = coordStart + s.length * mult\n\n if (intron && includeIntrons && idx < chunks.length - 1) {\n const str = toLower(\n collapseIntron && intron.length > intronBp * 2\n ? `${intron.slice(0, intronBp)}...${intron.slice(-intronBp)}`\n : intron,\n )\n const { segments, remainder } = splitString({\n str,\n charactersPerRow,\n currRemainder,\n showCoordinates,\n })\n\n if (segments.length) {\n middleChunks.push(\n <SequenceDisplay\n key={`${JSON.stringify(chunk)}-intron`}\n model={model}\n strand={mult}\n coordStart={coordStart}\n start={currStart}\n chunks={segments}\n />,\n )\n currRemainder = remainder\n currStart = currStart + str.length * mult\n coordStart = coordStart + str.length * mult\n }\n }\n }\n\n let downstreamChunk = null as React.ReactNode\n if (downstream) {\n const { segments } = splitString({\n str: toLower(downstream),\n charactersPerRow,\n currRemainder,\n showCoordinates,\n })\n downstreamChunk = (\n <SequenceDisplay\n start={currStart}\n model={model}\n strand={mult}\n chunks={segments}\n coordStart={coordStart}\n color={updownstreamColor}\n />\n )\n }\n return (\n <>\n {upstreamChunk}\n {middleChunks}\n {downstreamChunk}\n </>\n )\n})\n\nexport default CDNASequence\n","import React from 'react'\nimport { observer } from 'mobx-react'\n\n// locals\nimport { Feat, stitch } from '../../util'\nimport { proteinColor, splitString } from '../util'\nimport { SequenceFeatureDetailsModel } from '../model'\nimport SequenceDisplay from './SequenceDisplay'\n\nconst ProteinSequence = observer(function ({\n cds,\n sequence,\n codonTable,\n model,\n}: {\n cds: Feat[]\n sequence: string\n codonTable: Record<string, string>\n model: SequenceFeatureDetailsModel\n}) {\n const { charactersPerRow, showCoordinates } = model\n const str = stitch(cds, sequence)\n let protein = ''\n for (let i = 0; i < str.length; i += 3) {\n // use & symbol for undefined codon, or partial slice\n protein += codonTable[str.slice(i, i + 3)] || '&'\n }\n const { segments } = splitString({\n str: protein,\n charactersPerRow,\n showCoordinates,\n })\n return (\n <SequenceDisplay\n model={model}\n color={proteinColor}\n chunks={segments}\n start={0}\n />\n )\n})\n\nexport default ProteinSequence\n","import React from 'react'\nimport { observer } from 'mobx-react'\n\n// locals\nimport { genomeColor, splitString, updownstreamColor } from '../util'\nimport { SequenceFeatureDetailsModel } from '../model'\nimport SequenceDisplay from './SequenceDisplay'\nimport { SimpleFeatureSerialized } from '../../../util'\n\nconst GenomicSequence = observer(function ({\n sequence,\n upstream,\n feature,\n downstream,\n model,\n}: {\n sequence: string\n feature: SimpleFeatureSerialized\n upstream?: string\n downstream?: string\n model: SequenceFeatureDetailsModel\n}) {\n const { charactersPerRow, showCoordinatesSetting, showCoordinates } = model\n let currStart = 0\n let upstreamChunk = null as React.ReactNode\n let currRemainder = 0\n const strand = feature.strand === -1 ? -1 : 1\n const fullGenomicCoordinates = showCoordinatesSetting === 'genomic'\n const mult = fullGenomicCoordinates ? strand : 1\n let coordStart = fullGenomicCoordinates\n ? strand > 0\n ? feature.start + 1 - (upstream?.length || 0)\n : feature.end + (upstream?.length || 0)\n : 0\n if (upstream) {\n const { segments, remainder } = splitString({\n str: upstream,\n charactersPerRow,\n showCoordinates,\n })\n upstreamChunk = (\n <SequenceDisplay\n model={model}\n color={updownstreamColor}\n start={currStart}\n coordStart={coordStart}\n chunks={segments}\n />\n )\n currRemainder = remainder\n currStart = currStart + upstream.length * mult\n coordStart = coordStart + upstream.length * mult\n }\n\n const { segments, remainder } = splitString({\n str: sequence,\n charactersPerRow,\n showCoordinates,\n currRemainder,\n })\n const middleChunk = (\n <SequenceDisplay\n model={model}\n color={genomeColor}\n start={currStart}\n coordStart={coordStart}\n chunks={segments}\n />\n )\n currRemainder = remainder\n currStart += sequence.length * mult\n coordStart = coordStart + sequence.length * mult\n\n let downstreamChunk = null as React.ReactNode\n if (downstream) {\n const { segments } = splitString({\n str: downstream,\n charactersPerRow,\n currRemainder,\n showCoordinates,\n })\n downstreamChunk = (\n <SequenceDisplay\n start={currStart}\n model={model}\n chunks={segments}\n coordStart={coordStart}\n color={updownstreamColor}\n />\n )\n }\n\n return (\n <>\n {upstreamChunk}\n {middleChunk}\n {downstreamChunk}\n </>\n )\n})\n\nexport default GenomicSequence\n","import React from 'react'\nimport { observer } from 'mobx-react'\n\n// locals\nimport { cdsColor, splitString } from '../util'\nimport { Feat, stitch } from '../../util'\nimport { SequenceFeatureDetailsModel } from '../model'\nimport SequenceDisplay from './SequenceDisplay'\n\nconst CDSSequence = observer(function ({\n cds,\n sequence,\n model,\n}: {\n cds: Feat[]\n sequence: string\n model: SequenceFeatureDetailsModel\n}) {\n const { charactersPerRow, showCoordinates } = model\n const { segments } = splitString({\n str: stitch(cds, sequence),\n charactersPerRow,\n showCoordinates,\n })\n return (\n <SequenceDisplay\n model={model}\n color={cdsColor}\n chunks={segments}\n start={0}\n />\n )\n})\n\nexport default CDSSequence\n","import React from 'react'\nimport { observer } from 'mobx-react'\n\n// locals\nimport {\n SimpleFeatureSerialized,\n defaultCodonTable,\n generateCodonTable,\n revcom,\n toLocale,\n} from '../../util'\nimport {\n SeqState,\n calculateUTRs,\n calculateUTRs2,\n dedupe,\n revlist,\n} from '../util'\nimport { SequenceFeatureDetailsModel } from './model'\n// panel types\nimport CDNASequence from './seqtypes/CDNASequence'\nimport ProteinSequence from './seqtypes/ProteinSequence'\nimport GenomicSequence from './seqtypes/GenomicSequence'\nimport CDSSequence from './seqtypes/CDSSequence'\n\ninterface SequencePanelProps {\n sequence: SeqState\n feature: SimpleFeatureSerialized\n model: SequenceFeatureDetailsModel\n}\n\nfunction getStrand(strand: number) {\n if (strand === -1) {\n return '(-)'\n } else if (strand === 1) {\n return '(+)'\n } else {\n return ''\n }\n}\n\nfunction WordWrap({ children }: { children: React.ReactNode }) {\n return (\n <pre\n style={{\n /* raw styles instead of className so that html copy works */\n fontFamily: 'monospace',\n color: 'black',\n fontSize: 11,\n }}\n >\n {children}\n </pre>\n )\n}\n\nfunction NoWordWrap({ children }: { children: React.ReactNode }) {\n return (\n <div\n style={{\n /* raw styles instead of className so that html copy works */\n fontFamily: 'monospace',\n color: 'black',\n fontSize: 11,\n maxWidth: 600,\n whiteSpace: 'wrap',\n wordBreak: 'break-all',\n }}\n >\n {children}\n </div>\n )\n}\n\nconst SequencePanel = observer(\n React.forwardRef<HTMLDivElement, SequencePanelProps>(function S(props, ref) {\n const { model, feature } = props\n const { showCoordinates, mode } = model\n let {\n sequence: { seq, upstream = '', downstream = '' },\n } = props\n const { subfeatures = [] } = feature\n\n const children = subfeatures\n .sort((a, b) => a.start - b.start)\n .map(sub => ({\n ...sub,\n start: sub.start - feature.start,\n end: sub.end - feature.start,\n }))\n\n // we filter duplicate entries in cds and exon lists duplicate entries\n // may be rare but was seen in Gencode v36 track NCList, likely a bug\n // on GFF3 or probably worth ignoring here (produces broken protein\n // translations if included)\n //\n // position 1:224,800,006..225,203,064 gene ENSG00000185842.15 first\n // transcript ENST00000445597.6\n //\n // http://localhost:3000/?config=test_data%2Fconfig.json&session=share-FUl7G1isvF&password=HXh5Y\n\n let cds = dedupe(children.filter(sub => sub.type === 'CDS'))\n let utr = dedupe(children.filter(sub => sub.type?.match(/utr/i)))\n let exons = dedupe(children.filter(sub => sub.type === 'exon'))\n\n if (!utr.length && cds.length && exons.length) {\n utr = calculateUTRs(cds, exons)\n }\n if (!utr.length && cds.length && !exons.length) {\n utr = calculateUTRs2(cds, {\n start: 0,\n end: feature.end - feature.start,\n type: 'gene',\n })\n }\n\n if (feature.strand === -1) {\n // doing this in a single assignment is needed because downstream and\n // upstream are swapped so this avoids a temp variable\n ;[seq, upstream, downstream] = [\n revcom(seq),\n revcom(downstream),\n revcom(upstream),\n ]\n cds = revlist(cds, seq.length)\n exons = revlist(exons, seq.length)\n utr = revlist(utr, seq.length)\n }\n const codonTable = generateCodonTable(defaultCodonTable)\n\n const Container = showCoordinates ? WordWrap : NoWordWrap\n return (\n <div\n data-testid=\"sequence_panel\"\n ref={ref}\n style={{ maxHeight: 300, overflow: 'auto' }}\n >\n <Container>\n <div style={{ background: 'white' }}>\n {`>${[\n `${feature.name || feature.id}-${mode}`,\n `${feature.refName}:${toLocale(feature.start + 1)}-${toLocale(feature.end)}${getStrand(feature.strand as number)}`,\n mode.endsWith('updownstream')\n ? `+/- ${toLocale(model.upDownBp)} up/downstream bp`\n : '',\n ]\n .filter(f => !!f)\n .join(' ')}\\n`}\n </div>\n {mode === 'genomic' ? (\n <GenomicSequence feature={feature} model={model} sequence={seq} />\n ) : mode === 'genomic_sequence_updownstream' ? (\n <GenomicSequence\n model={model}\n feature={feature}\n sequence={seq}\n upstream={upstream}\n downstream={downstream}\n />\n ) : mode === 'cds' ? (\n <CDSSequence model={model} cds={cds} sequence={seq} />\n ) : mode === 'cdna' ? (\n <CDNASequence\n model={model}\n exons={exons}\n feature={feature}\n cds={cds}\n utr={utr}\n sequence={seq}\n />\n ) : mode === 'protein' ? (\n <ProteinSequence\n model={model}\n cds={cds}\n codonTable={codonTable}\n sequence={seq}\n />\n ) : mode === 'gene' ? (\n <CDNASequence\n model={model}\n exons={exons}\n feature={feature}\n cds={cds}\n utr={utr}\n sequence={seq}\n includeIntrons\n />\n ) : mode === 'gene_collapsed_intron' ? (\n <CDNASequence\n model={model}\n exons={exons}\n feature={feature}\n cds={cds}\n sequence={seq}\n utr={utr}\n includeIntrons\n collapseIntron\n />\n ) : mode === 'gene_updownstream' ? (\n <CDNASequence\n model={model}\n exons={exons}\n feature={feature}\n cds={cds}\n sequence={seq}\n utr={utr}\n upstream={upstream}\n downstream={downstream}\n includeIntrons\n />\n ) : mode === 'gene_updownstream_collapsed_intron' ? (\n <CDNASequence\n model={model}\n exons={exons}\n feature={feature}\n cds={cds}\n sequence={seq}\n utr={utr}\n upstream={upstream}\n downstream={downstream}\n includeIntrons\n collapseIntron\n />\n ) : (\n <div>Unknown type</div>\n )}\n </Container>\n </div>\n )\n }),\n)\n\nexport default SequencePanel\n"],"names":["cdsColor","updownstreamColor","splitString","str","charactersPerRow","showCoordinates","currRemainder","splitSize","numChunks","Math","ceil","length","chunks","Array","splitStart","iter","offset","inc","r","slice","res","i","j","segments","remainder","at","replaceAll","observer","start","color","strand","coordStart","model","map","chunk","idx","prefix","padStart","postfix","React","key","style","background","utr","cds","exons","sequence","upstream","downstream","feature","includeIntrons","collapseIntron","upperCaseCDS","intronBp","showCoordinatesSetting","hasCds","sort","a","b","filter","f","end","toLower","s","toLowerCase","toUpper","toUpperCase","fullGenomicCoordinates","mult","currStart","upstreamChunk","SequenceDisplay","middleChunks","intron","type","push","JSON","stringify","downstreamChunk","codonTable","stitch","protein","middleChunk","WordWrap","children","fontFamily","fontSize","NoWordWrap","maxWidth","whiteSpace","wordBreak","props","ref","mode","seq","subfeatures","sub","dedupe","match","calculateUTRs","calculateUTRs2","revcom","revlist","generateCodonTable","defaultCodonTable","Container","maxHeight","overflow","name","id","refName","toLocale","endsWith","upDownBp","join","GenomicSequence","CDSSequence","CDNASequence","ProteinSequence"],"sourceRoot":""}