Skip to content

Commit

Permalink
Merge pull request #246 from alliance-genome/association_slot_refacto…
Browse files Browse the repository at this point in the history
…r_mk2

Refactor association slots using domain prefix
  • Loading branch information
markquintontulloch authored Feb 16, 2024
2 parents fb772e1 + 0f4e60a commit ace8336
Show file tree
Hide file tree
Showing 14 changed files with 659 additions and 630 deletions.
869 changes: 437 additions & 432 deletions generated/jsonschema/allianceModel.schema.json

Large diffs are not rendered by default.

115 changes: 67 additions & 48 deletions model/schema/allele.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,19 +178,28 @@ classes:
mod_entity_id:
required: true

SequenceTargetingReagentToGeneAssociation:
SequenceTargetingReagentAssociation:
is_a: EvidenceAssociation
abstract: true
description: Base class for STR associations
attributes:
sequence_targeting_reagent_association_subject:
range: SequenceTargetingReagent
required: true

SequenceTargetingReagentGeneAssociation:
description: >-
the relationship between a Sequence Targeting Reagent and its targeted
genes. The relation should be a VocabularyTerm with one of the following
values - targets
is_a: EvidenceAssociation
is_a: SequenceTargetingReagentAssociation
attributes:
sequence_targeting_reagent_gene_association_object:
range: Gene
required: true
slot_usage:
relation:
range: VocabularyTerm
subject:
range: SequenceTargetingReagent
object:
range: Gene

# TO DO: create SequenceTargetingReagentToGeneAssociationDTO class? [CG]

Expand Down Expand Up @@ -384,15 +393,26 @@ classes:
## ALLELE ASSOCIATION CLASSES
## ------------

AlleleAssociation:
is_a: EvidenceAssociation
abstract: true
description: Base class for all Allele Associations
attributes:
allele_association_subject:
range: Allele
required: true

AlleleAlleleAssociation:
is_a: AlleleGenomicEntityAssociation
description: >-
Association between an allele and another allele
attributes:
allele_allele_association_object:
range: Allele
required: true
slot_usage:
relation:
notes: CV 'Allele Allele Association Relation'
object:
range: Allele

AlleleAlleleAssociationDTO:
is_a: AlleleGenomicEntityAssociationDTO
Expand All @@ -403,18 +423,18 @@ classes:

# do mutant/parent/embryonic cell line associations need to be split out?
AlleleCellLineAssociation:
is_a: EvidenceAssociation
is_a: AlleleAssociation
description: >-
The relationship between an allele and a cell line. Includes mutant/
embryonic stem cell lines known to carry the allele, and parental cell
line of alleles made in embryonic stem cells.
attributes:
allele_cell_line_association_object:
range: CellLine
required: true
slot_usage:
subject:
range: Allele
relation:
range: VocabularyTerm
object:
range: CellLine

AlleleCellLineAssociationDTO:
is_a: EvidenceAssociationDTO
Expand All @@ -432,16 +452,16 @@ classes:
description: >-
The relationship between an allele and constructs contained in
that allele.
attributes:
allele_construct_association_object:
range: Construct
required: true
slot_usage:
subject:
range: Allele
relation:
range: VocabularyTerm
notes: >-
CV 'Allele Construct Association Relation' including - contains, contains_coinjection_marker,
contains_phenotypic_sequence_feature, and contains_innocuous_sequence_feature
object:
range: Construct
AlleleConstructAssociationDTO:
is_a: AlleleGenomicEntityAssociationDTO
Expand All @@ -460,9 +480,10 @@ classes:
is_a: AlleleGenomicEntityAssociation
description: >-
Association between an allele and a gene
slot_usage:
object:
attributes:
allele_gene_association_object:
range: Gene
required: true

AlleleGeneAssociationDTO:
description: >-
Expand All @@ -472,18 +493,18 @@ classes:
- gene_identifier

AlleleGenerationMethodAssociation:
is_a: EvidenceAssociation
is_a: AlleleAssociation
slots:
- mutation_target_strain
attributes:
allele_generation_method_association_object:
range: GenerationMethod
required: true
slot_usage:
subject:
range: Allele
relation:
any_of:
equals_string: has_generation_method
notes: CV 'Allele Generation Method Association Relation'
object:
range: GenerationMethod

AlleleGenerationMethodAssociationDTO:
is_a: EvidenceAssociationDTO
Expand All @@ -499,20 +520,16 @@ classes:
equals_string: has_generation_method

AlleleGenomicEntityAssociation:
is_a: EvidenceAssociation
is_a: AlleleAssociation
abstract: true
description: >-
Association between an allele and a genomic entity
slots:
- evidence_code
- related_note
slot_usage:
subject:
range: Allele
relation:
range: VocabularyTerm # If we can adequately represent all needed relations in RO, this could be ROTerm
object:
range: GenomicEntity
evidence:
required: false # This needs to be not required, at least in the base class

