@platforma-open/milaboratories.generation-probability.block 1.0.0 → 1.1.0

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.
package/dist/index.js CHANGED
@@ -12539,20 +12539,16 @@ const SPECIES_OPTIONS = [{
12539
12539
  }];
12540
12540
  const PGEN_NAME = "pl7.app/vdj/generationProbability";
12541
12541
  const CHAIN_NAME = "pl7.app/vdj/chain";
12542
- const inputSelectors = [
12543
- {
12544
- axes: [{ name: "pl7.app/vdj/clonotypeKey" }],
12545
- annotations: { "pl7.app/isAnchor": "true" }
12546
- },
12547
- {
12548
- axes: [{ name: "pl7.app/vdj/scClonotypeKey" }],
12549
- annotations: { "pl7.app/isAnchor": "true" }
12550
- },
12551
- {
12552
- axes: [{ name: "pl7.app/variantKey" }],
12553
- annotations: { "pl7.app/isAnchor": "true" }
12554
- }
12542
+ const ENTITY_KEY_NAMES = [
12543
+ "pl7.app/vdj/clonotypeKey",
12544
+ "pl7.app/vdj/scClonotypeKey",
12545
+ "pl7.app/variantKey"
12555
12546
  ];
12547
+ const inputSelectors = ENTITY_KEY_NAMES.map((name) => ({
12548
+ axes: [{ name }],
12549
+ annotations: { "pl7.app/isAnchor": "true" }
12550
+ }));
12551
+ const keyAxisOf = (spec) => spec.axesSpec.find((axis) => ENTITY_KEY_NAMES.includes(axis.name));
12556
12552
  const dataModel = new DataModelBuilder().from("v1").init(() => ({
12557
12553
  datasetLabel: "",
12558
12554
  tableState: createPlDataTableStateV2(),
@@ -12573,14 +12569,19 @@ const platforma$1 = BlockModelV3.create(dataModel).args((data) => {
12573
12569
  };
12574
12570
  }).output("inputOptions", () => {
12575
12571
  const collection = ColumnsCollection(["result_pool"]).filter({ include: inputSelectors });
12576
- const scorableIds = new Set(collection.getColumns().filter((anchor) => !ColumnsCollection(["result_pool"]).discover({
12577
- anchors: { main: anchor.getSpec() },
12578
- include: [{ name: [{
12579
- type: "exact",
12580
- value: CHAIN_NAME
12581
- }] }],
12582
- mode: "enrichment"
12583
- }).isEmpty()).map((anchor) => anchor.id));
12572
+ const scorableIds = new Set(collection.getColumns().filter((anchor) => {
12573
+ const keyAxis = keyAxisOf(anchor.getSpec());
12574
+ const keyDomain = keyAxis?.domain ?? {};
12575
+ if (keyAxis?.name === "pl7.app/variantKey" && keyDomain["pl7.app/vdj/clonotypingRunId"] !== void 0) return keyDomain["pl7.app/vdj/chain"] !== void 0 || keyDomain["pl7.app/vdj/receptor"] !== void 0;
12576
+ return !ColumnsCollection(["result_pool"]).discover({
12577
+ anchors: { main: anchor.getSpec() },
12578
+ include: [{ name: [{
12579
+ type: "exact",
12580
+ value: CHAIN_NAME
12581
+ }] }],
12582
+ mode: "enrichment"
12583
+ }).isEmpty();
12584
+ }).map((anchor) => anchor.id));
12584
12585
  return deriveColumnOptions(collection).filter(({ id }) => scorableIds.has(id)).map(({ id, label }) => ({
12585
12586
  value: id,
12586
12587
  label