@molgenis/vip-report-template 6.1.1 → 7.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.
Files changed (285) hide show
  1. package/.nvmrc +1 -1
  2. package/.travis.yml +9 -11
  3. package/README.md +411 -1
  4. package/eslint.config.mjs +11 -0
  5. package/package.json +40 -35
  6. package/scripts/deploy_npm_registry.sh +5 -0
  7. package/src/App.tsx +35 -29
  8. package/src/assets/sass/main.scss +12 -4
  9. package/src/components/Allele.tsx +95 -0
  10. package/src/components/Anchor.tsx +1 -1
  11. package/src/components/Breadcrumb.tsx +8 -5
  12. package/src/components/DatasetDropdown.tsx +10 -23
  13. package/src/components/ErrorNotification.tsx +9 -0
  14. package/src/components/GenomeBrowser.tsx +40 -23
  15. package/src/components/HpoTerm.tsx +1 -1
  16. package/src/components/{record/Pager.tsx → Pager.tsx} +21 -14
  17. package/src/components/RecordsPerPage.tsx +9 -7
  18. package/src/components/RecordsTable.tsx +130 -0
  19. package/src/components/SampleTable.tsx +70 -98
  20. package/src/components/SearchBox.tsx +8 -2
  21. package/src/components/Sort.tsx +28 -25
  22. package/src/components/Table.tsx +16 -0
  23. package/src/components/Tooltip.tsx +20 -0
  24. package/src/components/VariantBreadcrumb.tsx +54 -0
  25. package/src/components/VariantConsequenceContainer.tsx +100 -0
  26. package/src/components/VariantConsequenceTable.tsx +58 -0
  27. package/src/components/VariantContainer.tsx +71 -0
  28. package/src/components/VariantFilters.tsx +27 -0
  29. package/src/components/VariantGenotypeTable.tsx +44 -0
  30. package/src/components/VariantInfoTable.tsx +24 -33
  31. package/src/components/VariantResults.tsx +103 -0
  32. package/src/components/VariantTable.tsx +62 -66
  33. package/src/components/VariantTypeSelect.tsx +34 -0
  34. package/src/components/VariantsContainer.tsx +150 -0
  35. package/src/components/VariantsContainerHeader.tsx +70 -0
  36. package/src/components/field/Field.tsx +80 -0
  37. package/src/components/field/FieldAlt.tsx +19 -0
  38. package/src/components/field/FieldChrom.tsx +6 -0
  39. package/src/components/{record/Id.tsx → field/FieldFilter.tsx} +2 -1
  40. package/src/components/field/FieldFormat.tsx +10 -0
  41. package/src/components/{record/Filter.tsx → field/FieldId.tsx} +1 -1
  42. package/src/components/field/FieldPos.tsx +6 -0
  43. package/src/components/field/FieldQual.tsx +6 -0
  44. package/src/components/field/FieldRef.tsx +8 -0
  45. package/src/components/field/composed/FieldClinVar.tsx +72 -0
  46. package/src/components/field/composed/FieldComposed.tsx +68 -0
  47. package/src/components/field/composed/FieldGene.tsx +39 -0
  48. package/src/components/field/composed/FieldGenotype.tsx +35 -0
  49. package/src/components/{record/format/GenotypeField.tsx → field/composed/FieldGenotypeSnvSv.tsx} +20 -16
  50. package/src/components/field/composed/FieldGenotypeStr.tsx +31 -0
  51. package/src/components/field/composed/FieldGnomAd.tsx +58 -0
  52. package/src/components/field/composed/FieldHpo.tsx +50 -0
  53. package/src/components/field/composed/FieldInheritanceModes.tsx +32 -0
  54. package/src/components/field/composed/FieldLocus.tsx +18 -0
  55. package/src/components/field/composed/FieldVipC.tsx +25 -0
  56. package/src/components/field/composed/FieldVipCS.tsx +15 -0
  57. package/src/components/field/composed/FieldVkgl.tsx +37 -0
  58. package/src/components/field/genotype/FieldGenotype.tsx +19 -0
  59. package/src/components/field/genotype/FieldGenotypeType.tsx +9 -0
  60. package/src/components/field/info/FieldConsequence.tsx +15 -0
  61. package/src/components/{record/info/Hgvs.tsx → field/info/FieldHgvs.tsx} +4 -6
  62. package/src/components/field/info/FieldInfo.tsx +27 -0
  63. package/src/components/{record/info/PubMed.tsx → field/info/FieldPubMed.tsx} +4 -7
  64. package/src/components/field/typed/FieldCategorical.tsx +17 -0
  65. package/src/components/{record/field/FieldValueCharacter.tsx → field/typed/FieldCharacter.tsx} +3 -2
  66. package/src/components/{record/field/FieldValueFlag.tsx → field/typed/FieldFlag.tsx} +3 -2
  67. package/src/components/{record/field/FieldValueFloat.tsx → field/typed/FieldFloat.tsx} +3 -2
  68. package/src/components/{record/field/FieldValueInteger.tsx → field/typed/FieldInteger.tsx} +3 -2
  69. package/src/components/{record/field/FieldValueString.tsx → field/typed/FieldString.tsx} +3 -2
  70. package/src/components/field/typed/FieldTyped.tsx +20 -0
  71. package/src/components/field/typed/FieldTypedItem.tsx +49 -0
  72. package/src/components/field/typed/FieldTypedMultiple.tsx +21 -0
  73. package/src/components/filter/Filter.tsx +56 -48
  74. package/src/components/filter/FilterWrapper.scss +23 -0
  75. package/src/components/filter/FilterWrapper.tsx +63 -0
  76. package/src/components/filter/composed/FilterAllelicImbalance.tsx +26 -0
  77. package/src/components/filter/composed/FilterComposed.tsx +92 -0
  78. package/src/components/filter/composed/FilterDeNovo.tsx +35 -0
  79. package/src/components/filter/composed/FilterHpo.tsx +16 -0
  80. package/src/components/filter/composed/FilterInheritance.tsx +42 -0
  81. package/src/components/filter/composed/FilterLocus.tsx +75 -0
  82. package/src/components/filter/composed/FilterVipC.tsx +16 -0
  83. package/src/components/filter/composed/FilterVipCS.tsx +16 -0
  84. package/src/components/filter/fixed/FilterAlt.tsx +20 -0
  85. package/src/components/filter/fixed/FilterChrom.tsx +22 -0
  86. package/src/components/filter/fixed/FilterFilter.tsx +20 -0
  87. package/src/components/filter/fixed/FilterFixed.tsx +96 -0
  88. package/src/components/filter/fixed/FilterId.tsx +20 -0
  89. package/src/components/filter/fixed/FilterPos.tsx +22 -0
  90. package/src/components/filter/fixed/FilterQual.tsx +21 -0
  91. package/src/components/filter/fixed/FilterRef.tsx +22 -0
  92. package/src/components/filter/typed/FilterCategorical.tsx +119 -0
  93. package/src/components/filter/typed/FilterFlag.tsx +23 -0
  94. package/src/components/filter/typed/FilterInterval.tsx +72 -0
  95. package/src/components/filter/typed/FilterString.tsx +43 -0
  96. package/src/components/filter/typed/FilterTyped.tsx +56 -0
  97. package/src/components/form/ButtonApply.tsx +11 -0
  98. package/src/components/form/ButtonDownload.tsx +11 -0
  99. package/src/components/form/ButtonReset.tsx +9 -0
  100. package/src/components/{Checkbox.tsx → form/Checkbox.tsx} +4 -9
  101. package/src/components/form/Input.tsx +19 -0
  102. package/src/components/form/Select.scss +7 -0
  103. package/src/components/form/Select.tsx +34 -0
  104. package/src/components/tree/DecisionTreeBoolMultiQuery.tsx +1 -1
  105. package/src/components/tree/DecisionTreeBoolQuery.tsx +1 -1
  106. package/src/components/tree/DecisionTreeNode.tsx +41 -39
  107. package/src/components/tree/DecisionTreeNodeBool.tsx +1 -1
  108. package/src/components/tree/DecisionTreeNodeBoolMulti.tsx +1 -1
  109. package/src/components/tree/DecisionTreeNodeCategorical.tsx +1 -1
  110. package/src/components/tree/DecisionTreeNodeExists.tsx +1 -1
  111. package/src/components/tree/DecisionTreeNodeLeaf.tsx +1 -1
  112. package/src/components/tree/DecisionTreeOutcomeNode.tsx +1 -1
  113. package/src/components/tree/DecisionTreePath.tsx +1 -1
  114. package/src/igv.d.ts +2 -1
  115. package/src/index.tsx +48 -19
  116. package/src/mocks/GRCh37/decisionTree.json +23 -22
  117. package/src/mocks/GRCh37/field_metadata.json +435 -95
  118. package/src/mocks/GRCh37/sampleTree.json +143 -0
  119. package/src/mocks/GRCh37/static.ts +63 -133
  120. package/src/mocks/GRCh37/vcf/family.vcf.blob +37 -31
  121. package/src/mocks/GRCh38/decisionTree.json +52 -33
  122. package/src/mocks/GRCh38/decisionTreeStr.json +572 -0
  123. package/src/mocks/GRCh38/fasta/chr1_149380406-149403321.fasta.gz.blob +0 -0
  124. package/src/mocks/GRCh38/field_metadata.json +435 -95
  125. package/src/mocks/GRCh38/sampleTree.json +175 -0
  126. package/src/mocks/GRCh38/static.ts +101 -42
  127. package/src/mocks/GRCh38/str.cram.blob +0 -0
  128. package/src/mocks/GRCh38/str.cram.crai.blob +0 -0
  129. package/src/mocks/GRCh38/vcf/family.vcf.blob +25 -24
  130. package/src/mocks/GRCh38/vcf/no_vep.vcf.blob +29 -28
  131. package/src/mocks/GRCh38/vcf/samples_0.vcf.blob +28 -27
  132. package/src/mocks/GRCh38/vcf/samples_1.vcf.blob +29 -28
  133. package/src/mocks/GRCh38/vcf/samples_100.vcf.blob +28 -27
  134. package/src/mocks/GRCh38/vcf/str.vcf.blob +321 -0
  135. package/src/mocks/MockApiClient.ts +341 -328
  136. package/src/mocks/config_cram.json +701 -0
  137. package/src/mocks/config_vcf.json +699 -0
  138. package/src/store/app.ts +30 -0
  139. package/src/store/index.tsx +3 -168
  140. package/src/store/variants.ts +182 -0
  141. package/src/types/config.d.ts +190 -0
  142. package/src/types/configCellComposed.d.ts +86 -0
  143. package/src/types/configCells.d.ts +129 -0
  144. package/src/types/configFilter.d.ts +80 -0
  145. package/src/types/configFilterComposed.d.ts +60 -0
  146. package/src/types/configSort.d.ts +13 -0
  147. package/src/types/filter.d.ts +17 -0
  148. package/src/types/store.d.ts +34 -0
  149. package/src/utils/api.ts +281 -0
  150. package/src/utils/config/config.ts +182 -0
  151. package/src/utils/config/configCells.ts +74 -0
  152. package/src/utils/config/configCellsComposed.ts +508 -0
  153. package/src/utils/config/configCellsField.ts +61 -0
  154. package/src/utils/config/configCellsFixed.ts +126 -0
  155. package/src/utils/config/configFilters.ts +46 -0
  156. package/src/utils/config/configFiltersComposed.ts +208 -0
  157. package/src/utils/config/configFiltersField.ts +49 -0
  158. package/src/utils/config/configFiltersFixed.ts +106 -0
  159. package/src/utils/config/configSorts.ts +44 -0
  160. package/src/utils/config/configValidator.ts +380 -0
  161. package/src/utils/config/configVip.ts +25 -0
  162. package/src/utils/csq.ts +115 -0
  163. package/src/utils/decisionTree.ts +45 -0
  164. package/src/utils/download.ts +30 -0
  165. package/src/utils/error.ts +69 -0
  166. package/src/utils/query/query.ts +55 -0
  167. package/src/utils/query/queryFilter.ts +132 -0
  168. package/src/utils/query/queryFilterComposed.ts +247 -0
  169. package/src/utils/query/queryFilterField.ts +75 -0
  170. package/src/utils/query/queryFilterFixed.ts +44 -0
  171. package/src/utils/query/querySample.ts +18 -0
  172. package/src/utils/query/queryVariantType.ts +76 -0
  173. package/src/utils/query/selector.ts +41 -0
  174. package/src/utils/{sortUtils.ts → query/sort.ts} +32 -11
  175. package/src/utils/sample.ts +19 -35
  176. package/src/utils/utils.ts +66 -2
  177. package/src/utils/variantType.ts +43 -0
  178. package/src/utils/vcf.ts +352 -0
  179. package/src/views/Help.tsx +109 -114
  180. package/src/views/Home.tsx +3 -2
  181. package/src/views/Sample.tsx +12 -7
  182. package/src/views/SampleVariant.tsx +23 -112
  183. package/src/views/SampleVariantConsequence.tsx +54 -114
  184. package/src/views/SampleVariants.tsx +33 -445
  185. package/src/views/SampleVariantsRedirect.tsx +20 -0
  186. package/src/views/Samples.tsx +7 -10
  187. package/src/views/Variant.tsx +31 -61
  188. package/src/views/VariantConsequence.tsx +42 -72
  189. package/src/views/Variants.tsx +29 -138
  190. package/src/views/VariantsRedirect.tsx +25 -0
  191. package/src/views/data/data.tsx +32 -6
  192. package/tests/store/variants.test.ts +122 -0
  193. package/tests/utils/config/config.test.ts +167 -0
  194. package/tests/utils/config/configCells.test.ts +86 -0
  195. package/tests/utils/config/configCellsComposed.test.ts +1163 -0
  196. package/tests/utils/config/configCellsField.test.ts +164 -0
  197. package/tests/utils/config/configCellsFixed.test.ts +99 -0
  198. package/tests/utils/config/configFilters.test.ts +80 -0
  199. package/tests/utils/config/configFiltersComposed.test.ts +504 -0
  200. package/tests/utils/config/configFiltersField.test.ts +140 -0
  201. package/tests/utils/config/configFiltersFixed.test.ts +81 -0
  202. package/tests/utils/config/configSorts.test.ts +55 -0
  203. package/tests/utils/config/configValidator.test.ts +56 -0
  204. package/tests/utils/config/configVip.test.ts +53 -0
  205. package/tests/utils/decisionTree.test.ts +71 -0
  206. package/tests/utils/download.test.ts +20 -0
  207. package/tests/utils/query/query.test.ts +84 -0
  208. package/tests/utils/query/queryFilter.test.ts +243 -0
  209. package/tests/utils/query/queryFilterComposed.test.ts +301 -0
  210. package/tests/utils/query/queryFilterField.test.ts +75 -0
  211. package/tests/utils/query/queryFilterFixed.test.ts +86 -0
  212. package/tests/utils/query/querySample.test.ts +45 -0
  213. package/tests/utils/query/queryVariantType.test.ts +56 -0
  214. package/{src/__tests__/sortUtils.test.ts → tests/utils/query/sort.test.ts} +3 -4
  215. package/tests/utils/sample.test.ts +259 -0
  216. package/tests/utils/utils.test.ts +120 -0
  217. package/tests/utils/variantType.test.ts +48 -0
  218. package/tests/utils/vcf.test.ts +649 -0
  219. package/tsconfig.json +6 -2
  220. package/vite.config.mts +20 -3
  221. package/.eslintignore +0 -4
  222. package/.eslintrc.js +0 -23
  223. package/src/Api.ts +0 -12
  224. package/src/__tests__/decisionTreeUtils.test.ts +0 -75
  225. package/src/__tests__/field.test.ts +0 -107
  226. package/src/__tests__/query.test.ts +0 -188
  227. package/src/__tests__/sample.test.ts +0 -184
  228. package/src/__tests__/utils.test.ts +0 -24
  229. package/src/__tests__/viewUtils.test.ts +0 -125
  230. package/src/components/ConsequenceTable.tsx +0 -45
  231. package/src/components/Error.tsx +0 -9
  232. package/src/components/FieldHeader.tsx +0 -26
  233. package/src/components/InfoCollapsablePane.tsx +0 -90
  234. package/src/components/VariantInfoNestedTable.tsx +0 -127
  235. package/src/components/VariantSampleTable.tsx +0 -58
  236. package/src/components/VariantsSampleTable.tsx +0 -183
  237. package/src/components/VariantsTable.tsx +0 -124
  238. package/src/components/filter/FilterAllelicBalance.tsx +0 -81
  239. package/src/components/filter/FilterCategorical.tsx +0 -81
  240. package/src/components/filter/FilterClinVar.tsx +0 -21
  241. package/src/components/filter/FilterGene.tsx +0 -34
  242. package/src/components/filter/FilterHpo.tsx +0 -161
  243. package/src/components/filter/FilterInheritance.tsx +0 -162
  244. package/src/components/filter/FilterIntegerGq.tsx +0 -47
  245. package/src/components/filter/FilterVI.tsx +0 -68
  246. package/src/components/filter/FilterVariantType.tsx +0 -146
  247. package/src/components/filter/Filters.tsx +0 -29
  248. package/src/components/filter/InfoFilter.tsx +0 -39
  249. package/src/components/filter/InfoFilters.tsx +0 -35
  250. package/src/components/filter/SampleFilters.tsx +0 -93
  251. package/src/components/filter/SamplesFilters.tsx +0 -33
  252. package/src/components/record/Allele.tsx +0 -38
  253. package/src/components/record/AlleleBreakend.tsx +0 -5
  254. package/src/components/record/AlleleMissing.tsx +0 -5
  255. package/src/components/record/AlleleNucs.tsx +0 -49
  256. package/src/components/record/AlleleSymbolic.tsx +0 -5
  257. package/src/components/record/Alt.tsx +0 -17
  258. package/src/components/record/Chrom.tsx +0 -5
  259. package/src/components/record/Format.tsx +0 -40
  260. package/src/components/record/Info.tsx +0 -55
  261. package/src/components/record/Pos.tsx +0 -5
  262. package/src/components/record/Qual.tsx +0 -5
  263. package/src/components/record/RecordDownload.tsx +0 -66
  264. package/src/components/record/Ref.tsx +0 -6
  265. package/src/components/record/field/Field.tsx +0 -36
  266. package/src/components/record/field/FieldMultipleValue.tsx +0 -22
  267. package/src/components/record/field/FieldSingleValue.tsx +0 -35
  268. package/src/components/record/info/ClinVar.tsx +0 -81
  269. package/src/components/record/info/Consequence.tsx +0 -18
  270. package/src/components/record/info/Gene.tsx +0 -56
  271. package/src/components/record/info/GnomAD.tsx +0 -54
  272. package/src/components/record/info/Hpo.tsx +0 -52
  273. package/src/components/record/info/InheritanceModes.tsx +0 -22
  274. package/src/components/record/info/VipC.tsx +0 -23
  275. package/src/components/record/info/Vkgl.tsx +0 -42
  276. package/src/mocks/GRCh37/vcf/no_vep.vcf.blob +0 -61
  277. package/src/mocks/GRCh37/vcf/samples_0.vcf.blob +0 -93
  278. package/src/mocks/GRCh37/vcf/samples_1.vcf.blob +0 -93
  279. package/src/mocks/GRCh37/vcf/samples_100.vcf.blob +0 -93
  280. package/src/utils/ApiUtils.ts +0 -259
  281. package/src/utils/csqUtils.ts +0 -27
  282. package/src/utils/decisionTreeUtils.ts +0 -14
  283. package/src/utils/field.ts +0 -49
  284. package/src/utils/query.ts +0 -154
  285. package/src/utils/viewUtils.ts +0 -32