Expand All @@ -526,18 +543,18 @@ classes:
- note_dto

AlleleImageAssociation:
is_a: EvidenceAssociation
is_a: AlleleAssociation
description: >-
The relationship between an allele and an image.
slots:
- primary_image
attributes:
allele_image_association_object:
range: Image
required: true
slot_usage:
subject:
range: Allele
relation:
range: VocabularyTerm
object:
range: Image
primary_image:
description: >-
Can be null; if false, maybe you would show all the images.
Expand All @@ -559,14 +576,13 @@ classes:
We need to revisit this issue.
AlleleOriginAssociation:
is_a: EvidenceAssociation
is_a: AlleleAssociation
description: >-
The relationship between an allele and the origin of the allele.
slot_usage:
subject:
range: Allele
object:
attributes:
allele_origin_association_object:
range: AffectedGenomicModel
required: true

AlleleOriginAssociationDTO:
is_a: EvidenceAssociationDTO
Expand All @@ -581,9 +597,11 @@ classes:
is_a: AlleleGenomicEntityAssociation
description: >-
Association between an allele and a protein
slot_usage:
object:
attributes:
allele_protein_association_object:
range: Protein
required: true


AlleleProteinAssociationDTO:
is_a: AlleleGenomicEntityAssociationDTO
Expand All @@ -596,9 +614,11 @@ classes:
is_a: AlleleGenomicEntityAssociation
description: >-
Association between an allele and a transcript
slot_usage:
object:
attributes:
allele_transcript_association_object:
range: Transcript
required: true


AlleleTranscriptAssociationDTO:
is_a: AlleleGenomicEntityAssociationDTO
Expand All @@ -613,12 +633,11 @@ classes:
The relationship between an allele and a variant is many to many. An
Allele may have many variants and a variant can be present in many
alleles.
slot_usage:
subject:
range: Allele
object:
attributes:
allele_variant_association_object:
range: Variant

required: true

AlleleVariantAssociationDTO:
is_a: AlleleGenomicEntityAssociationDTO
description: >-
Expand Down
12 changes: 7 additions & 5 deletions model/schema/biologicalEntitySet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,17 @@ classes:
- proteins


GeneToPathwayAssociation:
GenePathwayAssociation:
is_a: EvidenceAssociation
slots:
- gene_association_subject
attributes:
gene_pathway_association_object:
range: Pathway
required: true
slot_usage:
relation:
subproperty_of: has_participant
subject:
range: Gene
object:
range: Pathway


## ------------
Expand Down
31 changes: 4 additions & 27 deletions model/schema/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -325,22 +325,18 @@ classes:
of the association, and likewise the object is the curie (or identifier of the class that is the object. The
relationship between subject and object is defined by the relation slot (which can also be constrained
using the range of the relation).
exact_mappings:
- biolink:association
notes:
Keeping this more generic than biolink:association by foregoing the
qualifiers and negated slots.
Association child classes must also have subject and object slots defined, but (due to implementation issues)
these must have distinct names if the range of the slot inherits from a different base table in the database.
Therefore these are defined in the appropriate classes with a prefix indicating the class(es) using the slot,
e.g. disease_annotation_subject, allele_association_subject, allele_construct_association_object.
slots:
- subject
- relation
- object
slot_usage:
subject:
required: true
relation:
required: true
object:
required: true

SingleReferenceAssociation:
abstract: true
Expand Down Expand Up @@ -1200,25 +1196,6 @@ slots:
## ASSOCIATION SLOTS
## --------------------

subject:
is_a: association_slot
description: >-
connects an association to the subject of the association.
For example, in a gene-to-phenotype association, the gene is subject and phenotype is object.
required: true
exact_mappings:
- owl:annotatedSource
- biolink:subject

object:
is_a: association_slot
description: >-
connects an association to the object of the association.
For example, in a gene-to-phenotype association, the gene is subject and phenotype is object.
required: true
exact_mappings:
- biolink:object

relation:
is_a: association_slot
description: >-
Expand Down
18 changes: 13 additions & 5 deletions model/schema/expression.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,25 @@ classes:
- cellular_component
- spatial_qualifiers

ExpressionAnnotationImagePane:
ExpressionAnnotationAssociation:
is_a: EvidenceAssociation
abstract: true
description: Base class for all ExpressionAnnotation associations
attributes:
expression_annotation_subject:
required: true
domain: ExpressionAnnotation

ExpressionAnnotationImagePaneAssociation:
is_a: EvidenceAssociation
notes: >-
This aims to provide the same functionality as MGI imagepane.
Some MODs (like ZFIN) point to the whole image. In these cases,
the pane would encompass the whole image.
slot_usage:
subject:
range: ExpressionAnnotation
object:
attributes:
expression_annotation_image_pane_association_object:
range: ImagePane
required: true

# GeneExpressionStatement:
# is_a: EntityStatement # Update to use Note class instead?
Expand Down
Loading

0 comments on commit ace8336

Please sign in to comment.