Skip to content

Commit

Permalink
Autogenerate artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Apr 29, 2022
1 parent 4664636 commit 099f7b3
Show file tree
Hide file tree
Showing 14 changed files with 1,021 additions and 791 deletions.
2 changes: 1 addition & 1 deletion artifacts/csv/ghga.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# metamodel_version: 1.7.0
# version: 0.6.0
# version: 0.7.0
id,mappings,description
accession_mixin,,Mixin for entities that can be assigned a GHGA accession.
agent,,"An agent is something that bears some form of responsibility for an activity taking place, for the existence of an entity, or for another agent's activity. Agents include a Person, Organization, or Software that performs an activity."
Expand Down
65 changes: 50 additions & 15 deletions artifacts/derived_schema/creation/ghga_creation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Auto generated from ghga_creation.yaml by pythongen.py version: 0.9.0
# Generation date: 2022-04-26T10:28:08
# Generation date: 2022-04-29T13:43:08
# Schema: GHGA-Metadata-Schema
#
# id: https://w3id.org/GHGA-Metadata-Schema
Expand All @@ -25,7 +25,7 @@
from linkml_runtime.linkml_model.types import Integer, String

metamodel_version = "1.7.0"
version = "0.6.0"
version = "0.7.0"

# Overwrite dataclasses _init_fn to add **kwargs in __init__
dataclasses._init_fn = dataclasses_init_fn_with_kwargs
Expand Down Expand Up @@ -787,7 +787,7 @@ class CreateSequencingProtocol(CreateProtocol):
alias: str = None
description: str = None
sequencing_center: Optional[str] = None
paired_or_single_end: Optional[str] = None
paired_or_single_end: Optional[Union[str, "PairedOrSingleEndEnum"]] = None
sequencing_read_length: Optional[str] = None
index_sequence: Optional[str] = None
target_coverage: Optional[str] = None
Expand Down Expand Up @@ -823,8 +823,8 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
if self.sequencing_center is not None and not isinstance(self.sequencing_center, str):
self.sequencing_center = str(self.sequencing_center)

if self.paired_or_single_end is not None and not isinstance(self.paired_or_single_end, str):
self.paired_or_single_end = str(self.paired_or_single_end)
if self.paired_or_single_end is not None and not isinstance(self.paired_or_single_end, PairedOrSingleEndEnum):
self.paired_or_single_end = PairedOrSingleEndEnum(self.paired_or_single_end)

if self.sequencing_read_length is not None and not isinstance(self.sequencing_read_length, str):
self.sequencing_read_length = str(self.sequencing_read_length)
Expand Down Expand Up @@ -1107,6 +1107,7 @@ class CreateSample(MaterialEntity):
description: str = None
alias: str = None
type: Optional[str] = None
case_control_status: Optional[Union[str, "CaseControlStatusEnum"]] = None
vital_status_at_sampling: Optional[Union[str, "VitalStatusEnum"]] = None
isolation: Optional[str] = None
storage: Optional[str] = None
Expand Down Expand Up @@ -1137,6 +1138,9 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
if self.type is not None and not isinstance(self.type, str):
self.type = str(self.type)

if self.case_control_status is not None and not isinstance(self.case_control_status, CaseControlStatusEnum):
self.case_control_status = CaseControlStatusEnum(self.case_control_status)

if self.vital_status_at_sampling is not None and not isinstance(self.vital_status_at_sampling, VitalStatusEnum):
self.vital_status_at_sampling = VitalStatusEnum(self.vital_status_at_sampling)

Expand Down Expand Up @@ -1610,9 +1614,9 @@ class CreateDataset(InformationContentEntity):
alias: str = None
type: Optional[str] = None
has_study: Optional[Union[Union[dict, CreateStudy], List[Union[dict, CreateStudy]]]] = empty_list()
has_experiment: Optional[Union[Union[dict, CreateAnalysis], List[Union[dict, CreateAnalysis]]]] = empty_list()
has_sample: Optional[Union[Union[dict, CreateStudy], List[Union[dict, CreateStudy]]]] = empty_list()
has_analysis: Optional[Union[Union[dict, CreateStudy], List[Union[dict, CreateStudy]]]] = empty_list()
has_experiment: Optional[Union[Union[dict, CreateExperiment], List[Union[dict, CreateExperiment]]]] = empty_list()
has_sample: Optional[Union[Union[dict, CreateSample], List[Union[dict, CreateSample]]]] = empty_list()
has_analysis: Optional[Union[Union[dict, CreateAnalysis], List[Union[dict, CreateAnalysis]]]] = empty_list()
has_publication: Optional[Union[Union[dict, "CreatePublication"], List[Union[dict, "CreatePublication"]]]] = empty_list()
release_status: Optional[Union[str, "ReleaseStatusEnum"]] = None
accession: Optional[str] = None
Expand Down Expand Up @@ -1656,15 +1660,15 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):

