@molgenis/vip-report-template 3.0.0-beta2 → 3.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molgenis/vip-report-template",
3
- "version": "3.0.0-beta2",
3
+ "version": "3.0.0",
4
4
  "description": "Report Template for Variant Call Format (VCF) Report Generator",
5
5
  "scripts": {
6
6
  "build": "vite build",
@@ -1,8 +1,8 @@
1
- import { Component } from "solid-js";
1
+ import { Component, JSXElement } from "solid-js";
2
2
 
3
3
  export const Anchor: Component<{
4
4
  href: string;
5
- value: string | number;
5
+ value: string | number | JSXElement;
6
6
  }> = (props) => {
7
7
  return (
8
8
  <a href={props.href} target="_blank" rel="noopener noreferrer nofollow">
@@ -2,6 +2,7 @@ import { Link } from "solid-app-router";
2
2
  import { Component, createMemo, For, Show } from "solid-js";
3
3
  import { Item, Phenotype, PhenotypicFeature, Sample } from "@molgenis/vip-report-api/src/Api";
4
4
  import { HpoTerm } from "./record/info/HpoTerm";
5
+ import { Anchor } from "./Anchor";
5
6
 
6
7
  function getAffectedStatusLabel(affectedStatus: string) {
7
8
  let label;
@@ -96,15 +97,14 @@ export const SampleTable: Component<{
96
97
  </td>
97
98
  <td>
98
99
  <Show when={getPhenotypes(sample.data.person.individualId).length > 0}>
99
- <Link
100
+ <Anchor
100
101
  href={`https://vibe.molgeniscloud.org/?phenotypes=${getPhenotypes(
101
102
  sample.data.person.individualId
102
103
  )
103
104
  .map((feature) => feature.type.id)
104
105
  .join(",")}`}
105
- >
106
- <i class="fas fa-external-link" />
107
- </Link>
106
+ value={<i class="fas fa-external-link" />}
107
+ />
108
108
  </Show>
109
109
  </td>
110
110
  </tr>
@@ -1,9 +1,12 @@
1
1
  import { Component, For } from "solid-js";
2
2
  import { FieldMetadataContainer, InfoContainer } from "@molgenis/vip-report-vcf/src/VcfParser";
3
+ import { Info } from "./record/Info";
4
+ import { Record } from "@molgenis/vip-report-vcf/src/Vcf";
3
5
 
4
- export const VariantInfoTable: Component<{ infoValues: InfoContainer; infoFields: FieldMetadataContainer }> = (
5
- props
6
- ) => {
6
+ export const VariantInfoTable: Component<{
7
+ infoFields: FieldMetadataContainer;
8
+ record: Record;
9
+ }> = (props) => {
7
10
  return (
8
11
  <div style={{ display: "grid" }}>
9
12
  {/* workaround for https://github.com/jgthms/bulma/issues/2572#issuecomment-523099776 */}
@@ -12,13 +15,15 @@ export const VariantInfoTable: Component<{ infoValues: InfoContainer; infoFields
12
15
  <tbody>
13
16
  <For
14
17
  each={Object.values(props.infoFields).filter(
15
- (info) => !info.nested && props.infoValues[info.id] !== undefined
18
+ (info) => !info.nested && props.record.n[info.id] !== undefined
16
19
  )}
17
20
  >
18
21
  {(infoField) => (
19
22
  <tr>
20
23
  <td>{infoField.id}</td>
21
- <td>{props.infoValues[infoField.id] as string}</td>
24
+ <td>
25
+ <Info variant={props.record} info={props.record.n[infoField.id]} infoMetadata={infoField}></Info>
26
+ </td>
22
27
  </tr>
23
28
  )}
24
29
  </For>
@@ -109,7 +109,12 @@ export const VariantsTable: Component<{
109
109
  {(value, j) => (
110
110
  <>
111
111
  {j() !== 0 && <br />}
112
- <Info info={value[i()]} infoMetadata={infoFieldNested} variant={record.data} />
112
+ <Info
113
+ info={value[i()]}
114
+ infoMetadata={infoFieldNested}
115
+ variant={record.data}
116
+ href={`/variants/${record.id}/consequences/${j()}`}
117
+ />
113
118
  </>
114
119
  )}
115
120
  </For>
@@ -16,6 +16,12 @@ export const FilterCategorical: Component<{
16
16
  onClear: (event: FilterClearEvent) => void;
17
17
  }> = (props) => {
18
18
  const group: CheckboxGroup = {};
19
+ if (props.query !== undefined) {
20
+ (props.query?.args as string[]).forEach((key) => {
21
+ group[key] = true;
22
+ });
23
+ }
24
+
19
25
  const nullValue = "__null";
20
26
 
21
27
  // enable null category for any_has_any case if someone asks for it (requires query to be composed)
@@ -136,7 +136,7 @@ export const samplesFamily = {
136
136
  paternalId: "0",
137
137
  maternalId: "0",
138
138
  sex: "MALE",
139
- affectedStatus: "AFFECTED",
139
+ affectedStatus: "UNAFFECTED",
140
140
  },
141
141
  index: 1,
142
142
  proband: false,
@@ -175,18 +175,5 @@ export const samplesFamily = {
175
175
  id: "MotherHasQuiteALongName",
176
176
  },
177
177
  },
178
- {
179
- phenotypicFeaturesList: [
180
- {
181
- type: {
182
- id: "HP:0000951",
183
- label: "HP:0000951",
184
- },
185
- },
186
- ],
187
- subject: {
188
- id: "Father",
189
- },
190
- },
191
178
  ],
192
179
  };
@@ -15,6 +15,7 @@ import { SampleVariantRouteData } from "./data/SampleVariantData";
15
15
  import { getSampleLabel } from "../utils/sample";
16
16
  import { Item, Sample } from "@molgenis/vip-report-api/src/Api";
17
17
  import { Metadata, Record } from "@molgenis/vip-report-vcf/src/Vcf";
18
+ import { Abbr } from "../components/Abbr";
18
19
 
19
20
  export const SampleVariantView: Component = () => {
20
21
  const { sample, variant } = useRouteData<SampleVariantRouteData>();
@@ -75,7 +76,7 @@ export const SampleVariant: Component<{
75
76
  >
76
77
  <div class="column is-3">
77
78
  <h1 class="title is-5">Info</h1>
78
- <VariantInfoTable infoValues={props.record.data.n} infoFields={props.recordsMeta.info} />
79
+ <VariantInfoTable infoFields={props.recordsMeta.info} record={props.record.data} />
79
80
  </div>
80
81
  </Show>
81
82
  <div class="column">
@@ -98,7 +99,9 @@ export const SampleVariant: Component<{
98
99
  {(infoField) => (
99
100
  <>
100
101
  <h1 class="title is-5">{infoField.id}</h1>
101
- <p class="mb-4">{infoField.description}</p>
102
+ <p class="mb-4">
103
+ <Abbr value={infoField.description as string} title={infoField.description as string} />
104
+ </p>
102
105
  <VariantInfoNestedTable
103
106
  infoValue={props.record.data.n[infoField.id] as unknown as Value[][]}
104
107
  infoField={infoField}
@@ -84,7 +84,7 @@ export const SampleVariantConsequence: Component<{
84
84
  </div>
85
85
  <div class="column is-3">
86
86
  <h1 class="title is-5">Info</h1>
87
- <VariantInfoTable infoValues={props.variant.data.n} infoFields={props.recordsMeta.info} />
87
+ <VariantInfoTable infoFields={props.recordsMeta.info} record={props.variant.data} />
88
88
  </div>
89
89
  <div class="column">
90
90
  <h1 class="title is-5">Samples</h1>
@@ -70,7 +70,7 @@ export const SampleVariants: Component<{
70
70
 
71
71
  if (getStateVariants()?.filterQueries === undefined) {
72
72
  const hpoField = props.recordsMeta.info?.CSQ?.nested?.items?.find((field) => field.id === "HPO");
73
- if (hpoField) {
73
+ if (hpoField && props.samplePhenotypes.length > 0) {
74
74
  actions.setSampleVariantsFilterQuery(props.sample, {
75
75
  selector: infoSelector(hpoField),
76
76
  operator: "any_has_any",
@@ -15,7 +15,7 @@ export const Samples: Component = () => {
15
15
  const onSearchChange = (search: string) =>
16
16
  setParams({
17
17
  page: 0,
18
- query: search !== "" ? { selector: ["person", "individualId"], operator: "==", args: search } : undefined,
18
+ query: search !== "" ? { selector: ["person", "individualId"], operator: "~=", args: search } : undefined,
19
19
  });
20
20
  const onProbandFilterChange = (event: CheckboxEvent) => {
21
21
  setParams({
@@ -35,7 +35,7 @@ export const Variant: Component = () => {
35
35
  >
36
36
  <div class="column is-3">
37
37
  <h1 class="title is-5">Info</h1>
38
- <VariantInfoTable infoValues={variant().data.n} infoFields={recordsMetadata().info} />
38
+ <VariantInfoTable infoFields={recordsMetadata().info} record={variant().data} />
39
39
  </div>
40
40
  </Show>
41
41
  </div>
@@ -61,7 +61,7 @@ export const VariantConsequence: Component = () => {
61
61
  </div>
62
62
  <div class="column">
63
63
  <h1 class="title is-5">Info</h1>
64
- <VariantInfoTable infoValues={variant().data.n} infoFields={recordsMetadata().info} />
64
+ <VariantInfoTable infoFields={recordsMetadata().info} record={variant().data} />
65
65
  </div>
66
66
  </div>
67
67
  </Show>