Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/dataset/termdb.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ export default function (): Mds3 {
},
{
name: 'Assay Availability',
//keys: ['yes'],
type: 'categorical',
categoryKeys: ['1'],
termIds: ['assayavailability_cnv', 'assayavailability_fusion', 'assayavailability_germline'],
branchIds: [''],
propsByTermId: {}
Expand Down
21 changes: 12 additions & 9 deletions shared/types/src/dataset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1619,17 +1619,9 @@ keep this setting here for reason of:
termCollections?: TermCollection[]
}

type TermCollection = {
type TermCollectionBase = {
/** human readable name as well as unique identifier for this collection */
name: string
/** collection term type.
numeric:
- all member terms must be either integer or float type
categorical:
- all member terms must be categorical terms with same set of categories
*/
type: 'numeric' | 'categorical'
// TODO: add categoryKey field for categorical collections to specify which category attribute to use
/** array of dictionary term ids belonging to this collection */
termIds: string[]
/** array of branch term ids belonging to this collection,
Expand All @@ -1647,6 +1639,17 @@ type TermCollection = {
}[]
}

type NumericTermCollection = TermCollectionBase & {
type: 'numeric'
}

type CategoricalTermCollection = TermCollectionBase & {
type: 'categorical'
categoryKeys: string[]
}

type TermCollection = NumericTermCollection | CategoricalTermCollection

type SampleType = {
name: string
plural_name: string
Expand Down
Loading