if not isinstance(self.has_experiment, list):
self.has_experiment = [self.has_experiment] if self.has_experiment is not None else []
self.has_experiment = [v if isinstance(v, CreateAnalysis) else CreateAnalysis(**as_dict(v)) for v in self.has_experiment]
self.has_experiment = [v if isinstance(v, CreateExperiment) else CreateExperiment(**as_dict(v)) for v in self.has_experiment]

if not isinstance(self.has_sample, list):
self.has_sample = [self.has_sample] if self.has_sample is not None else []
self.has_sample = [v if isinstance(v, CreateStudy) else CreateStudy(**as_dict(v)) for v in self.has_sample]
self.has_sample = [v if isinstance(v, CreateSample) else CreateSample(**as_dict(v)) for v in self.has_sample]

if not isinstance(self.has_analysis, list):
self.has_analysis = [self.has_analysis] if self.has_analysis is not None else []
self.has_analysis = [v if isinstance(v, CreateStudy) else CreateStudy(**as_dict(v)) for v in self.has_analysis]
self.has_analysis = [v if isinstance(v, CreateAnalysis) else CreateAnalysis(**as_dict(v)) for v in self.has_analysis]

if not isinstance(self.has_publication, list):
self.has_publication = [self.has_publication] if self.has_publication is not None else []
Expand Down Expand Up @@ -2523,6 +2527,34 @@ class FileFormatEnum(EnumDefinitionImpl):
description="Enum to capture file types.",
)

class CaseControlStatusEnum(EnumDefinitionImpl):
"""
Enum to capture whether a Sample in a Study is to be considered as Case or Control.
"""
control = PermissibleValue(text="control",
description="The Sample is to be treated as Control")
case = PermissibleValue(text="case",
description="The Sample is to be treated as Case")

_defn = EnumDefinition(
name="CaseControlStatusEnum",
description="Enum to capture whether a Sample in a Study is to be considered as Case or Control.",
)

class PairedOrSingleEndEnum(EnumDefinitionImpl):
"""
Enum to capture whether a sequencing experiment generates reads that are Paired-end or Single-end.
"""
paired = PermissibleValue(text="paired",
description="The reads are Paired-end")
single = PermissibleValue(text="single",
description="The reads are Single-end")

_defn = EnumDefinition(
name="PairedOrSingleEndEnum",
description="Enum to capture whether a sequencing experiment generates reads that are Paired-end or Single-end.",
)

class SubmissionStatusEnum(EnumDefinitionImpl):
"""
Enum to capture the status of a Submission.
Expand Down Expand Up @@ -2921,7 +2953,7 @@ class slots:
model_uri=GHGA.index_sequence, domain=None, range=Optional[str])

slots.paired_or_single_end = Slot(uri=GHGA.paired_or_single_end, name="paired or single end", curie=GHGA.curie('paired_or_single_end'),
model_uri=GHGA.paired_or_single_end, domain=None, range=Optional[str])
model_uri=GHGA.paired_or_single_end, domain=None, range=Optional[Union[str, "PairedOrSingleEndEnum"]])

slots.reference_chromosome = Slot(uri=GHGA.reference_chromosome, name="reference chromosome", curie=GHGA.curie('reference_chromosome'),
model_uri=GHGA.reference_chromosome, domain=None, range=Optional[str])
Expand Down Expand Up @@ -2962,6 +2994,9 @@ class slots:
slots.sample_barcode_read = Slot(uri=GHGA.sample_barcode_read, name="sample barcode read", curie=GHGA.curie('sample_barcode_read'),
model_uri=GHGA.sample_barcode_read, domain=None, range=Optional[str])

slots.case_control_status = Slot(uri=GHGA.case_control_status, name="case control status", curie=GHGA.curie('case_control_status'),
model_uri=GHGA.case_control_status, domain=None, range=Optional[Union[str, "CaseControlStatusEnum"]])

slots.vital_status_at_sampling = Slot(uri=GHGA.vital_status_at_sampling, name="vital status at sampling", curie=GHGA.curie('vital_status_at_sampling'),
model_uri=GHGA.vital_status_at_sampling, domain=None, range=Optional[Union[str, "VitalStatusEnum"]])

Expand Down Expand Up @@ -3344,13 +3379,13 @@ class slots:
model_uri=GHGA.create_dataset_has_study, domain=CreateDataset, range=Optional[Union[Union[dict, CreateStudy], List[Union[dict, CreateStudy]]]])

slots.create_dataset_has_experiment = Slot(uri=GHGA.has_experiment, name="create dataset_has experiment", curie=GHGA.curie('has_experiment'),
model_uri=GHGA.create_dataset_has_experiment, domain=CreateDataset, range=Optional[Union[Union[dict, CreateAnalysis], List[Union[dict, CreateAnalysis]]]])
model_uri=GHGA.create_dataset_has_experiment, domain=CreateDataset, range=Optional[Union[Union[dict, CreateExperiment], List[Union[dict, CreateExperiment]]]])

slots.create_dataset_has_sample = Slot(uri=GHGA.has_sample, name="create dataset_has sample", curie=GHGA.curie('has_sample'),
model_uri=GHGA.create_dataset_has_sample, domain=CreateDataset, range=Optional[Union[Union[dict, CreateStudy], List[Union[dict, CreateStudy]]]])
model_uri=GHGA.create_dataset_has_sample, domain=CreateDataset, range=Optional[Union[Union[dict, CreateSample], List[Union[dict, CreateSample]]]])

slots.create_dataset_has_analysis = Slot(uri=GHGA.has_analysis, name="create dataset_has analysis", curie=GHGA.curie('has_analysis'),
model_uri=GHGA.create_dataset_has_analysis, domain=CreateDataset, range=Optional[Union[Union[dict, CreateStudy], List[Union[dict, CreateStudy]]]])
model_uri=GHGA.create_dataset_has_analysis, domain=CreateDataset, range=Optional[Union[Union[dict, CreateAnalysis], List[Union[dict, CreateAnalysis]]]])

slots.create_dataset_has_file = Slot(uri=GHGA.has_file, name="create dataset_has file", curie=GHGA.curie('has_file'),
model_uri=GHGA.create_dataset_has_file, domain=CreateDataset, range=Union[Union[dict, CreateFile], List[Union[dict, CreateFile]]])
Expand Down
36 changes: 29 additions & 7 deletions artifacts/derived_schema/creation/ghga_creation.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@
"title": "BiologicalSexEnum",
"type": "string"
},
"CaseControlStatusEnum": {
"description": "Enum to capture whether a Sample in a Study is to be considered as Case or Control.",
"enum": [
"control",
"case"
],
"title": "CaseControlStatusEnum",
"type": "string"
},
"CreateAgent": {
"additionalProperties": false,
"description": "An agent is something that bears some form of responsibility for an activity taking place, for the existence of an entity, or for another agent's activity. Agents include a Person, Organization, or Software that performs an activity.",
Expand Down Expand Up @@ -980,7 +989,7 @@
"items": {
"oneOf": [
{
"$ref": "#/$defs/CreateStudy"
"$ref": "#/$defs/CreateAnalysis"
},
{
"type": "string"
Expand Down Expand Up @@ -1012,11 +1021,11 @@
]
},
"has_experiment": {
"description": "One or more Analysis entities that are referenced by this Dataset.",
"description": "One or more Experiment entities that are referenced by this Dataset.",
"items": {
"oneOf": [
{
"$ref": "#/$defs/CreateAnalysis"
"$ref": "#/$defs/CreateExperiment"
},
{
"type": "string"
Expand Down Expand Up @@ -1058,7 +1067,7 @@
"items": {
"oneOf": [
{
"$ref": "#/$defs/CreateStudy"
"$ref": "#/$defs/CreateSample"
},
{
"type": "string"
Expand Down Expand Up @@ -2372,6 +2381,10 @@
"description": "The alias for an entity.",
"type": "string"
},
"case_control_status": {
"$ref": "#/$defs/CaseControlStatusEnum",
"description": "Whether the sample is to be treated as Case or Control in a Study."
},
"description": {
"description": "Short textual description of the sample (How the sample was collected, sample source, protocol followed for processing the sample etc).",
"type": "string"
Expand Down Expand Up @@ -2545,8 +2558,8 @@
"type": "string"
},
"paired_or_single_end": {
"description": "Denotes whether a submitted FASTQ file contains forward (R1) or reverse (R2) reads for paired-end sequencing. The number that identifies each read direction in a paired-end nucleotide sequencing replications.",
"type": "string"
"$ref": "#/$defs/PairedOrSingleEndEnum",
"description": "Denotes whether a submitted FASTQ file contains forward (R1) or reverse (R2) reads for paired-end sequencing. The number that identifies each read direction in a paired-end nucleotide sequencing replications."
},
"sample_barcode_read": {
"description": "The type of read that contains the sample barcode (eg: index1/index2/read1/read2).",
Expand Down Expand Up @@ -3102,6 +3115,15 @@
"title": "FileFormatEnum",
"type": "string"
},
"PairedOrSingleEndEnum": {
"description": "Enum to capture whether a sequencing experiment generates reads that are Paired-end or Single-end.",
"enum": [
"paired",
"single"
],
"title": "PairedOrSingleEndEnum",
"type": "string"
},
"ReleaseStatusEnum": {
"description": "Enum to capture the release status of an entity.",
"enum": [
Expand Down Expand Up @@ -3187,6 +3209,6 @@
"required": [],
"title": "GHGA-Metadata-Schema",
"type": "object",
"version": "0.6.0"
"version": "0.7.0"
}

44 changes: 38 additions & 6 deletions artifacts/derived_schema/creation/ghga_creation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ id: https://w3id.org/GHGA-Metadata-Schema
name: GHGA-Metadata-Schema
description: >-
The metadata schema for the German Human Genome-Phenome Archive (GHGA).
version: 0.6.0
version: 0.7.0
imports:
- linkml:types

Expand Down Expand Up @@ -153,6 +153,24 @@ enums:
description: >-
Other format.
case control status enum:
description: >-
Enum to capture whether a Sample in a Study is to be considered as Case or Control.
permissible_values:
control:
description: The Sample is to be treated as Control
case:
description: The Sample is to be treated as Case

paired or single end enum:
description: >-
Enum to capture whether a sequencing experiment generates reads that are Paired-end
or Single-end.
permissible_values:
paired:
description: The reads are Paired-end
single:
description: The reads are Single-end

submission status enum:
description: >-
Expand Down Expand Up @@ -233,7 +251,7 @@ enums:
description: Age above 80.
unknown:
description: Age range unknown.
comments: This schema was autogenerated from the GHGA Metadata Schema 0.6.0 and is
comments: This schema was autogenerated from the GHGA Metadata Schema 0.7.0 and is
intended solely for consumption by GHGA microservices.
slots:
schema type:
Expand Down Expand Up @@ -881,6 +899,10 @@ slots:
reads for paired-end sequencing.
The number that identifies each read direction in a paired-end nucleotide sequencing
replications.
range: paired or single end enum
in_subset:
- recommended
- public

reference chromosome:
description: >-
Expand Down Expand Up @@ -982,6 +1004,14 @@ slots:
- recommended
- public

case control status:
description: >-
Whether the sample is to be treated as Case or Control in a Study.
range: case control status enum
in_subset:
- recommended
- public

vital status at sampling:
description: >-
Vital Status of an Individual at the point of sampling (eg:'Alive', 'Deceased').
Expand Down Expand Up @@ -1736,6 +1766,7 @@ classes:
- name
- type
- description
- case control status
- vital status at sampling
- isolation
- storage
Expand Down Expand Up @@ -2120,31 +2151,32 @@ classes:
inlined_as_list: true
has experiment:
description: >-
One or more Analysis entities that are referenced by this Dataset.
range: create analysis
One or more Experiment entities that are referenced by this Dataset.
range: create experiment
multivalued: true
inlined: true
inlined_as_list: true
required: false
has sample:
description: >-
One or more Sample entities that are referenced by this Dataset.
range: create study
range: create sample
multivalued: true
required: false
inlined: true
inlined_as_list: true
has analysis:
description: >-
One or more Analysis entities that are referenced by this Dataset.
range: create study
range: create analysis
multivalued: true
inlined: true
inlined_as_list: true
required: false
has file:
description: >-
One or more File entities that collectively are part of this Dataset.
range: create file
required: true
multivalued: true
inlined: true
Expand Down
Loading

0 comments on commit 099f7b3

Please sign in to comment.