@@ -0,0 +1,504 @@
1
+ import { afterEach, describe, expect, test, vi } from "vitest";
2
+ import { initConfigFilterComposed } from "../../../src/utils/config/configFiltersComposed.ts";
3
+ import { MetadataContainer, SampleContainer } from "../../../src/utils/api.ts";
4
+ import { ConfigJsonFilterComposed, ConfigVip } from "../../../src/types/config";
5
+ import {
6
+ ConfigFilterAllelicImbalance,
7
+ ConfigFilterDeNovo,
8
+ ConfigFilterHpo,
9
+ ConfigFilterInheritanceMatch,
10
+ ConfigFilterLocus,
11
+ ConfigFilterVipC,
12
+ ConfigFilterVipCS,
13
+ } from "../../../src/types/configFilterComposed";
14
+ import {
15
+ FieldMetadataWrapper,
16
+ getInfoNestedField,
17
+ getSampleField,
18
+ getSampleFields,
19
+ parseContigIds,
20
+ } from "../../../src/utils/vcf.ts";
21
+ import { PhenotypicFeature } from "@molgenis/vip-report-api";
22
+
23
+ describe("config filters composed", () => {
24
+ vi.mock(import("../../../src/utils/vcf.ts"));
25
+
26
+ afterEach(() => {
27
+ vi.resetAllMocks();
28
+ });
29
+
30
+ describe("initConfigFiltersComposed", () => {
31
+ const vcfMetadata = {};
32
+ const metadata = { records: vcfMetadata } as MetadataContainer;
33
+ const configVip = {} as ConfigVip;
34
+
35
+ describe("hpo", () => {
36
+ const configBase: ConfigJsonFilterComposed = {
37
+ type: "composed",
38
+ name: "hpo",
39
+ };
40
+ const sample = {
41
+ phenotypes: [
42
+ { type: { id: "HP:0000951", label: "HP:0000951 label" } },
43
+ {
44
+ type: {
45
+ id: "HP:0000952",
46
+ label: "HP:0000952 label",
47
+ },
48
+ },
49
+ ],
50
+ } as SampleContainer;
51
+
52
+ test("hpo", () => {
53
+ const fieldHpo = { id: "CSQ/HPO" };
54
+ vi.mocked(getInfoNestedField).mockReturnValue(fieldHpo as FieldMetadataWrapper);
55
+
56
+ const filter = initConfigFilterComposed(configBase, configVip, metadata, sample) as ConfigFilterHpo;
57
+ expect(filter.type).toStrictEqual("composed");
58
+ expect(filter.id).toStrictEqual("hpo");
59
+ expect(filter.field).toStrictEqual({
60
+ ...fieldHpo,
61
+ categories: {
62
+ "HP:0000951": {
63
+ label: "HP:0000951 label",
64
+ },
65
+ "HP:0000952": {
66
+ label: "HP:0000952 label",
67
+ },
68
+ },
69
+ });
70
+ expect(getInfoNestedField).toHaveBeenCalledWith(vcfMetadata, "CSQ", "HPO");
71
+ });
72
+
73
+ test("hpo with field label and description", () => {
74
+ const fieldHpo = {
75
+ id: "CSQ/HPO",
76
+ label: "field_label",
77
+ description: "field_description",
78
+ };
79
+ vi.mocked(getInfoNestedField).mockReturnValue(fieldHpo as FieldMetadataWrapper);
80
+
81
+ const filter = initConfigFilterComposed(configBase, configVip, metadata, sample) as ConfigFilterHpo;
82
+ expect(filter.label()).toStrictEqual("field_label");
83
+ expect(filter.description()).toStrictEqual("field_description");
84
+ });
85
+
86
+ test("hpo with custom label and description", () => {
87
+ const config: ConfigJsonFilterComposed = {
88
+ ...configBase,
89
+ label: "my_label",
90
+ description: "my_description",
91
+ };
92
+
93
+ const fieldHpo = { id: "CSQ/HPO" };
94
+ vi.mocked(getInfoNestedField).mockReturnValue(fieldHpo as FieldMetadataWrapper);
95
+
96
+ const filter = initConfigFilterComposed(config, configVip, metadata, sample) as ConfigFilterHpo;
97
+ expect(filter.label()).toStrictEqual("my_label");
98
+ expect(filter.description()).toStrictEqual("my_description");
99
+ });
100
+
101
+ test("hpo is null when sample has no phenotypes", () => {
102
+ const sample = {
103
+ phenotypes: [] as PhenotypicFeature[],
104
+ } as SampleContainer;
105
+
106
+ expect(initConfigFilterComposed(configBase, configVip, metadata, sample)).toStrictEqual(null);
107
+ });
108
+
109
+ test("hpo is null when sample is null", () => {
110
+ expect(initConfigFilterComposed(configBase, configVip, metadata, null)).toStrictEqual(null);
111
+ });
112
+
113
+ test("hpo is null when metadata absent", () => {
114
+ vi.mocked(getInfoNestedField).mockReturnValue(undefined);
115
+ expect(initConfigFilterComposed(configBase, configVip, metadata, sample)).toStrictEqual(null);
116
+ expect(getInfoNestedField).toHaveBeenCalledWith(vcfMetadata, "CSQ", "HPO");
117
+ });
118
+ });
119
+
120
+ describe("locus", () => {
121
+ const configBase: ConfigJsonFilterComposed = {
122
+ type: "composed",
123
+ name: "locus",
124
+ };
125
+
126
+ test("locus", () => {
127
+ vi.mocked(parseContigIds).mockReturnValue(["chr1", "chr2"]);
128
+
129
+ const filter = initConfigFilterComposed(configBase, configVip, metadata, null) as ConfigFilterLocus;
130
+ expect(filter.type).toStrictEqual("composed");
131
+ expect(filter.id).toStrictEqual("locus");
132
+ expect(filter.label()).toStrictEqual("Locus");
133
+ expect(filter.description()).toStrictEqual(null);
134
+ expect(filter.chromosomes).toStrictEqual(["chr1", "chr2"]);
135
+
136
+ expect(parseContigIds).toHaveBeenCalledWith(vcfMetadata);
137
+ });
138
+
139
+ test("locus with custom label and description", () => {
140
+ const config: ConfigJsonFilterComposed = {
141
+ ...configBase,
142
+ label: "my_label",
143
+ description: "my_description",
144
+ };
145
+
146
+ const filter = initConfigFilterComposed(config, configVip, metadata, null) as ConfigFilterLocus;
147
+ expect(filter.label()).toStrictEqual("my_label");
148
+ expect(filter.description()).toStrictEqual("my_description");
149
+ });
150
+ });
151
+
152
+ describe("allelicImbalance", () => {
153
+ const configBase: ConfigJsonFilterComposed = {
154
+ type: "composed",
155
+ name: "allelicImbalance",
156
+ };
157
+ const sample = {} as SampleContainer;
158
+
159
+ test("allelicImbalance", () => {
160
+ const fieldViab = { id: "FORMAT/VIAB" };
161
+ const fieldGt = { id: "FORMAT/GT" };
162
+ vi.mocked(getSampleFields).mockReturnValue([fieldViab, fieldGt] as FieldMetadataWrapper[]);
163
+
164
+ const filter = initConfigFilterComposed(
165
+ configBase,
166
+ configVip,
167
+ metadata,
168
+ sample,
169
+ ) as ConfigFilterAllelicImbalance;
170
+ expect(filter.type).toStrictEqual("composed");
171
+ expect(filter.id).toStrictEqual("allelicImbalance");
172
+ expect(filter.label()).toStrictEqual("VIAB");
173
+ expect(filter.description()).toStrictEqual(null);
174
+ expect(filter.sample).toStrictEqual(sample);
175
+ expect(filter.viabField).toStrictEqual(fieldViab);
176
+ expect(filter.genotypeField).toStrictEqual(fieldGt);
177
+
178
+ expect(getSampleFields).toHaveBeenCalledWith(vcfMetadata, "VIAB", "GT");
179
+ });
180
+
181
+ test("allelicImbalance with field label and description", () => {
182
+ const fieldViab = { id: "FORMAT/VIAB", label: "field_label", description: "field_description" };
183
+ const fieldGt = { id: "FORMAT/GT" };
184
+ vi.mocked(getSampleFields).mockReturnValue([fieldViab, fieldGt] as FieldMetadataWrapper[]);
185
+
186
+ const filter = initConfigFilterComposed(
187
+ configBase,
188
+ configVip,
189
+ metadata,
190
+ sample,
191
+ ) as ConfigFilterAllelicImbalance;
192
+ expect(filter.label()).toStrictEqual("field_label");
193
+ expect(filter.description()).toStrictEqual("field_description");
194
+ });
195
+
196
+ test("allelicImbalance with custom label and description", () => {
197
+ const config: ConfigJsonFilterComposed = {
198
+ ...configBase,
199
+ label: "my_label",
200
+ description: "my_description",
201
+ };
202
+
203
+ const fieldViab = { id: "FORMAT/VIAB" };
204
+ const fieldGt = { id: "FORMAT/GT" };
205
+ vi.mocked(getSampleFields).mockReturnValue([fieldViab, fieldGt] as FieldMetadataWrapper[]);
206
+
207
+ const filter = initConfigFilterComposed(config, configVip, metadata, sample) as ConfigFilterAllelicImbalance;
208
+ expect(filter.label()).toStrictEqual("my_label");
209
+ expect(filter.description()).toStrictEqual("my_description");
210
+ });
211
+
212
+ test("allelicImbalance null for absent sample", () => {
213
+ expect(initConfigFilterComposed(configBase, configVip, metadata, null)).toStrictEqual(null);
214
+ });
215
+
216
+ test("allelicImbalance null for absent metadata", () => {
217
+ const fieldGt = { id: "FORMAT/GT" };
218
+ vi.mocked(getSampleFields).mockReturnValue([undefined, fieldGt] as FieldMetadataWrapper[]);
219
+ expect(initConfigFilterComposed(configBase, configVip, metadata, sample)).toStrictEqual(null);
220
+ expect(getSampleFields).toHaveBeenCalledWith(vcfMetadata, "VIAB", "GT");
221
+ });
222
+ });
223
+
224
+ describe("inheritanceMatch", () => {
225
+ const configBase: ConfigJsonFilterComposed = {
226
+ type: "composed",
227
+ name: "inheritanceMatch",
228
+ };
229
+ const sample = {} as SampleContainer;
230
+
231
+ test("inheritanceMatch", () => {
232
+ const fieldVim = { id: "FORMAT/VIM" };
233
+ vi.mocked(getSampleField).mockReturnValue(fieldVim as FieldMetadataWrapper);
234
+
235
+ const filter = initConfigFilterComposed(
236
+ configBase,
237
+ configVip,
238
+ metadata,
239
+ sample,
240
+ ) as ConfigFilterInheritanceMatch;
241
+ expect(filter.type).toStrictEqual("composed");
242
+ expect(filter.id).toStrictEqual("inheritanceMatch");
243
+ expect(filter.label()).toStrictEqual("VIM");
244
+ expect(filter.description()).toStrictEqual(null);
245
+ expect(filter.sample).toStrictEqual(sample);
246
+ expect(filter.vimField).toStrictEqual({ ...fieldVim, required: true });
247
+
248
+ expect(getSampleField).toHaveBeenCalledWith(vcfMetadata, "VIM");
249
+ });
250
+
251
+ test("inheritanceMatch with field label and description", () => {
252
+ const fieldVim = { id: "FORMAT/VIM", label: "field_label", description: "field_description" };
253
+ vi.mocked(getSampleField).mockReturnValue(fieldVim as FieldMetadataWrapper);
254
+
255
+ const filter = initConfigFilterComposed(
256
+ configBase,
257
+ configVip,
258
+ metadata,
259
+ sample,
260
+ ) as ConfigFilterInheritanceMatch;
261
+ expect(filter.label()).toStrictEqual("field_label");
262
+ expect(filter.description()).toStrictEqual("field_description");
263
+ });
264
+
265
+ test("inheritanceMatch with custom label and description", () => {
266
+ const config: ConfigJsonFilterComposed = {
267
+ ...configBase,
268
+ label: "my_label",
269
+ description: "my_description",
270
+ };
271
+
272
+ const fieldVim = { id: "FORMAT/VIM" };
273
+ vi.mocked(getSampleField).mockReturnValue(fieldVim as FieldMetadataWrapper);
274
+
275
+ const filter = initConfigFilterComposed(config, configVip, metadata, sample) as ConfigFilterInheritanceMatch;
276
+ expect(filter.label()).toStrictEqual("my_label");
277
+ expect(filter.description()).toStrictEqual("my_description");
278
+ });
279
+
280
+ test("inheritanceMatch null for absent sample", () => {
281
+ expect(initConfigFilterComposed(configBase, configVip, metadata, null)).toStrictEqual(null);
282
+ });
283
+
284
+ test("inheritanceMatch null for absent metadata", () => {
285
+ vi.mocked(getSampleField).mockReturnValue(undefined);
286
+ expect(initConfigFilterComposed(configBase, configVip, metadata, sample)).toStrictEqual(null);
287
+ expect(getSampleField).toHaveBeenCalledWith(vcfMetadata, "VIM");
288
+ });
289
+ });
290
+
291
+ describe("deNovo", () => {
292
+ const configBase: ConfigJsonFilterComposed = {
293
+ type: "composed",
294
+ name: "deNovo",
295
+ };
296
+ const sample = {} as SampleContainer;
297
+
298
+ test("deNovo", () => {
299
+ const fieldVid = { id: "FORMAT/VID" };
300
+ vi.mocked(getSampleField).mockReturnValue(fieldVid as FieldMetadataWrapper);
301
+
302
+ const filter = initConfigFilterComposed(configBase, configVip, metadata, sample) as ConfigFilterDeNovo;
303
+ expect(filter.type).toStrictEqual("composed");
304
+ expect(filter.id).toStrictEqual("deNovo");
305
+ expect(filter.label()).toStrictEqual("VID");
306
+ expect(filter.description()).toStrictEqual(null);
307
+ expect(filter.sample).toStrictEqual(sample);
308
+ expect(filter.vidField).toStrictEqual({ ...fieldVid, required: true });
309
+
310
+ expect(getSampleField).toHaveBeenCalledWith(vcfMetadata, "VID");
311
+ });
312
+
313
+ test("deNovo with field label and description", () => {
314
+ const fieldVid = { id: "FORMAT/VID", label: "field_label", description: "field_description" };
315
+ vi.mocked(getSampleField).mockReturnValue(fieldVid as FieldMetadataWrapper);
316
+
317
+ const filter = initConfigFilterComposed(configBase, configVip, metadata, sample) as ConfigFilterDeNovo;
318
+ expect(filter.label()).toStrictEqual("field_label");
319
+ expect(filter.description()).toStrictEqual("field_description");
320
+ });
321
+
322
+ test("deNovo with custom label and description", () => {
323
+ const config: ConfigJsonFilterComposed = {
324
+ ...configBase,
325
+ label: "my_label",
326
+ description: "my_description",
327
+ };
328
+
329
+ const fieldVid = { id: "FORMAT/VID" };
330
+ vi.mocked(getSampleField).mockReturnValue(fieldVid as FieldMetadataWrapper);
331
+
332
+ const filter = initConfigFilterComposed(config, configVip, metadata, sample) as ConfigFilterDeNovo;
333
+ expect(filter.label()).toStrictEqual("my_label");
334
+ expect(filter.description()).toStrictEqual("my_description");
335
+ });
336
+
337
+ test("deNovo null for absent sample", () => {
338
+ expect(initConfigFilterComposed(configBase, configVip, metadata, null)).toStrictEqual(null);
339
+ });
340
+
341
+ test("deNovo null for absent metadata", () => {
342
+ vi.mocked(getSampleField).mockReturnValue(undefined);
343
+ expect(initConfigFilterComposed(configBase, configVip, metadata, sample)).toStrictEqual(null);
344
+ expect(getSampleField).toHaveBeenCalledWith(vcfMetadata, "VID");
345
+ });
346
+ });
347
+
348
+ describe("vipC", () => {
349
+ const configBase: ConfigJsonFilterComposed = {
350
+ type: "composed",
351
+ name: "vipC",
352
+ };
353
+ const configVip = { params: { vcf: { filter: { classes: "a,c", consequences: true } } } } as ConfigVip;
354
+ const fieldVipCBase: FieldMetadataWrapper = {
355
+ id: "CSQ/VIPC",
356
+ type: "CATEGORICAL",
357
+ number: { type: "NUMBER", count: 1 },
358
+ categories: { a: { label: "a_label" }, b: { label: "b_label" }, c: { label: "c_label" } },
359
+ index: 0,
360
+ };
361
+
362
+ test("vipC", () => {
363
+ vi.mocked(getInfoNestedField).mockReturnValue(fieldVipCBase);
364
+
365
+ const filter = initConfigFilterComposed(configBase, configVip, metadata, null) as ConfigFilterVipC;
366
+ expect(filter.type).toStrictEqual("composed");
367
+ expect(filter.id).toStrictEqual("vipC");
368
+ expect(filter.field).toStrictEqual({
369
+ ...fieldVipCBase,
370
+ categories: { a: { label: "a_label" }, c: { label: "c_label" } },
371
+ });
372
+ expect(getInfoNestedField).toHaveBeenCalledWith(vcfMetadata, "CSQ", "VIPC");
373
+ });
374
+
375
+ test("vipC with field label and description", () => {
376
+ const fieldVipC: FieldMetadataWrapper = {
377
+ ...fieldVipCBase,
378
+ label: "field_label",
379
+ description: "field_description",
380
+ };
381
+ vi.mocked(getInfoNestedField).mockReturnValue(fieldVipC);
382
+
383
+ const filter = initConfigFilterComposed(configBase, configVip, metadata, null) as ConfigFilterVipC;
384
+ expect(filter.label()).toStrictEqual("field_label");
385
+ expect(filter.description()).toStrictEqual("field_description");
386
+ });
387
+
388
+ test("vipC with custom label and description", () => {
389
+ const config: ConfigJsonFilterComposed = {
390
+ ...configBase,
391
+ label: "my_label",
392
+ description: "my_description",
393
+ };
394
+
395
+ vi.mocked(getInfoNestedField).mockReturnValue(fieldVipCBase);
396
+
397
+ const filter = initConfigFilterComposed(config, configVip, metadata, null) as ConfigFilterVipC;
398
+ expect(filter.label()).toStrictEqual("my_label");
399
+ expect(filter.description()).toStrictEqual("my_description");
400
+ });
401
+
402
+ test("vipC is null when metadata absent", () => {
403
+ vi.mocked(getInfoNestedField).mockReturnValue(undefined);
404
+ expect(initConfigFilterComposed(configBase, configVip, metadata, null)).toStrictEqual(null);
405
+ expect(getInfoNestedField).toHaveBeenCalledWith(vcfMetadata, "CSQ", "VIPC");
406
+ });
407
+
408
+ test("vipC is null config consequences=false", () => {
409
+ vi.mocked(getInfoNestedField).mockReturnValue(fieldVipCBase);
410
+ const configVip = { params: { vcf: { filter: { classes: "a,c", consequences: false } } } } as ConfigVip;
411
+ const filter = initConfigFilterComposed(configBase, configVip, metadata, null) as ConfigFilterVipC;
412
+ expect(filter).toStrictEqual(null);
413
+ });
414
+
415
+ test("vipC is null when less than two categories", () => {
416
+ vi.mocked(getInfoNestedField).mockReturnValue(fieldVipCBase);
417
+ const configVip = { params: { vcf: { filter: { classes: "one", consequences: false } } } } as ConfigVip;
418
+ const filter = initConfigFilterComposed(configBase, configVip, metadata, null) as ConfigFilterVipC;
419
+ expect(filter).toStrictEqual(null);
420
+ });
421
+ });
422
+
423
+ describe("vipCS", () => {
424
+ const configBase: ConfigJsonFilterComposed = {
425
+ type: "composed",
426
+ name: "vipCS",
427
+ };
428
+ const configVip = { params: { vcf: { filter_samples: { classes: "a,c" } } } } as ConfigVip;
429
+ const fieldVipCSBase: FieldMetadataWrapper = {
430
+ id: "FORMAT/VIPC_S",
431
+ type: "CATEGORICAL",
432
+ number: { type: "NUMBER", count: 1 },
433
+ categories: { a: { label: "a_label" }, b: { label: "b_label" }, c: { label: "c_label" } },
434
+ required: true,
435
+ index: 0,
436
+ };
437
+ const sample = { item: { data: { proband: true } } } as SampleContainer;
438
+
439
+ test("vipCS", () => {
440
+ vi.mocked(getSampleField).mockReturnValue(fieldVipCSBase);
441
+
442
+ const filter = initConfigFilterComposed(configBase, configVip, metadata, sample) as ConfigFilterVipCS;
443
+ expect(filter.type).toStrictEqual("composed");
444
+ expect(filter.id).toStrictEqual("vipCS");
445
+ expect(filter.field).toStrictEqual({
446
+ ...fieldVipCSBase,
447
+ categories: { a: { label: "a_label" }, c: { label: "c_label" } },
448
+ required: true,
449
+ });
450
+ expect(filter.sample).toStrictEqual(sample);
451
+ expect(getSampleField).toHaveBeenCalledWith(vcfMetadata, "VIPC_S");
452
+ });
453
+
454
+ test("vipCS with field label and description", () => {
455
+ const fieldVipCS: FieldMetadataWrapper = {
456
+ ...fieldVipCSBase,
457
+ label: "field_label",
458
+ description: "field_description",
459
+ };
460
+ vi.mocked(getSampleField).mockReturnValue(fieldVipCS);
461
+
462
+ const filter = initConfigFilterComposed(configBase, configVip, metadata, sample) as ConfigFilterVipCS;
463
+ expect(filter.label()).toStrictEqual("field_label");
464
+ expect(filter.description()).toStrictEqual("field_description");
465
+ });
466
+
467
+ test("vipCS with custom label and description", () => {
468
+ const config: ConfigJsonFilterComposed = {
469
+ ...configBase,
470
+ label: "my_label",
471
+ description: "my_description",
472
+ };
473
+
474
+ vi.mocked(getSampleField).mockReturnValue(fieldVipCSBase);
475
+
476
+ const filter = initConfigFilterComposed(config, configVip, metadata, sample) as ConfigFilterVipCS;
477
+ expect(filter.label()).toStrictEqual("my_label");
478
+ expect(filter.description()).toStrictEqual("my_description");
479
+ });
480
+
481
+ test("vipCS is null when sample is null", () => {
482
+ expect(initConfigFilterComposed(configBase, configVip, metadata, null)).toStrictEqual(null);
483
+ });
484
+
485
+ test("vipCS is null when sample is not a proband", () => {
486
+ const sample = { item: { data: { proband: true } } } as SampleContainer;
487
+ expect(initConfigFilterComposed(configBase, configVip, metadata, sample)).toStrictEqual(null);
488
+ });
489
+
490
+ test("vipCS is null when metadata absent", () => {
491
+ vi.mocked(getSampleField).mockReturnValue(undefined);
492
+ expect(initConfigFilterComposed(configBase, configVip, metadata, sample)).toStrictEqual(null);
493
+ expect(getSampleField).toHaveBeenCalledWith(vcfMetadata, "VIPC_S");
494
+ });
495
+
496
+ test("vipCS is null when less than two categories", () => {
497
+ vi.mocked(getInfoNestedField).mockReturnValue(fieldVipCSBase);
498
+ const configVip = { params: { vcf: { filter: { classes: "one", consequences: false } } } } as ConfigVip;
499
+ const filter = initConfigFilterComposed(configBase, configVip, metadata, null) as ConfigFilterVipCS;
500
+ expect(filter).toStrictEqual(null);
501
+ });
502
+ });
503
+ });
504
+ });
@@ -0,0 +1,140 @@
1
+ import { afterEach, describe, expect, test, vi } from "vitest";
2
+ import { SampleContainer, VcfMetadataContainer } from "../../../src/utils/api.ts";
3
+ import { initConfigFiltersGenotype, initConfigFiltersInfo } from "../../../src/utils/config/configFiltersField.ts";
4
+ import { FieldMetadataWrapper, getInfoFieldsRegex, getSampleFieldsRegex } from "../../../src/utils/vcf.ts";
5
+ import { ConfigJsonFieldGenotype, ConfigJsonFieldInfo } from "../../../src/types/config";
6
+
7
+ describe("config filters field", () => {
8
+ vi.mock(import("../../../src/utils/vcf.ts"));
9
+
10
+ afterEach(() => {
11
+ vi.resetAllMocks();
12
+ });
13
+
14
+ describe("initConfigFiltersInfo", () => {
15
+ const metadata = {} as VcfMetadataContainer;
16
+
17
+ test("config matches one field", () => {
18
+ const config: ConfigJsonFieldInfo = {
19
+ type: "info",
20
+ name: "field",
21
+ label: "my_field_label",
22
+ description: "my_field_description",
23
+ };
24
+ const field = {
25
+ id: "INFO/field",
26
+ label: "field_label",
27
+ description: "field_description",
28
+ } as FieldMetadataWrapper;
29
+ vi.mocked(getInfoFieldsRegex).mockReturnValue([field]);
30
+
31
+ const filters = initConfigFiltersInfo(config, metadata);
32
+ expect(filters.length).toStrictEqual(1);
33
+ const filter = filters[0]!;
34
+ expect(filter.type).toStrictEqual("info");
35
+ expect(filter.field).toStrictEqual(field);
36
+ expect(filter.label()).toStrictEqual("my_field_label");
37
+ expect(filter.description()).toStrictEqual("my_field_description");
38
+
39
+ expect(getInfoFieldsRegex).toHaveBeenCalledWith(metadata, /^field$/);
40
+ });
41
+
42
+ test("config matches multiple fields", () => {
43
+ const config: ConfigJsonFieldInfo = {
44
+ type: "info",
45
+ name: "VIP/.*",
46
+ };
47
+ const fieldVip = {
48
+ id: "INFO/VIP",
49
+ nested: {},
50
+ } as FieldMetadataWrapper;
51
+ const fieldVipField0 = {
52
+ id: "INFO/VIP/field0",
53
+ } as FieldMetadataWrapper;
54
+ const fieldVipField1 = {
55
+ id: "INFO/VIP/field1",
56
+ } as FieldMetadataWrapper;
57
+ vi.mocked(getInfoFieldsRegex).mockReturnValue([fieldVip, fieldVipField0, fieldVipField1]);
58
+
59
+ const filters = initConfigFiltersInfo(config, metadata);
60
+ expect(filters.length).toStrictEqual(2); // drop nested fields
61
+ expect(getInfoFieldsRegex).toHaveBeenCalledWith(metadata, /^VIP\/.*$/);
62
+ });
63
+
64
+ test("config matches zero fields", () => {
65
+ const config: ConfigJsonFieldInfo = {
66
+ type: "info",
67
+ name: "field_not_in_my_vcf",
68
+ };
69
+ vi.mocked(getInfoFieldsRegex).mockReturnValue([]);
70
+
71
+ const filters = initConfigFiltersInfo(config, metadata);
72
+ expect(filters.length).toStrictEqual(0);
73
+ expect(getInfoFieldsRegex).toHaveBeenCalledWith(metadata, /^field_not_in_my_vcf$/);
74
+ });
75
+ });
76
+
77
+ describe("initConfigFiltersGenotype", () => {
78
+ const metadata = {} as VcfMetadataContainer;
79
+ const sample = { item: { id: 2 } } as SampleContainer;
80
+
81
+ test("config matches one field", () => {
82
+ const config: ConfigJsonFieldGenotype = {
83
+ type: "genotype",
84
+ name: "field",
85
+ label: "my_field_label",
86
+ description: "my_field_description",
87
+ };
88
+ const field = {
89
+ id: "FORMAT/field",
90
+ label: "field_label",
91
+ description: "field_description",
92
+ } as FieldMetadataWrapper;
93
+ vi.mocked(getSampleFieldsRegex).mockReturnValue([field]);
94
+
95
+ const filters = initConfigFiltersGenotype(config, metadata, sample);
96
+ expect(filters.length).toStrictEqual(1);
97
+ const filter = filters[0]!;
98
+ expect(filter.type).toStrictEqual("genotype");
99
+ expect(filter.field).toStrictEqual(field);
100
+ expect(filter.label()).toStrictEqual("my_field_label");
101
+ expect(filter.description()).toStrictEqual("my_field_description");
102
+
103
+ expect(getSampleFieldsRegex).toHaveBeenCalledWith(metadata, /^field$/);
104
+ });
105
+
106
+ test("config matches multiple fields", () => {
107
+ const config: ConfigJsonFieldGenotype = {
108
+ type: "genotype",
109
+ name: "VIP/.*",
110
+ };
111
+ const fieldVip = {
112
+ id: "FORMAT/VIP",
113
+ nested: {},
114
+ } as FieldMetadataWrapper;
115
+ const fieldVipField0 = {
116
+ id: "FORMAT/VIP/field0",
117
+ } as FieldMetadataWrapper;
118
+ const fieldVipField1 = {
119
+ id: "FORMAT/VIP/field1",
120
+ } as FieldMetadataWrapper;
121
+ vi.mocked(getSampleFieldsRegex).mockReturnValue([fieldVip, fieldVipField0, fieldVipField1]);
122
+
123
+ const filters = initConfigFiltersGenotype(config, metadata, sample);
124
+ expect(filters.length).toStrictEqual(2); // drop nested fields
125
+ expect(getSampleFieldsRegex).toHaveBeenCalledWith(metadata, /^VIP\/.*$/);
126
+ });
127
+
128
+ test("config matches zero fields", () => {
129
+ const config: ConfigJsonFieldGenotype = {
130
+ type: "genotype",
131
+ name: "field_not_in_my_vcf",
132
+ };
133
+ vi.mocked(getSampleFieldsRegex).mockReturnValue([]);
134
+
135
+ const filters = initConfigFiltersGenotype(config, metadata, sample);
136
+ expect(filters.length).toStrictEqual(0);
137
+ expect(getSampleFieldsRegex).toHaveBeenCalledWith(metadata, /^field_not_in_my_vcf$/);
138
+ });
139
+ });
140
+ });