view x/static/js/4060.8757dbe8.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/4060.8757dbe8.chunk.js","mappings":"2LAGO,SAASA,EACdC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,GAEIL,EAAIE,EAAI,GAAKF,EAAII,IAGjBC,IACFN,EAAIO,UAAYD,GAElBN,EAAID,SAASE,EAAGC,EAAGC,EAAGC,GACxB,CAEO,SAASI,EAAgBC,GAC9B,MAAM,MAAEC,GAAUD,EAAME,QACxB,MAAO,CACLC,EAAGF,EAAME,EAAEC,KACXC,EAAGJ,EAAMI,EAAED,KACXE,EAAGL,EAAMK,EAAEF,KACXG,EAAGN,EAAMM,EAAEH,KACXI,SAAU,UAEd,CA2BO,SAASC,IAGd,MAAO,CAAEC,WAFSC,EAAAA,EAAAA,aAAY,KAEVC,YADDD,EAAAA,EAAAA,aAAY,KAAO,EAExC,C,0BC/CO,SAASE,GAAuB,UACrCC,EAAS,IACTC,EAAG,QACHC,EAAO,OACPC,EAAM,aACNC,EAAY,YACZC,IAWA,OAAQL,GACN,IAAK,aACH,OCzBC,SAA2BE,GAChC,OAAOA,EAAQI,IAAI,cACjBJ,EAAQI,IAAI,aAAeJ,EAAQI,IAAI,YACrC,OACA,OAAOC,KAAKC,IAAIN,EAAQI,IAAI,oBAAsB,aACxD,CDoBaG,CAAkBP,GAC3B,IAAK,SACH,OCDC,SAAuBA,GAC5B,OAAkC,IAA3BA,EAAQI,IAAI,UAAmB,UAAY,SACpD,CDDaI,CAAcR,GACvB,IAAK,iBACH,OCtBC,SAA+BA,GACpC,MAAO,OAAOA,EAAQI,IAAI,mBAC5B,CDoBaK,CAAsBT,GAC/B,IAAK,kBACH,OCDC,SACLA,EACAC,GAEA,OAAOS,EAAAA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CAAmBjL,GAC3CT,EAAI2L,KAAO,kCAEX,MAAM,UAAExK,EAAS,WAAEE,GAAeH,IAC5B6H,GXP4B/E,EWOQD,GAASC,KXN5C,CAAC,cAAe,iBAAiB4H,SAAS5H,GAAQ,KADpD,IAA6BA,EWSlC,IAAK,MAAMR,KAAQyH,EACjB1H,EAAgB,CACdvD,MACAwD,OACAC,aACA9B,eACA+B,eACAC,kBACAxC,YACAE,aACAuC,gBAEF+E,EAAiB,CACf3I,MACAwD,OACAC,aACAqF,gBACAC,gBACAC,YXtBG,EWuBHH,+BACAD,qBACAzH,YACAE,aACAqC,eACAC,kBACAC,gBAEEsH,GACFT,EAAmB,CACjBzK,MACAwD,OACAC,aACAC,eACAhC,SACAjB,QACAmD,eAKR,C","sources":["../../../plugins/alignments/src/PileupRenderer/util.ts","../../../plugins/alignments/src/PileupRenderer/getAlignmentShapeColor.ts","../../../plugins/alignments/src/PileupRenderer/colorBy.ts","../../../plugins/alignments/src/PileupRenderer/renderAlignment.ts","../../../plugins/alignments/src/PileupRenderer/renderAlignmentShape.ts","../../../plugins/alignments/src/PileupRenderer/renderPerBaseQuality.ts","../../../plugins/alignments/src/PileupRenderer/renderPerBaseLettering.ts","../../../plugins/alignments/src/PileupRenderer/renderModifications.ts","../../../plugins/alignments/src/PileupRenderer/renderMethylation.ts","../../../plugins/alignments/src/PileupRenderer/renderMismatches.ts","../../../plugins/alignments/src/PileupRenderer/renderSoftClipping.ts","../../../plugins/alignments/src/PileupRenderer/makeImageData.ts"],"sourcesContent":["import { Feature, measureText } from '@jbrowse/core/util'\nimport { Theme } from '@mui/material'\n\nexport function fillRect(\n  ctx: CanvasRenderingContext2D,\n  l: number,\n  t: number,\n  w: number,\n  h: number,\n  cw: number,\n  color?: string,\n) {\n  if (l + w < 0 || l > cw) {\n    return\n  }\n  if (color) {\n    ctx.fillStyle = color\n  }\n  ctx.fillRect(l, t, w, h)\n}\n\nexport function getColorBaseMap(theme: Theme) {\n  const { bases } = theme.palette\n  return {\n    A: bases.A.main,\n    C: bases.C.main,\n    G: bases.G.main,\n    T: bases.T.main,\n    deletion: '#808080', // gray\n  }\n}\n\nexport function getContrastBaseMap(theme: Theme) {\n  return Object.fromEntries(\n    Object.entries(getColorBaseMap(theme)).map(([key, value]) => [\n      key,\n      theme.palette.getContrastText(value),\n    ]),\n  )\n}\n\nexport function shouldDrawSNPsMuted(type?: string) {\n  return ['methylation', 'modifications'].includes(type || '')\n}\n\nexport function shouldDrawIndels() {\n  return true\n}\n\nexport interface LayoutFeature {\n  heightPx: number\n  topPx: number\n  feature: Feature\n}\n\n// get width and height of chars the height is an approximation: width letter M\n// is approximately the height\nexport function getCharWidthHeight() {\n  const charWidth = measureText('A')\n  const charHeight = measureText('M') - 2\n  return { charWidth, charHeight }\n}\n","import {\n  AnyConfigurationModel,\n  readConfObject,\n} from '@jbrowse/core/configuration'\nimport { Feature } from '@jbrowse/core/util'\nimport { fillColor } from '../shared/color'\nimport {\n  colorByInsertSize,\n  colorByMappingQuality,\n  colorByOrientation,\n  colorByStrand,\n  colorByStrandedRnaSeq,\n} from './colorBy'\n\nexport function getAlignmentShapeColor({\n  colorType,\n  tag,\n  feature,\n  config,\n  defaultColor,\n  colorTagMap,\n}: {\n  colorType: string\n  tag: string\n  feature: Feature\n  defaultColor: boolean\n  config: AnyConfigurationModel\n  colorTagMap: Record<string, string>\n}) {\n  // first pass for simple color changes that change the color of the\n  // alignment\n  switch (colorType) {\n    case 'insertSize':\n      return colorByInsertSize(feature)\n    case 'strand':\n      return colorByStrand(feature)\n    case 'mappingQuality':\n      return colorByMappingQuality(feature)\n    case 'pairOrientation':\n      return colorByOrientation(feature, config)\n    case 'stranded':\n      return colorByStrandedRnaSeq(feature)\n    case 'xs':\n    case 'tag': {\n      const tags = feature.get('tags')\n      const val = tags ? tags[tag] : feature.get(tag)\n\n      if (tag === 'XS' || tag === 'TS') {\n        if (val === '-') {\n          return fillColor.color_rev_strand\n        } else if (val === '+') {\n          return fillColor.color_fwd_strand\n        } else {\n          return fillColor.color_nostrand\n        }\n      }\n      if (tag === 'ts') {\n        if (val === '-') {\n          return feature.get('strand') === -1\n            ? fillColor.color_fwd_strand\n            : fillColor.color_rev_strand\n        } else if (val === '+') {\n          return feature.get('strand') === -1\n            ? fillColor.color_rev_strand\n            : fillColor.color_fwd_strand\n        } else {\n          return fillColor.color_nostrand\n        }\n      }\n      return colorTagMap[val] || fillColor.color_nostrand\n    }\n    case 'insertSizeAndPairOrientation':\n      break\n\n    case 'modifications':\n    case 'methylation':\n      // this coloring is similar to igv.js, and is helpful to color negative\n      // strand reads differently because their c-g will be flipped (e.g. g-c\n      // read right to left)\n      return feature.get('flags') & 16 ? '#c8dcc8' : '#c8c8c8'\n\n    default:\n      return defaultColor\n        ? 'lightgrey'\n        : readConfObject(config, 'color', { feature })\n  }\n}\n","import {\n  AnyConfigurationModel,\n  readConfObject,\n} from '@jbrowse/core/configuration'\nimport { Feature } from '@jbrowse/core/util'\nimport { fillColor } from '../shared/color'\nimport { orientationTypes } from '../util'\n\nexport function colorByInsertSize(feature: Feature) {\n  return feature.get('is_paired') &&\n    feature.get('refName') !== feature.get('next_ref')\n    ? '#555'\n    : `hsl(${Math.abs(feature.get('template_length')) / 10},50%,50%)`\n}\n\nexport function colorByMappingQuality(feature: Feature) {\n  return `hsl(${feature.get('score')},50%,50%)`\n}\n\nfunction getOrientation(feature: Feature, config: AnyConfigurationModel) {\n  const orientationType = readConfObject(config, 'orientationType') as\n    | 'fr'\n    | 'ff'\n    | 'rf'\n  const type = orientationTypes[orientationType]\n  const orientation = type[feature.get('pair_orientation') as string]!\n  return {\n    LR: 'color_pair_lr' as const,\n    RR: 'color_pair_rr' as const,\n    RL: 'color_pair_rl' as const,\n    LL: 'color_pair_ll' as const,\n  }[orientation]\n}\n\nexport function colorByStrand(feature: Feature) {\n  return feature.get('strand') === -1 ? '#8F8FD8' : '#EC8B8B'\n}\n\nexport function colorByOrientation(\n  feature: Feature,\n  config: AnyConfigurationModel,\n) {\n  return fillColor[getOrientation(feature, config) || 'color_nostrand']\n}\nfunction getStranded(feature: Feature) {\n  const flags = feature.get('flags')\n  const strand = feature.get('strand')\n\n  // is paired\n  if (flags & 1) {\n    // first-of-pair?\n    const flipper = flags & 64 ? -1 : 1\n\n    // proper pairing\n    if (flags & 2) {\n      return strand * flipper === 1 ? 'color_rev_strand' : 'color_fwd_strand'\n    }\n    // mate missing, separate color\n    if (flags & 8) {\n      return strand * flipper === 1\n        ? 'color_rev_missing_mate'\n        : 'color_fwd_missing_mate'\n    }\n    // same chrom without proper pairing gets separate color\n    if (feature.get('refName') === feature.get('next_ref')) {\n      return strand * flipper === 1\n        ? 'color_rev_strand_not_proper'\n        : 'color_fwd_strand_not_proper'\n    }\n    // abberant chrom\n\n    return strand === 1 ? 'color_fwd_diff_chr' : 'color_rev_diff_chr'\n  }\n  return 'color_unknown'\n}\n\nexport function colorByStrandedRnaSeq(feature: Feature) {\n  return fillColor[getStranded(feature)]\n}\n","import { LayoutFeature } from './util'\n\nimport { getAlignmentShapeColor } from './getAlignmentShapeColor'\nimport { renderAlignmentShape } from './renderAlignmentShape'\nimport { renderPerBaseQuality } from './renderPerBaseQuality'\nimport { renderPerBaseLettering } from './renderPerBaseLettering'\nimport { renderModifications } from './renderModifications'\nimport { renderMethylation } from './renderMethylation'\nimport { RenderArgsWithColor } from './makeImageData'\n\nexport function renderAlignment({\n  ctx,\n  feat,\n  renderArgs,\n  colorForBase,\n  contrastForBase,\n  charWidth,\n  charHeight,\n  defaultColor,\n  canvasWidth,\n}: {\n  ctx: CanvasRenderingContext2D\n  feat: LayoutFeature\n  renderArgs: RenderArgsWithColor\n  colorForBase: Record<string, string>\n  contrastForBase: Record<string, string>\n  charWidth: number\n  charHeight: number\n  defaultColor: boolean\n  canvasWidth: number\n}) {\n  const { config, bpPerPx, regions, colorBy, colorTagMap = {} } = renderArgs\n  const { tag = '', type: colorType = '' } = colorBy || {}\n  const { feature } = feat\n  const region = regions[0]!\n\n  ctx.fillStyle = getAlignmentShapeColor({\n    feature,\n    config,\n    tag,\n    defaultColor,\n    colorType,\n    colorTagMap,\n  })\n\n  renderAlignmentShape({ ctx, feat, renderArgs })\n\n  // second pass for color types that render per-base things that go over the\n  // existing drawing\n  switch (colorType) {\n    case 'perBaseQuality':\n      renderPerBaseQuality({\n        ctx,\n        feat,\n        region,\n        bpPerPx,\n        canvasWidth,\n      })\n      break\n\n    case 'perBaseLettering':\n      renderPerBaseLettering({\n        ctx,\n        feat,\n        region,\n        bpPerPx,\n        colorForBase,\n        contrastForBase,\n        charWidth,\n        charHeight,\n        canvasWidth,\n      })\n      break\n\n    case 'modifications':\n      renderModifications({\n        ctx,\n        feat,\n        region,\n        bpPerPx,\n        renderArgs,\n        canvasWidth,\n      })\n      break\n\n    case 'methylation':\n      renderMethylation({\n        ctx,\n        feat,\n        region,\n        bpPerPx,\n        renderArgs,\n        canvasWidth,\n      })\n      break\n  }\n}\n","import { bpSpanPx } from '@jbrowse/core/util'\nimport { RenderArgsDeserialized } from './PileupRenderer'\nimport { LayoutFeature } from './util'\n\nexport function renderAlignmentShape({\n  ctx,\n  feat,\n  renderArgs,\n}: {\n  ctx: CanvasRenderingContext2D\n  feat: LayoutFeature\n  renderArgs: RenderArgsDeserialized\n}) {\n  const { regions, bpPerPx } = renderArgs\n  const { heightPx, topPx, feature } = feat\n  const region = regions[0]!\n  const s = feature.get('start')\n  const e = feature.get('end')\n  const [leftPx, rightPx] = bpSpanPx(s, e, region, bpPerPx)\n  const flip = region.reversed ? -1 : 1\n  const strand = feature.get('strand') * flip\n  if (bpPerPx < 10 && heightPx > 5) {\n    if (strand === -1) {\n      ctx.beginPath()\n      ctx.moveTo(leftPx - 5, topPx + heightPx / 2)\n      ctx.lineTo(leftPx, topPx + heightPx)\n      ctx.lineTo(rightPx, topPx + heightPx)\n      ctx.lineTo(rightPx, topPx)\n      ctx.lineTo(leftPx, topPx)\n      ctx.closePath()\n      ctx.fill()\n    } else {\n      ctx.beginPath()\n      ctx.moveTo(leftPx, topPx)\n      ctx.lineTo(leftPx, topPx + heightPx)\n      ctx.lineTo(rightPx, topPx + heightPx)\n      ctx.lineTo(rightPx + 5, topPx + heightPx / 2)\n      ctx.lineTo(rightPx, topPx)\n      ctx.closePath()\n      ctx.fill()\n    }\n  } else {\n    ctx.fillRect(leftPx, topPx, rightPx - leftPx, heightPx)\n  }\n}\n","import { bpSpanPx, Region } from '@jbrowse/core/util'\nimport { parseCigar } from '../MismatchParser'\nimport { fillRect, LayoutFeature } from './util'\n\nexport function renderPerBaseQuality({\n  ctx,\n  feat,\n  region,\n  bpPerPx,\n  canvasWidth,\n}: {\n  ctx: CanvasRenderingContext2D\n  feat: LayoutFeature\n  region: Region\n  bpPerPx: number\n  canvasWidth: number\n}) {\n  const { feature, topPx, heightPx } = feat\n  const qual: string = feature.get('qual') || ''\n  const scores = qual.split(' ').map(val => +val)\n  const cigarOps = parseCigar(feature.get('CIGAR'))\n  const w = 1 / bpPerPx\n  const start = feature.get('start')\n  let soffset = 0 // sequence offset\n  let roffset = 0 // reference offset\n\n  for (let i = 0; i < cigarOps.length; i += 2) {\n    const len = +cigarOps[i]!\n    const op = cigarOps[i + 1]!\n    if (op === 'S' || op === 'I') {\n      soffset += len\n    } else if (op === 'D' || op === 'N') {\n      roffset += len\n    } else if (op === 'M' || op === 'X' || op === '=') {\n      for (let m = 0; m < len; m++) {\n        const score = scores[soffset + m]!\n        const start0 = start + roffset + m\n        const leftPx = bpSpanPx(start0, start0 + 1, region, bpPerPx)[0]\n        const c = `hsl(${score === 255 ? 150 : score * 1.5},55%,50%)`\n        fillRect(ctx, leftPx, topPx, w + 0.5, heightPx, canvasWidth, c)\n      }\n      soffset += len\n      roffset += len\n    }\n  }\n}\n","import { bpSpanPx, Region } from '@jbrowse/core/util'\nimport { parseCigar } from '../MismatchParser'\nimport { fillRect, LayoutFeature } from './util'\n\nexport function renderPerBaseLettering({\n  ctx,\n  feat,\n  region,\n  bpPerPx,\n  colorForBase,\n  contrastForBase,\n  charWidth,\n  charHeight,\n  canvasWidth,\n}: {\n  ctx: CanvasRenderingContext2D\n  feat: LayoutFeature\n  region: Region\n  bpPerPx: number\n  colorForBase: Record<string, string>\n  contrastForBase: Record<string, string>\n  charWidth: number\n  charHeight: number\n  canvasWidth: number\n}) {\n  const heightLim = charHeight - 2\n  const { feature, topPx, heightPx } = feat\n  const seq = feature.get('seq') as string | undefined\n  const cigarOps = parseCigar(feature.get('CIGAR'))\n  const w = 1 / bpPerPx\n  const start = feature.get('start')\n  let soffset = 0\n  let roffset = 0\n\n  if (!seq) {\n    return\n  }\n  for (let i = 0; i < cigarOps.length; i += 2) {\n    const len = +cigarOps[i]!\n    const op = cigarOps[i + 1]!\n    if (op === 'S' || op === 'I') {\n      soffset += len\n    } else if (op === 'D' || op === 'N') {\n      roffset += len\n    } else if (op === 'M' || op === 'X' || op === '=') {\n      for (let m = 0; m < len; m++) {\n        const letter = seq[soffset + m]!\n        const r = start + roffset + m\n        const [leftPx] = bpSpanPx(r, r + 1, region, bpPerPx)\n        const c = colorForBase[letter]\n        fillRect(ctx, leftPx, topPx, w + 0.5, heightPx, canvasWidth, c)\n\n        if (w >= charWidth && heightPx >= heightLim) {\n          // normal SNP coloring\n          ctx.fillStyle = contrastForBase[letter]!\n          ctx.fillText(\n            letter,\n            leftPx + (w - charWidth) / 2 + 1,\n            topPx + heightPx,\n          )\n        }\n      }\n      soffset += len\n      roffset += len\n    }\n  }\n}\n","import { bpSpanPx, Region } from '@jbrowse/core/util'\nimport {\n  getModificationPositions,\n  getModificationProbabilities,\n  getNextRefPos,\n  parseCigar,\n} from '../MismatchParser'\nimport { getTagAlt } from '../util'\nimport { fillRect, LayoutFeature } from './util'\nimport { RenderArgsWithColor } from './makeImageData'\nimport { colord } from '@jbrowse/core/util/colord'\n\n// render modifications stored in MM tag in BAM\n//\n// ML stores probabilities as array of numerics and MP is scaled phred scores\n// https://github.com/samtools/hts-specs/pull/418/files#diff-e765c6479316309f56b636f88189cdde8c40b854c7bdcce9ee7fe87a4e76febcR596\n//\n// if we have ML or Ml, it is an 8bit probability, divide by 255\n//\n// if we have MP or Mp it is phred scaled ASCII, which can go up to 90 but\n// has very high likelihood basecalls at that point, we really only care\n// about low qual calls <20 approx\nexport function renderModifications({\n  ctx,\n  feat,\n  region,\n  bpPerPx,\n  renderArgs,\n  canvasWidth,\n}: {\n  ctx: CanvasRenderingContext2D\n  feat: LayoutFeature\n  region: Region\n  bpPerPx: number\n  renderArgs: RenderArgsWithColor\n  canvasWidth: number\n}) {\n  const { feature, topPx, heightPx } = feat\n  const { modificationTagMap = {} } = renderArgs\n\n  const seq = feature.get('seq') as string | undefined\n\n  if (!seq) {\n    return\n  }\n  const mm = (getTagAlt(feature, 'MM', 'Mm') as string) || ''\n  const cigar = feature.get('CIGAR')\n  const start = feature.get('start')\n  const strand = feature.get('strand')\n  const cigarOps = parseCigar(cigar)\n  const probabilities = getModificationProbabilities(feature)\n  const modifications = getModificationPositions(mm, seq, strand)\n\n  // probIndex applies across multiple modifications e.g.\n  let probIndex = 0\n  for (const { type, positions } of modifications) {\n    const col = modificationTagMap[type] || 'black'\n    const base = colord(col)\n    for (const readPos of getNextRefPos(cigarOps, positions)) {\n      const r = start + readPos\n      const [leftPx, rightPx] = bpSpanPx(r, r + 1, region, bpPerPx)\n      const prob = probabilities?.[probIndex] || 0\n      const c = prob !== 1 ? base.alpha(prob + 0.1).toHslString() : col\n      const w = rightPx - leftPx + 0.5\n      fillRect(ctx, leftPx, topPx, w, heightPx, canvasWidth, c)\n      probIndex++\n    }\n  }\n}\n","import { bpSpanPx, Region } from '@jbrowse/core/util'\nimport { getMethBins } from '../MismatchParser'\nimport { fillRect, LayoutFeature } from './util'\nimport { RenderArgsWithColor } from './makeImageData'\nimport { colord } from '@jbrowse/core/util/colord'\n\n// Color by methylation is slightly modified version of color by\n// modifications that focuses on CpG sites, with non-methylated CpG colored\nexport function renderMethylation({\n  ctx,\n  feat,\n  region,\n  bpPerPx,\n  renderArgs,\n  canvasWidth,\n}: {\n  ctx: CanvasRenderingContext2D\n  feat: LayoutFeature\n  region: Region\n  bpPerPx: number\n  renderArgs: RenderArgsWithColor\n  canvasWidth: number\n}) {\n  const { regionSequence } = renderArgs\n  const { feature, topPx, heightPx } = feat\n  if (!regionSequence) {\n    throw new Error('region sequence required for methylation')\n  }\n\n  const seq = feature.get('seq') as string | undefined\n  if (!seq) {\n    return\n  }\n  const fstart = feature.get('start')\n  const fend = feature.get('end')\n  const { methBins, methProbs } = getMethBins(feature)\n\n  function getCol(k: number) {\n    if (methBins[k]) {\n      const p = methProbs[k] || 0\n      return (\n        p > 0.5\n          ? colord('red').alpha((p - 0.5) * 2)\n          : colord('blue').alpha(1 - p * 2)\n      ).toHslString()\n    }\n    return undefined\n  }\n  for (let i = 0; i < fend - fstart; i++) {\n    const j = i + fstart\n    const l1 = regionSequence[j - region.start + 1]?.toLowerCase()\n    const l2 = regionSequence[j - region.start + 2]?.toLowerCase()\n\n    if (l1 === 'c' && l2 === 'g') {\n      if (bpPerPx > 2) {\n        const [leftPx, rightPx] = bpSpanPx(j, j + 2, region, bpPerPx)\n        const w = rightPx - leftPx + 0.5\n        const c = getCol(i) || getCol(i + 1) || 'blue'\n        fillRect(ctx, leftPx, topPx, w, heightPx, canvasWidth, c)\n      } else {\n        const [leftPx, rightPx] = bpSpanPx(j, j + 1, region, bpPerPx)\n        const w = rightPx - leftPx + 0.5\n        const c = getCol(i) || 'blue'\n        fillRect(ctx, leftPx, topPx, w, heightPx, canvasWidth, c)\n        const [leftPx2, rightPx2] = bpSpanPx(j + 1, j + 2, region, bpPerPx)\n        const w2 = rightPx2 - leftPx2 + 0.5\n        const c2 = getCol(i + 1) || 'blue'\n        fillRect(ctx, leftPx2, topPx, w2, heightPx, canvasWidth, c2)\n      }\n    }\n  }\n}\n","import { bpSpanPx, measureText } from '@jbrowse/core/util'\nimport { Mismatch } from '../MismatchParser'\nimport { fillRect, LayoutFeature } from './util'\nimport { RenderArgsWithColor } from './makeImageData'\nimport { colord } from '@jbrowse/core/util/colord'\n\nexport function renderMismatches({\n  ctx,\n  feat,\n  renderArgs,\n  minSubfeatureWidth,\n  largeInsertionIndicatorScale,\n  mismatchAlpha,\n  charWidth,\n  charHeight,\n  colorForBase,\n  contrastForBase,\n  canvasWidth,\n  drawSNPsMuted,\n  drawIndels = true,\n}: {\n  ctx: CanvasRenderingContext2D\n  feat: LayoutFeature\n  renderArgs: RenderArgsWithColor\n  colorForBase: Record<string, string>\n  contrastForBase: Record<string, string>\n  mismatchAlpha?: boolean\n  drawIndels?: boolean\n  drawSNPsMuted?: boolean\n  minSubfeatureWidth: number\n  largeInsertionIndicatorScale: number\n  charWidth: number\n  charHeight: number\n  canvasWidth: number\n}) {\n  const { bpPerPx, regions } = renderArgs\n  const { heightPx, topPx, feature } = feat\n  const region = regions[0]!\n  const start = feature.get('start')\n\n  const pxPerBp = Math.min(1 / bpPerPx, 2)\n  const mismatches = feature.get('mismatches') as Mismatch[] | undefined\n  const heightLim = charHeight - 2\n\n  // extraHorizontallyFlippedOffset is used to draw interbase items, which\n  // are located to the left when forward and right when reversed\n  const extraHorizontallyFlippedOffset = region.reversed ? 1 / bpPerPx + 1 : -1\n\n  if (!mismatches) {\n    return\n  }\n\n  // two pass rendering: first pass, draw all the mismatches except wide\n  // insertion markers\n  for (const mismatch of mismatches) {\n    const mstart = start + mismatch.start\n    const mlen = mismatch.length\n    const mbase = mismatch.base\n    const [leftPx, rightPx] = bpSpanPx(mstart, mstart + mlen, region, bpPerPx)\n    const widthPx = Math.max(minSubfeatureWidth, Math.abs(leftPx - rightPx))\n    if (mismatch.type === 'mismatch') {\n      if (!drawSNPsMuted) {\n        const baseColor = colorForBase[mismatch.base] || '#888'\n        const c = mismatchAlpha\n          ? mismatch.qual === undefined\n            ? baseColor\n            : colord(baseColor)\n                .alpha(Math.min(1, mismatch.qual / 50))\n                .toHslString()\n          : baseColor\n\n        fillRect(\n          ctx,\n          Math.round(leftPx),\n          topPx,\n          widthPx,\n          heightPx,\n          canvasWidth,\n          c,\n        )\n      }\n\n      if (widthPx >= charWidth && heightPx >= heightLim) {\n        // normal SNP coloring\n        const contrastColor = drawSNPsMuted\n          ? 'black'\n          : contrastForBase[mismatch.base] || 'black'\n        ctx.fillStyle = mismatchAlpha\n          ? mismatch.qual === undefined\n            ? contrastColor\n            : colord(contrastColor)\n                .alpha(Math.min(1, mismatch.qual / 50))\n                .toHslString()\n          : contrastColor\n        ctx.fillText(\n          mbase,\n          leftPx + (widthPx - charWidth) / 2 + 1,\n          topPx + heightPx,\n        )\n      }\n    } else if (mismatch.type === 'deletion' && drawIndels) {\n      fillRect(\n        ctx,\n        leftPx,\n        topPx,\n        Math.abs(leftPx - rightPx),\n        heightPx,\n        canvasWidth,\n        colorForBase.deletion,\n      )\n      const txt = `${mismatch.length}`\n      const rwidth = measureText(txt, 10)\n      if (widthPx >= rwidth && heightPx >= heightLim) {\n        ctx.fillStyle = contrastForBase.deletion!\n        ctx.fillText(txt, (leftPx + rightPx) / 2 - rwidth / 2, topPx + heightPx)\n      }\n    } else if (mismatch.type === 'insertion' && drawIndels) {\n      ctx.fillStyle = 'purple'\n      const pos = leftPx + extraHorizontallyFlippedOffset\n      const len = +mismatch.base || mismatch.length\n      const insW = Math.max(0, Math.min(1.2, 1 / bpPerPx))\n      if (len < 10) {\n        fillRect(ctx, pos, topPx, insW, heightPx, canvasWidth, 'purple')\n        if (1 / bpPerPx >= charWidth && heightPx >= heightLim) {\n          const l = pos - insW\n          fillRect(ctx, l, topPx, insW * 3, 1, canvasWidth)\n          fillRect(ctx, l, topPx + heightPx - 1, insW * 3, 1, canvasWidth)\n          ctx.fillText(`(${mismatch.base})`, pos + 3, topPx + heightPx)\n        }\n      }\n    } else if (mismatch.type === 'hardclip' || mismatch.type === 'softclip') {\n      const pos = leftPx + extraHorizontallyFlippedOffset\n      const c = mismatch.type === 'hardclip' ? 'red' : 'blue'\n      const clipW = Math.max(minSubfeatureWidth, pxPerBp)\n      fillRect(ctx, pos, topPx, clipW, heightPx, canvasWidth, c)\n      if (1 / bpPerPx >= charWidth && heightPx >= heightLim) {\n        const l = pos - clipW\n        fillRect(ctx, l, topPx, clipW * 3, 1, canvasWidth)\n        fillRect(ctx, l, topPx + heightPx - 1, clipW * 3, 1, canvasWidth)\n        ctx.fillText(`(${mismatch.base})`, pos + 3, topPx + heightPx)\n      }\n    } else if (mismatch.type === 'skip') {\n      // fix to avoid bad rendering note that this was also related to chrome\n      // bug https://bugs.chromium.org/p/chromium/issues/detail?id=1131528\n      // also affected firefox ref #1236 #2750\n      if (leftPx + widthPx > 0) {\n        // make small exons more visible when zoomed far out\n        const adjustPx = widthPx - (bpPerPx > 10 ? 1.5 : 0)\n        ctx.clearRect(leftPx, topPx, adjustPx, heightPx)\n        fillRect(\n          ctx,\n          Math.max(0, leftPx),\n          topPx + heightPx / 2 - 1,\n          adjustPx + (leftPx < 0 ? leftPx : 0),\n          2,\n          canvasWidth,\n          '#333',\n        )\n      }\n    }\n  }\n\n  // second pass, draw wide insertion markers on top\n  if (drawIndels) {\n    for (const mismatch of mismatches) {\n      const mstart = start + mismatch.start\n      const mlen = mismatch.length\n      const [leftPx] = bpSpanPx(mstart, mstart + mlen, region, bpPerPx)\n      const len = +mismatch.base || mismatch.length\n      const txt = `${len}`\n      if (mismatch.type === 'insertion' && len >= 10) {\n        if (bpPerPx > largeInsertionIndicatorScale) {\n          fillRect(ctx, leftPx - 1, topPx, 2, heightPx, canvasWidth, 'purple')\n        } else if (heightPx > charHeight) {\n          const rwidth = measureText(txt)\n          const padding = 5\n          fillRect(\n            ctx,\n            leftPx - rwidth / 2 - padding,\n            topPx,\n            rwidth + 2 * padding,\n            heightPx,\n            canvasWidth,\n            'purple',\n          )\n          ctx.fillStyle = 'white'\n          ctx.fillText(txt, leftPx - rwidth / 2, topPx + heightPx)\n        } else {\n          const padding = 2\n          fillRect(\n            ctx,\n            leftPx - padding,\n            topPx,\n            2 * padding,\n            heightPx,\n            canvasWidth,\n            'purple',\n          )\n        }\n      }\n    }\n  }\n}\n","import {\n  AnyConfigurationModel,\n  readConfObject,\n} from '@jbrowse/core/configuration'\nimport { bpSpanPx } from '@jbrowse/core/util'\nimport { Theme } from '@mui/material'\n\n// locals\nimport { Mismatch, parseCigar } from '../MismatchParser'\nimport { RenderArgsDeserializedWithFeaturesAndLayout } from './PileupRenderer'\nimport { fillRect, getCharWidthHeight, LayoutFeature } from './util'\n\nexport function renderSoftClipping({\n  ctx,\n  feat,\n  renderArgs,\n  config,\n  theme,\n  colorForBase,\n  canvasWidth,\n}: {\n  ctx: CanvasRenderingContext2D\n  feat: LayoutFeature\n  renderArgs: RenderArgsDeserializedWithFeaturesAndLayout\n  config: AnyConfigurationModel\n  colorForBase: Record<string, string>\n  theme: Theme\n  canvasWidth: number\n}) {\n  const { feature, topPx, heightPx } = feat\n  const { regions, bpPerPx } = renderArgs\n  const region = regions[0]!\n  const minFeatWidth = readConfObject(config, 'minSubfeatureWidth')\n  const mismatches = feature.get('mismatches') as Mismatch[] | undefined\n  const seq = feature.get('seq') as string | undefined\n  const { charWidth, charHeight } = getCharWidthHeight()\n\n  // Display all bases softclipped off in lightened colors\n  if (!(seq && mismatches)) {\n    return\n  }\n\n  const heightLim = charHeight - 2\n  const CIGAR = parseCigar(feature.get('CIGAR'))\n  let seqOffset = 0\n  let refOffset = 0\n  for (let i = 0; i < CIGAR.length; i += 2) {\n    const op = CIGAR[i + 1]!\n    const len = +CIGAR[i]!\n    if (op === 'S') {\n      for (let k = 0; k < len; k++) {\n        const base = seq[seqOffset + k]!\n        const s0 = feature.get('start') - (i === 0 ? len : 0) + refOffset + k\n        const [leftPx, rightPx] = bpSpanPx(s0, s0 + 1, region, bpPerPx)\n        const widthPx = Math.max(minFeatWidth, rightPx - leftPx)\n\n        // Black accounts for IUPAC ambiguity code bases such as N that\n        // show in soft clipping\n        const baseColor = colorForBase[base] || '#000000'\n        ctx.fillStyle = baseColor\n        fillRect(ctx, leftPx, topPx, widthPx, heightPx, canvasWidth)\n\n        if (widthPx >= charWidth && heightPx >= heightLim) {\n          ctx.fillStyle = theme.palette.getContrastText(baseColor)\n          ctx.fillText(\n            base,\n            leftPx + (widthPx - charWidth) / 2 + 1,\n            topPx + heightPx,\n          )\n        }\n      }\n      seqOffset += len\n    }\n    if (op === 'N') {\n      refOffset += len\n    }\n    if (op === 'M' || op === '=' || op === 'X') {\n      refOffset += len\n      seqOffset += len\n    }\n    if (op === 'H') {\n      // do nothing\n    }\n    if (op === 'D') {\n      refOffset += len\n    }\n    if (op === 'I') {\n      seqOffset += len\n    }\n  }\n}\n","import { Feature } from '@jbrowse/core/util'\nimport { RenderArgsDeserializedWithFeaturesAndLayout } from './PileupRenderer'\nimport { readConfObject } from '@jbrowse/core/configuration'\nimport { createJBrowseTheme } from '@jbrowse/core/ui'\nimport {\n  getCharWidthHeight,\n  getColorBaseMap,\n  getContrastBaseMap,\n  shouldDrawIndels,\n  shouldDrawSNPsMuted,\n} from './util'\nimport { renderAlignment } from './renderAlignment'\nimport { renderMismatches } from './renderMismatches'\nimport { renderSoftClipping } from './renderSoftClipping'\n\nexport type RenderArgsWithColor = RenderArgsDeserializedWithFeaturesAndLayout\n\ninterface LayoutFeature {\n  heightPx: number\n  topPx: number\n  feature: Feature\n}\n\nexport function makeImageData({\n  ctx,\n  layoutRecords,\n  canvasWidth,\n  renderArgs,\n}: {\n  ctx: CanvasRenderingContext2D\n  canvasWidth: number\n  layoutRecords: LayoutFeature[]\n  renderArgs: RenderArgsWithColor\n}) {\n  const { config, showSoftClip, colorBy, theme: configTheme } = renderArgs\n  const mismatchAlpha = readConfObject(config, 'mismatchAlpha')\n  const minSubfeatureWidth = readConfObject(config, 'minSubfeatureWidth')\n  const largeInsertionIndicatorScale = readConfObject(\n    config,\n    'largeInsertionIndicatorScale',\n  )\n  const defaultColor = readConfObject(config, 'color') === '#f0f'\n  const theme = createJBrowseTheme(configTheme)\n  const colorForBase = getColorBaseMap(theme)\n  const contrastForBase = getContrastBaseMap(theme)\n  ctx.font = 'bold 10px Courier New,monospace'\n\n  const { charWidth, charHeight } = getCharWidthHeight()\n  const drawSNPsMuted = shouldDrawSNPsMuted(colorBy?.type)\n  const drawIndels = shouldDrawIndels()\n  for (const feat of layoutRecords) {\n    renderAlignment({\n      ctx,\n      feat,\n      renderArgs,\n      defaultColor,\n      colorForBase,\n      contrastForBase,\n      charWidth,\n      charHeight,\n      canvasWidth,\n    })\n    renderMismatches({\n      ctx,\n      feat,\n      renderArgs,\n      mismatchAlpha,\n      drawSNPsMuted,\n      drawIndels,\n      largeInsertionIndicatorScale,\n      minSubfeatureWidth,\n      charWidth,\n      charHeight,\n      colorForBase,\n      contrastForBase,\n      canvasWidth,\n    })\n    if (showSoftClip) {\n      renderSoftClipping({\n        ctx,\n        feat,\n        renderArgs,\n        colorForBase,\n        config,\n        theme,\n        canvasWidth,\n      })\n    }\n  }\n  return undefined\n}\n"],"names":["fillRect","ctx","l","t","w","h","cw","color","fillStyle","getColorBaseMap","theme","bases","palette","A","main","C","G","T","deletion","getCharWidthHeight","charWidth","measureText","charHeight","getAlignmentShapeColor","colorType","tag","feature","config","defaultColor","colorTagMap","get","Math","abs","colorByInsertSize","colorByStrand","colorByMappingQuality","fillColor","orientationType","readConfObject","LR","RR","RL","LL","orientationTypes","getOrientation","colorByOrientation","flags","strand","flipper","getStranded","colorByStrandedRnaSeq","tags","val","color_rev_strand","color_fwd_strand","color_nostrand","renderAlignment","feat","renderArgs","colorForBase","contrastForBase","canvasWidth","bpPerPx","regions","colorBy","type","region","heightPx","topPx","s","e","leftPx","rightPx","bpSpanPx","flip","reversed","beginPath","moveTo","lineTo","closePath","fill","renderAlignmentShape","scores","split","map","cigarOps","parseCigar","start","soffset","roffset","i","length","len","op","m","score","start0","renderPerBaseQuality","heightLim","seq","letter","r","fillText","renderPerBaseLettering","modificationTagMap","mm","getTagAlt","cigar","probabilities","getModificationProbabilities","modifications","getModificationPositions","probIndex","positions","col","base","colord","readPos","getNextRefPos","prob","alpha","toHslString","renderModifications","regionSequence","Error","fstart","fend","methBins","methProbs","getMethBins","getCol","k","p","j","l1","toLowerCase","l2","leftPx2","rightPx2","renderMethylation","renderMismatches","minSubfeatureWidth","largeInsertionIndicatorScale","mismatchAlpha","drawSNPsMuted","drawIndels","pxPerBp","min","mismatches","extraHorizontallyFlippedOffset","mismatch","mstart","mlen","mbase","widthPx","max","baseColor","c","undefined","qual","round","contrastColor","txt","rwidth","pos","insW","clipW","adjustPx","clearRect","padding","renderSoftClipping","minFeatWidth","CIGAR","seqOffset","refOffset","s0","getContrastText","makeImageData","layoutRecords","showSoftClip","configTheme","createJBrowseTheme","Object","fromEntries","entries","key","value","getContrastBaseMap","font","includes"],"sourceRoot":""}