@platforma-open/milaboratories.top-antibodies 4.3.1 → 4.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,6 @@
3
3
  "id": {
4
4
  "organization": "milaboratories",
5
5
  "name": "top-antibodies",
6
- "version": "4.3.1"
6
+ "version": "4.3.2"
7
7
  }
8
8
  }
package/block-pack/ui.tgz CHANGED
Binary file
package/dist/index.js CHANGED
@@ -13996,13 +13996,57 @@ function computeDefaultFilters(scores, anchorRef) {
13996
13996
  }
13997
13997
  return defaultFilters;
13998
13998
  }
13999
+ /**
14000
+ * Which pipeline produced the anchor's records, from the run-id key on its record axis:
14001
+ *
14002
+ * pl7.app/peptide/extractionRunId peptide-extraction
14003
+ * pl7.app/repertoire/extractionRunId synthetic-repertoire-profiler
14004
+ * pl7.app/vdj/clonotypingRunId MiXCR, and import-vdj-data's imported sets
14005
+ *
14006
+ * Reads the domain, not the axis name: clonotypeKey and scClonotypeKey are migrating to
14007
+ * pl7.app/variantKey, after which the name discriminates nothing. The axis-name checks below are
14008
+ * a fallback for producers that have not migrated yet.
14009
+ *
14010
+ * Does not say how a receptor dataset arrived. Uploaded sequences and MiXCR output are both
14011
+ * `vdj`. Whether specific columns exist is a separate question — see {@link hasGeneCalls}.
14012
+ */
14013
+ function recordSource(anchorSpec) {
14014
+ const keyAxis = anchorSpec.axesSpec[1];
14015
+ if (keyAxis === void 0) return "unknown";
14016
+ const domain = keyAxis.domain ?? {};
14017
+ if (domain["pl7.app/peptide/extractionRunId"] !== void 0) return "peptide";
14018
+ if (domain["pl7.app/repertoire/extractionRunId"] !== void 0) return "amplicon";
14019
+ if (domain["pl7.app/vdj/clonotypingRunId"] !== void 0) return "vdj";
14020
+ if (keyAxis.name === "pl7.app/vdj/clonotypeKey" || keyAxis.name === "pl7.app/vdj/scClonotypeKey") return "vdj";
14021
+ return "unknown";
14022
+ }
14023
+ /** True for the two producers whose records are peptides or synthetic variants, not receptors. */
14024
+ function isPeptideOrAmplicon(anchorSpec) {
14025
+ const source = recordSource(anchorSpec);
14026
+ return source === "peptide" || source === "amplicon";
14027
+ }
14028
+ /**
14029
+ * Whether the dataset carries V/J gene calls — needed by CDR3 V Spectratype, V/J Gene Usage and
14030
+ * Kabat renumbering.
14031
+ *
14032
+ * Separate from {@link recordSource} on purpose: an uploaded set and a MiXCR set are both `vdj`,
14033
+ * but only MiXCR's has gene calls.
14034
+ *
14035
+ * TEMPORARY. This infers from the axis, and no variantKey producer emits gene calls today. When
14036
+ * MiXCR migrates to that axis this returns false for MiXCR too and both sections silently
14037
+ * disappear. Nothing structural separates the cases then — same axis name, same
14038
+ * clonotypingRunId — so replace it with a result-pool query for the gene columns.
14039
+ */
14040
+ function hasGeneCalls(anchorSpec) {
14041
+ return anchorSpec.axesSpec[1]?.name !== "pl7.app/variantKey";
14042
+ }
13999
14043
  function computePresets(scores, defaultFilters, anchorRef, anchorSpec) {
14000
- const isPeptide = anchorSpec.axesSpec[1]?.name === "pl7.app/variantKey";
14044
+ const usesPeptidePreset = isPeptideOrAmplicon(anchorSpec);
14001
14045
  const repertoireScore = scores.find((s) => s.getSpec().name === REPERTOIRE_SCORE_COLUMN_NAME);
14002
14046
  const hasRepertoireScore = repertoireScore !== void 0;
14003
14047
  const isEnrichmentColumn = (name) => name.startsWith("pl7.app/enrichment") || name.startsWith("pl7.app/vdj/enrichment");
14004
14048
  const hasEnrichmentScores = scores.some((s) => isEnrichmentColumn(s.getSpec().name));
14005
- const detectedPreset = isPeptide ? "peptide" : hasRepertoireScore ? "in-vivo" : hasEnrichmentScores ? "in-vitro" : void 0;
14049
+ const detectedPreset = usesPeptidePreset ? "peptide" : hasRepertoireScore ? "in-vivo" : hasEnrichmentScores ? "in-vitro" : void 0;
14006
14050
  const defaultRankingOrder = scores.filter((s) => s.getSpec().valueType !== "String").filter((s) => !hasRepertoireScore || s.getSpec().name !== "pl7.app/vdj/repertoireScore").filter((s) => !hasRepertoireScore || !IN_VIVO_MUTATION_COLUMNS.has(s.getSpec().name)).map((s) => ({
14007
14051
  id: `default-rank-${s.id}`,
14008
14052
  value: matchToColumnId(s, anchorRef),
@@ -14587,7 +14631,7 @@ const platforma$1 = BlockModelV3.create({
14587
14631
  }, { retentive: true }).output("modality", (ctx) => {
14588
14632
  const spec = getSpecByRef(getInputAnchorRef(ctx.data));
14589
14633
  if (!spec) return void 0;
14590
- return spec.axesSpec[1]?.name === "pl7.app/variantKey" ? "peptide" : "antibody_tcr";
14634
+ return isPeptideOrAmplicon(spec) ? "peptide" : "antibody_tcr";
14591
14635
  }, { retentive: true }).output("filterConfig", (ctx) => {
14592
14636
  const inputAnchor = getInputAnchorRef(ctx.data);
14593
14637
  const result = buildCollection(inputAnchor);
@@ -14871,9 +14915,9 @@ const platforma$1 = BlockModelV3.create({
14871
14915
  if (numbered === 0) return "Kabat numbering could not be applied to any clonotype. The framework regions may be too divergent from known germline sequences. Kabat sequence columns will be empty.";
14872
14916
  return `Kabat numbering was applied to ${numbered.toLocaleString()} clonotype${numbered === 1 ? "" : "s"}. Clonotypes that could not be numbered will have empty Kabat sequence columns.`;
14873
14917
  }).output("isRunning", (ctx) => ctx.outputs?.getIsReadyOrError() === false).title(() => "Lead Selection").subtitle((ctx) => ctx.data.customBlockLabel || ctx.data.defaultBlockLabel).sections((ctx) => {
14874
- const keyAxis = getSpecByRef(getInputAnchorRef(ctx.data))?.axesSpec[1];
14875
- const isPeptide = keyAxis?.name === "pl7.app/variantKey";
14876
- const spaceLabel = isPeptide && keyAxis?.domain?.["pl7.app/repertoire/extractionRunId"] !== void 0 ? "Variant Space" : isPeptide ? "Peptide Space" : "Clonotype Space";
14918
+ const anchorSpec = getSpecByRef(getInputAnchorRef(ctx.data));
14919
+ const source = anchorSpec !== void 0 ? recordSource(anchorSpec) : "unknown";
14920
+ const spaceLabel = source === "amplicon" ? "Variant Space" : source === "peptide" ? "Peptide Space" : "Clonotype Space";
14877
14921
  const sections = [
14878
14922
  {
14879
14923
  type: "link",
@@ -14891,7 +14935,7 @@ const platforma$1 = BlockModelV3.create({
14891
14935
  label: "Selection Plot"
14892
14936
  }
14893
14937
  ];
14894
- if (!isPeptide) sections.push({
14938
+ if (anchorSpec !== void 0 && hasGeneCalls(anchorSpec)) sections.push({
14895
14939
  type: "link",
14896
14940
  href: "/spectratype",
14897
14941
  label: "CDR3 V Spectratype"