@molgenis/vip-report-template 5.5.5 → 5.7.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/.nvmrc +1 -0
- package/.travis.yml +0 -2
- package/package.json +22 -22
- package/src/App.tsx +7 -0
- package/src/components/filter/Filter.tsx +12 -0
- package/src/components/filter/FilterCategorical.tsx +26 -19
- package/src/components/filter/FilterGene.tsx +34 -0
- package/src/components/filter/FilterHpo.tsx +33 -27
- package/src/components/filter/FilterInheritance.tsx +39 -9
- package/src/components/filter/FilterIntegerDp.tsx +19 -4
- package/src/components/filter/FilterIntegerGq.tsx +19 -4
- package/src/components/filter/FilterVI.tsx +68 -0
- package/src/components/filter/FilterVariantType.tsx +148 -0
- package/src/components/filter/InfoFilter.tsx +1 -13
- package/src/components/filter/InfoFilters.tsx +4 -1
- package/src/components/filter/SampleFilters.tsx +26 -2
- package/src/components/record/RecordDownload.tsx +21 -2
- package/src/components/record/info/GnomAD.tsx +33 -28
- package/src/components/record/info/InheritanceModes.tsx +2 -2
- package/src/mocks/GRCh37/vcf/family.vcf.blob +7 -6
- package/src/utils/ApiUtils.ts +6 -1
- package/src/views/Help.tsx +13 -0
- package/src/views/SampleVariants.tsx +52 -5
- package/src/views/data/SampleData.tsx +2 -0
- package/src/views/data/SampleVariantConsequenceData.tsx +1 -0
- package/src/views/data/SampleVariantData.tsx +1 -0
- package/src/views/data/VariantConsequenceData.tsx +1 -0
- package/src/views/data/VariantData.tsx +1 -0
- package/tsconfig.json +1 -1
- package/{vite.config.ts → vite.config.mts} +2 -2
|
@@ -158,9 +158,24 @@ export const SampleVariants: Component<{
|
|
|
158
158
|
actions.setSampleVariantsFilterQuery(
|
|
159
159
|
props.sample,
|
|
160
160
|
{
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
161
|
+
operator: "or",
|
|
162
|
+
args: [
|
|
163
|
+
{
|
|
164
|
+
selector: selectorGq,
|
|
165
|
+
operator: ">=",
|
|
166
|
+
args: 20,
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
selector: selectorGq,
|
|
170
|
+
operator: "==",
|
|
171
|
+
args: null,
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
selector: selectorGq,
|
|
175
|
+
operator: "==",
|
|
176
|
+
args: undefined,
|
|
177
|
+
},
|
|
178
|
+
],
|
|
164
179
|
},
|
|
165
180
|
selectorKey(selectorGq),
|
|
166
181
|
);
|
|
@@ -173,6 +188,19 @@ export const SampleVariants: Component<{
|
|
|
173
188
|
selectorKey(["s", props.sample.data.index, ...selector(viabField)]),
|
|
174
189
|
);
|
|
175
190
|
}
|
|
191
|
+
const viField = props.recordsMeta.format?.VI;
|
|
192
|
+
if (viField) {
|
|
193
|
+
const selectorVi = sampleSelector(props.sample, viField);
|
|
194
|
+
actions.setSampleVariantsFilterQuery(
|
|
195
|
+
props.sample,
|
|
196
|
+
{
|
|
197
|
+
selector: selectorVi,
|
|
198
|
+
operator: "has_any",
|
|
199
|
+
args: ["AD", "AR", "AR_C", "XLD", "XLR"],
|
|
200
|
+
},
|
|
201
|
+
selectorKey(selectorVi),
|
|
202
|
+
);
|
|
203
|
+
}
|
|
176
204
|
}
|
|
177
205
|
|
|
178
206
|
if (getStateVariants()?.sort === undefined) {
|
|
@@ -213,12 +241,31 @@ export const SampleVariants: Component<{
|
|
|
213
241
|
|
|
214
242
|
const formatFields = createMemo(() => {
|
|
215
243
|
const formatFieldMap = props.recordsMeta.format;
|
|
216
|
-
const includedFields = ["VIM", "VID", "GQ", "VIAB", "GT", "DP"];
|
|
244
|
+
const includedFields = ["VIM", "VID", "VI", "GQ", "VIAB", "GT", "DP"];
|
|
217
245
|
return formatFieldMap
|
|
218
246
|
? includedFields.map((fieldId) => formatFieldMap[fieldId]).filter((field) => field !== undefined)
|
|
219
247
|
: [];
|
|
220
248
|
});
|
|
221
249
|
|
|
250
|
+
const filterInfoFields = createMemo(() => {
|
|
251
|
+
const csqNestedFields = props.recordsMeta.info.CSQ?.nested?.items;
|
|
252
|
+
const includedFields = [];
|
|
253
|
+
const additionalCsqFieldsIds = ["IncompletePenetrance"];
|
|
254
|
+
const filterInfoFieldsIds = ["SVTYPE"];
|
|
255
|
+
const additionalCsqFields = csqNestedFields
|
|
256
|
+
? (additionalCsqFieldsIds
|
|
257
|
+
.map((fieldId) => csqNestedFields.find((field) => field.id === fieldId))
|
|
258
|
+
.filter((field) => field !== undefined) as FieldMetadata[])
|
|
259
|
+
: [];
|
|
260
|
+
const filterInfoFields = filterInfoFieldsIds
|
|
261
|
+
.map((fieldId) => props.recordsMeta.info[fieldId])
|
|
262
|
+
.filter((field) => field !== undefined);
|
|
263
|
+
includedFields.push(...infoFields());
|
|
264
|
+
includedFields.push(...additionalCsqFields);
|
|
265
|
+
includedFields.push(...filterInfoFields);
|
|
266
|
+
return includedFields;
|
|
267
|
+
});
|
|
268
|
+
|
|
222
269
|
const page = () => getStateVariants()?.page;
|
|
223
270
|
const pageSize = () => getStateVariants()?.pageSize;
|
|
224
271
|
const searchQuery = () => getStateVariants()?.searchQuery;
|
|
@@ -269,7 +316,7 @@ export const SampleVariants: Component<{
|
|
|
269
316
|
<div class="column is-1-fullhd is-2">
|
|
270
317
|
<SearchBox value={searchQuery()} onInput={onSearchChange} />
|
|
271
318
|
<Filters
|
|
272
|
-
fields={
|
|
319
|
+
fields={filterInfoFields()}
|
|
273
320
|
samplesFields={[{ sample: props.sample, fields: formatFields() }]}
|
|
274
321
|
queries={filterQueries()}
|
|
275
322
|
onChange={onFilterChange}
|
|
@@ -3,9 +3,11 @@ import { RouteDataFuncArgs } from "@solidjs/router/dist/types";
|
|
|
3
3
|
import { EMPTY_SAMPLE_ITEM, fetchSampleById } from "../../utils/ApiUtils";
|
|
4
4
|
import { Item, Sample } from "@molgenis/vip-report-api/src/Api";
|
|
5
5
|
|
|
6
|
+
export type SampleParams = { sampleId: string };
|
|
6
7
|
export type SampleRouteData = { sample: Resource<Item<Sample>> };
|
|
7
8
|
|
|
8
9
|
export default function SampleData({ params }: RouteDataFuncArgs): SampleRouteData {
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access
|
|
9
11
|
const [sample] = createResource(() => params.sampleId, fetchSampleById, { initialValue: EMPTY_SAMPLE_ITEM });
|
|
10
12
|
return { sample };
|
|
11
13
|
}
|
|
@@ -7,6 +7,7 @@ export default function SampleVariantConsequenceData({
|
|
|
7
7
|
params,
|
|
8
8
|
data,
|
|
9
9
|
}: RouteDataFuncArgs): SampleVariantConsequenceRouteData {
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
|
|
10
11
|
const consequenceId: number = parseInt(params.consequenceId);
|
|
11
12
|
return { ...(data as SampleVariantRouteData), consequenceId };
|
|
12
13
|
}
|
|
@@ -8,6 +8,7 @@ import { Record } from "@molgenis/vip-report-vcf/src/Vcf";
|
|
|
8
8
|
export type SampleVariantRouteData = SampleRouteData & { variant: Resource<Item<Record> | undefined> };
|
|
9
9
|
|
|
10
10
|
export default function SampleVariantData({ params, data }: RouteDataFuncArgs): SampleVariantRouteData {
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access
|
|
11
12
|
const [variant] = createResource(() => params.variantId, fetchRecordById);
|
|
12
13
|
return { ...(data as SampleRouteData), variant };
|
|
13
14
|
}
|
|
@@ -4,6 +4,7 @@ import { VariantRouteData } from "./VariantData";
|
|
|
4
4
|
export type VariantConsequenceRouteData = { consequenceId: number } & VariantRouteData;
|
|
5
5
|
|
|
6
6
|
export default function VariantConsequenceData({ params, data }: RouteDataFuncArgs): VariantConsequenceRouteData {
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
|
|
7
8
|
const consequenceId: number = parseInt(params.consequenceId);
|
|
8
9
|
return { ...(data as VariantRouteData), consequenceId };
|
|
9
10
|
}
|
|
@@ -7,6 +7,7 @@ import { Record } from "@molgenis/vip-report-vcf/src/Vcf";
|
|
|
7
7
|
export type VariantRouteData = { variant: Resource<Item<Record>> };
|
|
8
8
|
|
|
9
9
|
export default function VariantData({ params }: RouteDataFuncArgs): VariantRouteData {
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access
|
|
10
11
|
const [variant] = createResource(() => params.variantId, fetchRecordById, { initialValue: EMPTY_RECORD_ITEM });
|
|
11
12
|
return { variant };
|
|
12
13
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineConfig } from "vitest/config";
|
|
2
2
|
import solidPlugin from "vite-plugin-solid";
|
|
3
|
-
import inlinePlugin from "@molgenis/vite-plugin-inline
|
|
3
|
+
import inlinePlugin from "@molgenis/vite-plugin-inline";
|
|
4
4
|
|
|
5
5
|
export default defineConfig({
|
|
6
6
|
plugins: [solidPlugin(), inlinePlugin()],
|
|
@@ -12,7 +12,7 @@ export default defineConfig({
|
|
|
12
12
|
polyfillDynamicImport: false,
|
|
13
13
|
// inline plugin build options
|
|
14
14
|
rollupOptions: {
|
|
15
|
-
input: ["./index.html", "
|
|
15
|
+
input: ["./index.html", "./node_modules/@molgenis/vite-plugin-inline/dist/loader.js"],
|
|
16
16
|
output: {
|
|
17
17
|
manualChunks: undefined,
|
|
18
18
|
},
|