sparql-examples

A set of SPARQL examples that are used in different SIB resources

View the Project on GitHub sib-swiss/sparql-examples

64_diseases_related_to_mutation_in_active_site

Find (Human Genetic) diseases, that are related to a natural variant on the active site of an enzyme.

Use at

PREFIX faldo: <http://biohackathon.org/resource/faldo#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
PREFIX up: <http://purl.uniprot.org/core/>

SELECT
  DISTINCT
   ?disease
WHERE {
  ?protein a up:Protein ;
    up:organism taxon:9606 ;
    up:annotation ?disease_annotation, ?active_site_annotation, ?natural_variant_annotation .
  {
    ?protein up:enzyme [] .
  } UNION {
  ?protein up:annotation/a up:Catalytic_Activity_Annotation .
  }
  ?disease_annotation a up:Disease_Annotation ;
  up:disease ?disease .
  ?active_site_annotation a up:Active_Site_Annotation ;
  up:range ?active_site_range .
  ?active_site_range faldo:begin ?active_site_begin .
  ?active_site_begin faldo:position ?active_site_position ;
                     faldo:reference ?sequence .
  ?natural_variant_annotation a up:Natural_Variant_Annotation ;
  up:range ?natural_variant_range ;
  skos:related ?disease .
  ?natural_variant_range faldo:begin ?natural_variant_begin ;
                         faldo:end ?natural_variant_end .
  ?natural_variant_begin faldo:position ?natural_variant_begin_position .
  ?natural_variant_end faldo:position ?natural_variant_end_position ;
                       faldo:reference ?sequence .

  FILTER(?natural_variant_begin_position >= ?active_site_position && ?active_site_position <= ?natural_variant_end_position)
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v6("?active_site_annotation")
  v10("?active_site_begin")
  v2("?active_site_position")
  v9("?active_site_range")
  v8("?disease"):::projected 
  v5("?disease_annotation")
  v7("?natural_variant_annotation")
  v13("?natural_variant_begin")
  v1("?natural_variant_begin_position")
  v14("?natural_variant_end")
  v3("?natural_variant_end_position")
  v12("?natural_variant_range")
  v4("?protein")
  v11("?sequence")
  a1((" "))
  a2((" "))
  c8(["up:Disease_Annotation"]):::iri 
  c10(["up:Active_Site_Annotation"]):::iri 
  c4(["taxon:9606"]):::iri 
  c15(["up:Natural_Variant_Annotation"]):::iri 
  c7(["up:Catalytic_Activity_Annotation"]):::iri 
  c2(["up:Protein"]):::iri 
  f0[["?natural_variant_begin_position >= ?active_site_position?active_site_position <= ?natural_variant_end_position"]]
  f0 --> v1
  f0 --> v2
  f0 --> v3
  v4 --"a"-->  c2
  v4 --"up:organism"-->  c4
  v4 --"up:annotation"-->  v5
  v4 --"up:annotation"-->  v6
  v4 --"up:annotation"-->  v7
  subgraph union0[" Union "]
  subgraph union0l[" "]
    style union0l fill:#abf,stroke-dasharray: 3 3;
    v4 --"up:annotation"-->  a2
    a2 --"a"-->  c7
  end
  subgraph union0r[" "]
    style union0r fill:#abf,stroke-dasharray: 3 3;
    v4 --"up:enzyme"-->  a1
  end
  union0r <== or ==> union0l
  end
  v5 --"a"-->  c8
  v5 --"up:disease"-->  v8
  v6 --"a"-->  c10
  v6 --"up:range"-->  v9
  v9 --"faldo:begin"-->  v10
  v10 --"faldo:position"-->  v2
  v10 --"faldo:reference"-->  v11
  v7 --"a"-->  c15
  v7 --"up:range"-->  v12
  v7 --"skos:related"-->  v8
  v12 --"faldo:begin"-->  v13
  v12 --"faldo:end"-->  v14
  v13 --"faldo:position"-->  v1
  v14 --"faldo:position"-->  v3
  v14 --"faldo:reference"-->  v11