Skip to content

Instantly share code, notes, and snippets.

@dustine32
Last active July 28, 2022 17:42
Show Gist options
  • Save dustine32/36748e034a5556464b0e067a8d22c2b6 to your computer and use it in GitHub Desktop.
Save dustine32/36748e034a5556464b0e067a8d22c2b6 to your computer and use it in GitHub Desktop.
Causal GO-CAMs-to-genes list query
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX gomodel: <http://model.geneontology.org/>
PREFIX MF: <http://purl.obolibrary.org/obo/GO_0003674>
PREFIX causally_upstream_of_or_within: <http://purl.obolibrary.org/obo/RO_0002418>
PREFIX causally_upstream_of_or_within_negative_effect: <http://purl.obolibrary.org/obo/RO_0004046>
PREFIX causally_upstream_of_or_within_positive_effect: <http://purl.obolibrary.org/obo/RO_0004047>
PREFIX causally_upstream_of: <http://purl.obolibrary.org/obo/RO_0002411>
PREFIX causally_upstream_of_negative_effect: <http://purl.obolibrary.org/obo/RO_0002305>
PREFIX causally_upstream_of_positive_effect: <http://purl.obolibrary.org/obo/RO_0002304>
PREFIX regulates: <http://purl.obolibrary.org/obo/RO_0002211>
PREFIX negatively_regulates: <http://purl.obolibrary.org/obo/RO_0002212>
PREFIX positively_regulates: <http://purl.obolibrary.org/obo/RO_0002213>
PREFIX directly_regulates: <http://purl.obolibrary.org/obo/RO_0002578>
PREFIX directly_positively_regulates: <http://purl.obolibrary.org/obo/RO_0002629>
PREFIX directly_negatively_regulates: <http://purl.obolibrary.org/obo/RO_0002630>
PREFIX directly_activates: <http://purl.obolibrary.org/obo/RO_0002406>
PREFIX indirectly_activates: <http://purl.obolibrary.org/obo/RO_0002407>
PREFIX directly_inhibits: <http://purl.obolibrary.org/obo/RO_0002408>
PREFIX indirectly_inhibits: <http://purl.obolibrary.org/obo/RO_0002409>
PREFIX transitively_provides_input_for: <http://purl.obolibrary.org/obo/RO_0002414>
PREFIX immediately_causally_upstream_of: <http://purl.obolibrary.org/obo/RO_0002412>
PREFIX directly_provides_input_for: <http://purl.obolibrary.org/obo/RO_0002413>
SELECT ?gocam ?title (GROUP_CONCAT(distinct ?gp_label;separator=",") as ?gp_labels) (GROUP_CONCAT(distinct ?gptype;separator=",") as ?gptypes) (GROUP_CONCAT(distinct ?taxon;separator=",") as ?taxons) (GROUP_CONCAT(distinct ?taxon_label;separator=",") as ?taxon_labels) ?modelstate
WHERE
{
VALUES ?causal { causally_upstream_of_or_within: causally_upstream_of_or_within_negative_effect: causally_upstream_of_or_within_positive_effect:
causally_upstream_of: causally_upstream_of_negative_effect: causally_upstream_of_positive_effect: regulates:
negatively_regulates: positively_regulates: directly_regulates: directly_positively_regulates: directly_negatively_regulates:
directly_activates: indirectly_activates: directly_inhibits: indirectly_inhibits: transitively_provides_input_for:
immediately_causally_upstream_of: directly_provides_input_for: }
GRAPH ?gocam {
?gocam gomodel:graphType gomodel:noctuaCam .
?ind1 ?causal ?ind2 .
?ind2 ?causal ?ind3 .
}
GRAPH ?gocam {
?gp1 a ?gptype .
?gocam rdf:type owl:Ontology .
?gocam <https://w3id.org/biolink/vocab/in_taxon> ?taxon .
?gocam <http://geneontology.org/lego/modelstate> ?modelstate .
?gocam dc:date ?date .
?gocam dc:title ?title
}
?ind1 rdf:type MF: .
?ind2 rdf:type MF: .
?ind3 rdf:type MF: .
?gptype <http://www.geneontology.org/formats/oboInOwl#hasBroadSynonym> ?gp_label .\
?gptype <https://w3id.org/biolink/vocab/category> <https://w3id.org/biolink/vocab/MacromolecularMachine> .
FILTER(contains(?gp_label, " ") = false) .
?taxon rdfs:label ?taxon_label .
FILTER(?gptype != owl:NamedIndividual) .
# FILTER(?gocam = gomodel:5ce58dde00001215) .
FILTER(?modelstate = "production") .
}
GROUP BY ?gocam ?title ?modelstate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment