Skip to content

Commit

Permalink
Mark unimplemented ontologies with subset (#134)
Browse files Browse the repository at this point in the history
* Mark unimplemented ontologies with subset

* Update XLSX generator
  • Loading branch information
lkuchenb authored Aug 2, 2023
1 parent f17e0ec commit aa382d3
Show file tree
Hide file tree
Showing 24 changed files with 162 additions and 8 deletions.
2 changes: 2 additions & 0 deletions docs/schema_markdown/Biospecimen.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ URI: [GHGA:Biospecimen](https://w3id.org/GHGA/Biospecimen)
* [Biospecimen➞isolation](Biospecimen_isolation.md) <sub>0..1</sub>
* Description: Method or device employed for collecting/isolating a biospecimen or a sample.
* Range: [String](types/String.md)
* in subsets: (ontology)
* [Biospecimen➞storage](Biospecimen_storage.md) <sub>0..1</sub>
* Description: Methods by which a biospecimen or a sample is stored (e.g. frozen in liquid nitrogen).
* Range: [String](types/String.md)
Expand All @@ -51,6 +52,7 @@ URI: [GHGA:Biospecimen](https://w3id.org/GHGA/Biospecimen)
* Range: [VitalStatusEnum](VitalStatusEnum.md)
* [Biospecimen➞tissue](Biospecimen_tissue.md) <sub>1..1</sub>
* Range: [String](types/String.md)
* in subsets: (ontology)

### Mixed in from IdentifiedByAliasMixin:

Expand Down
7 changes: 7 additions & 0 deletions docs/schema_markdown/Biospecimen_isolation.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@ URI: [GHGA:Biospecimen_isolation](https://w3id.org/GHGA/Biospecimen_isolation)
## Used by

* [Biospecimen](Biospecimen.md)

## Other properties

| | | |
| --- | --- | --- |
| **In Subsets:** | | ontology |

7 changes: 7 additions & 0 deletions docs/schema_markdown/Biospecimen_tissue.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@ URI: [GHGA:Biospecimen_tissue](https://w3id.org/GHGA/Biospecimen_tissue)
## Used by

* [Biospecimen](Biospecimen.md)

## Other properties

| | | |
| --- | --- | --- |
| **In Subsets:** | | ontology |

3 changes: 3 additions & 0 deletions docs/schema_markdown/Individual.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,15 @@ URI: [GHGA:Individual](https://w3id.org/GHGA/Individual)
* [Individual➞geographical_region](Individual_geographical_region.md) <sub>0..1</sub>
* Description: The geographical region where the Individual is located. Any demarcated area of the Earth; may be determined by both natural and human boundaries.
* Range: [String](types/String.md)
* in subsets: (ontology)
* [Individual➞ancestries](Individual_ancestries.md) <sub>0..\*</sub>
* Description: A person's descent or lineage, from a person or from a population.
* Range: [String](types/String.md)
* in subsets: (ontology)
* [Individual➞phenotypic_features](Individual_phenotypic_features.md) <sub>0..\*</sub>
* Description: The Phenotypic Feature entity that is associated with this Biospecimen at the time of retrieval from the organism. Typically, a concept from Human Phenotype Ontology. For example, 'HP:0100244' indicates that the Individual - from_which_the_Biospecimen was extracted from - exhibits_'Fibrosarcoma'_as_one_of_its_phenotype.
* Range: [String](types/String.md)
* in subsets: (ontology)

### Mixed in from IdentifiedByAliasMixin:

Expand Down
7 changes: 7 additions & 0 deletions docs/schema_markdown/Individual_ancestries.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@ URI: [GHGA:Individual_ancestries](https://w3id.org/GHGA/Individual_ancestries)
## Used by

* [Individual](Individual.md)

## Other properties

| | | |
| --- | --- | --- |
| **In Subsets:** | | ontology |

7 changes: 7 additions & 0 deletions docs/schema_markdown/Individual_geographical_region.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@ URI: [GHGA:Individual_geographical_region](https://w3id.org/GHGA/Individual_geog
## Used by

* [Individual](Individual.md)

## Other properties

| | | |
| --- | --- | --- |
| **In Subsets:** | | ontology |

7 changes: 7 additions & 0 deletions docs/schema_markdown/Individual_phenotypic_features.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@ URI: [GHGA:Individual_phenotypic_features](https://w3id.org/GHGA/Individual_phen
## Used by

* [Individual](Individual.md)

## Other properties

| | | |
| --- | --- | --- |
| **In Subsets:** | | ontology |

35 changes: 35 additions & 0 deletions docs/schema_markdown/Ontology.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

# Subset: ontology


This slot is part of an ontology which is currently not otherwise encoded in the schema.

URI: [GHGA:ontology](https://w3id.org/GHGA/ontology)


### Classes


### Mixins


### Slots

* [Biospecimen➞isolation](Biospecimen_isolation.md)
* [Biospecimen➞tissue](Biospecimen_tissue.md)
* [Individual➞ancestries](Individual_ancestries.md)
* [Individual➞geographical_region](Individual_geographical_region.md)
* [Individual➞phenotypic_features](Individual_phenotypic_features.md) - The Phenotypic Feature entity that is associated with this Biospecimen at the time of retrieval from the organism. Typically, a concept from Human Phenotype Ontology. For example, 'HP:0100244' indicates that the Individual - from_which_the_Biospecimen was extracted from - exhibits_'Fibrosarcoma'_as_one_of_its_phenotype.
* [Sample➞isolation](Sample_isolation.md)
* [Sample➞type](Sample_type.md) - The type of sample.
* [ancestries](ancestries.md) - A person's descent or lineage, from a person or from a population.
* [geographical_region](geographical_region.md) - The geographical region where the Individual is located. Any demarcated area of the Earth; may be determined by both natural and human boundaries.
* [isolation](isolation.md) - Method or device employed for collecting/isolating a biospecimen or a sample.
* [phenotypic_features](phenotypic_features.md) - Phenotypic feature concepts that the entity is associated with.
* [tissue](tissue.md)

### Types


### Enums

2 changes: 2 additions & 0 deletions docs/schema_markdown/Sample.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ URI: [GHGA:Sample](https://w3id.org/GHGA/Sample)
* [Sample➞type](Sample_type.md) <sub>0..1</sub>
* Description: The type of sample.
* Range: [SampleTypeEnum](SampleTypeEnum.md)
* in subsets: (ontology)
* [Sample➞description](Sample_description.md) <sub>1..1</sub>
* Description: Short textual description of the sample (How the sample was collected, sample source, Protocol followed for processing the sample etc).
* Range: [String](types/String.md)
* [Sample➞isolation](Sample_isolation.md) <sub>0..1</sub>
* Description: Method or device employed for collecting/isolating a biospecimen or a sample.
* Range: [String](types/String.md)
* in subsets: (ontology)
* [Sample➞storage](Sample_storage.md) <sub>0..1</sub>
* Description: Methods by which a biospecimen or a sample is stored (e.g. frozen in liquid nitrogen).
* Range: [String](types/String.md)
Expand Down
7 changes: 7 additions & 0 deletions docs/schema_markdown/Sample_isolation.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@ URI: [GHGA:Sample_isolation](https://w3id.org/GHGA/Sample_isolation)
## Used by

* [Sample](Sample.md)

## Other properties

| | | |
| --- | --- | --- |
| **In Subsets:** | | ontology |

7 changes: 7 additions & 0 deletions docs/schema_markdown/Sample_type.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@ URI: [GHGA:Sample_type](https://w3id.org/GHGA/Sample_type)
## Used by

* [Sample](Sample.md)

## Other properties

| | | |
| --- | --- | --- |
| **In Subsets:** | | ontology |

7 changes: 7 additions & 0 deletions docs/schema_markdown/ancestries.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ None &#8594; <sub>0..\*</sub> [String](types/String.md)

## Used by


## Other properties

| | | |
| --- | --- | --- |
| **In Subsets:** | | ontology |

7 changes: 7 additions & 0 deletions docs/schema_markdown/geographical_region.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ None &#8594; <sub>0..1</sub> [String](types/String.md)

## Used by


## Other properties

| | | |
| --- | --- | --- |
| **In Subsets:** | | ontology |

3 changes: 2 additions & 1 deletion docs/schema_markdown/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

**metamodel version:** 1.7.0

**version:** 1.0.1
**version:** 1.1.0


The submission centric metadata schema for the German Human Genome-Phenome Archive (GHGA).
Expand Down Expand Up @@ -340,6 +340,7 @@ The submission centric metadata schema for the German Human Genome-Phenome Archi

### Subsets

* [Ontology](Ontology.md) - This slot is part of an ontology which is currently not otherwise encoded in the schema.

### Types

Expand Down
7 changes: 7 additions & 0 deletions docs/schema_markdown/isolation.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@ None &#8594; <sub>0..1</sub> [String](types/String.md)

## Used by


## Other properties

| | | |
| --- | --- | --- |
| **In Subsets:** | | ontology |

7 changes: 7 additions & 0 deletions docs/schema_markdown/phenotypic_features.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ None &#8594; <sub>0..\*</sub> [String](types/String.md)

## Used by


## Other properties

| | | |
| --- | --- | --- |
| **In Subsets:** | | ontology |

7 changes: 7 additions & 0 deletions docs/schema_markdown/tissue.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ None &#8594; <sub>0..1</sub> [String](types/String.md)

## Used by


## Other properties

| | | |
| --- | --- | --- |
| **In Subsets:** | | ontology |

16 changes: 15 additions & 1 deletion scripts/generate_xlsx.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,24 @@ def mv_help(self) -> str:
"""The multiple values help text"""
return "multiple values" if self.slot_def.multivalued else "single value"

def in_ontology_subset(self, slot_def: SlotDefinition) -> bool:
"""Returns a bool indicating whether or not the given slot is marked as
non-implemented ontology slot."""
SUBSET_NAME="ontology"
in_subset_usage = slot_def.in_subset
in_subset_root = self.schema.get_slot(slot_def.name).in_subset
return (
isinstance(in_subset_usage, list) and SUBSET_NAME in in_subset_usage or
isinstance(in_subset_root, list) and SUBSET_NAME in in_subset_root or
in_subset_usage == SUBSET_NAME or
in_subset_root == SUBSET_NAME
)


@property
def restriction_help(self) -> str:
"""The restriction help text"""
if self.enum_name or self.slot_def.pattern:
if self.enum_name or self.slot_def.pattern or self.in_ontology_subset(self.slot_def):
return "controlled vocabulary"
elif self.cls_name:
id_slot = self.schema.get_identifier_slot(self.cls_name)
Expand Down
Binary file modified spreadsheets/ghga_submission_full.xlsx
Binary file not shown.
Binary file modified spreadsheets/ghga_submission_individual.xlsx
Binary file not shown.
Binary file modified spreadsheets/ghga_submission_minimal.xlsx
Binary file not shown.
Binary file modified spreadsheets/ghga_submission_sample.xlsx
Binary file not shown.
Binary file modified spreadsheets/ghga_submission_seq.xlsx
Binary file not shown.
25 changes: 19 additions & 6 deletions src/schema/submission.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ id: https://w3id.org/GHGA-Submission-Metadata-Schema
name: GHGA-Submission-Metadata-Schema
description: >-
The submission centric metadata schema for the German Human Genome-Phenome Archive (GHGA).
version: 1.0.1
version: 1.1.0
imports:
- linkml:types

Expand Down Expand Up @@ -437,6 +437,8 @@ classes:
description: >-
The type of sample.
range: SampleTypeEnum
in_subset:
- ontology
required: false
description:
description: >-
Expand Down Expand Up @@ -1053,7 +1055,8 @@ slots:

phenotypic_features:
description: Phenotypic feature concepts that the entity is associated with.
pattern: .*
in_subset:
- ontology
# range: PhenotypicFeaturesEnum
multivalued: true

Expand All @@ -1072,7 +1075,8 @@ slots:
ancestries:
description: >-
A person's descent or lineage, from a person or from a population.
pattern: HANCESTRO:.*
in_subset:
- ontology
# range: AncestryEnum
multivalued: true

Expand Down Expand Up @@ -1353,7 +1357,8 @@ slots:
isolation:
description: >-
Method or device employed for collecting/isolating a biospecimen or a sample.
pattern: SNOMED:.*
in_subset:
- ontology
# range: IsolationEnum

storage:
Expand Down Expand Up @@ -1385,7 +1390,8 @@ slots:
description: >-
The geographical region where the Individual is located.
Any demarcated area of the Earth; may be determined by both natural and human boundaries.
pattern: HANCESTRO:.*
in_subset:
- ontology
# range: GeographicalRegionEnum

vital_status:
Expand Down Expand Up @@ -1471,14 +1477,21 @@ slots:
DOI identifier of a publication.
tissue:
pattern: BTO:.*
in_subset:
- ontology
# range: TissueEnum

trios:
description: The Trios associated with an entity.
range: Trio
multivalued: true

subsets:
ontology:
description: >-
This slot is part of an ontology which is currently not otherwise encoded
in the schema.
enums:
DataUseModifierEnum:
description: Permitted values for data use modifier
Expand Down

0 comments on commit aa382d3

Please sign in to comment.