Skip to content

Commit 6a8f66a

Browse files
committed
termCollection type
1 parent dd53762 commit 6a8f66a

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

server/dataset/termdb.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,8 @@ export default function (): Mds3 {
261261
},
262262
{
263263
name: 'Assay Availability',
264-
//keys: ['yes'],
265264
type: 'categorical',
265+
categoryKeys: ['1'],
266266
termIds: ['assayavailability_cnv', 'assayavailability_fusion', 'assayavailability_germline'],
267267
branchIds: [''],
268268
propsByTermId: {}

shared/types/src/dataset.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,17 +1619,9 @@ keep this setting here for reason of:
16191619
termCollections?: TermCollection[]
16201620
}
16211621

1622-
type TermCollection = {
1622+
type TermCollectionBase = {
16231623
/** human readable name as well as unique identifier for this collection */
16241624
name: string
1625-
/** collection term type.
1626-
numeric:
1627-
- all member terms must be either integer or float type
1628-
categorical:
1629-
- all member terms must be categorical terms with same set of categories
1630-
*/
1631-
type: 'numeric' | 'categorical'
1632-
// TODO: add categoryKey field for categorical collections to specify which category attribute to use
16331625
/** array of dictionary term ids belonging to this collection */
16341626
termIds: string[]
16351627
/** array of branch term ids belonging to this collection,
@@ -1647,6 +1639,17 @@ type TermCollection = {
16471639
}[]
16481640
}
16491641

1642+
type NumericTermCollection = TermCollectionBase & {
1643+
type: 'numeric'
1644+
}
1645+
1646+
type CategoricalTermCollection = TermCollectionBase & {
1647+
type: 'categorical'
1648+
categoryKeys: string[]
1649+
}
1650+
1651+
type TermCollection = NumericTermCollection | CategoricalTermCollection
1652+
16501653
type SampleType = {
16511654
name: string
16521655
plural_name: string

0 commit comments

Comments
 (0)