Skip to content

Instantly share code, notes, and snippets.

Prefix(:=<http://www.semanticweb.org/davidos/ontologies/2020/9/untitled-ontology-21#>)
Prefix(owl:=<http://www.w3.org/2002/07/owl#>)
Prefix(rdf:=<http://www.w3.org/1999/02/22-rdf-syntax-ns#>)
Prefix(xml:=<http://www.w3.org/XML/1998/namespace>)
Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)
Prefix(rdfs:=<http://www.w3.org/2000/01/rdf-schema#>)
Ontology(<http://www.semanticweb.org/davidos/ontologies/2020/9/untitled-ontology-21>
Prefix(:=<http://www.semanticweb.org/davidos/ontologies/2020/9/untitled-ontology-21#>)
Prefix(owl:=<http://www.w3.org/2002/07/owl#>)
Prefix(rdf:=<http://www.w3.org/1999/02/22-rdf-syntax-ns#>)
Prefix(xml:=<http://www.w3.org/XML/1998/namespace>)
Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)
Prefix(rdfs:=<http://www.w3.org/2000/01/rdf-schema#>)
Ontology(<http://www.semanticweb.org/davidos/ontologies/2020/9/untitled-ontology-21>
@dosumis
dosumis / presence_absence_morphology.owl
Created August 28, 2020 08:38
Extension of presence_absence.owl from http://purl.org/phenoscape/demo/presence_absence.owl to include grouping and morphology phenotypes
Prefix(:=<http://purl.org/phenoscape/demo/presence_absence.owl#>)
Prefix(owl:=<http://www.w3.org/2002/07/owl#>)
Prefix(rdf:=<http://www.w3.org/1999/02/22-rdf-syntax-ns#>)
Prefix(xml:=<http://www.w3.org/XML/1998/namespace>)
Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)
Prefix(rdfs:=<http://www.w3.org/2000/01/rdf-schema#>)
Ontology(<http://purl.org/phenoscape/demo/presence_absence.owl>
Annotation(<http://purl.org/dc/terms/creator> <http://orcid.org/0000-0001-7972-3866>)
from vfb_connect.cross_server_tools import VfbConnect
vc = VfbConnect()
out = set()
for x in vc.oc.lookup.keys():
m = re.findall('[^A-Za-z0-9 ]', x)
if m:
out.update(m)
@dosumis
dosumis / uber_check.py
Created June 2, 2020 08:45
Validate ccf.owl partonomy against Uberon using renci uberongraph endpoint. (secondary checks for overlaps and subClassOf)
import rdflib
from SPARQLWrapper import SPARQLWrapper, JSON
import time
g = rdflib.Graph()
g.parse('http://purl.org/ccf/latest/ccf.owl')
ccf_po_query = """
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ccf: <https://purl.org/ccf/latest/ccf.owl#>
@dosumis
dosumis / README.md
Last active April 2, 2020 09:07
vfb_expression_list

Using datasource: dbi:Pg:dbname=fb_2020_02_05;host=deneb.pdn.cam.ac.uk;port=5432

./get_vfb_exp_list.pl started at: Mon Feb 24 12:41:53 2020

The following papers require vfb expression curation. They have already been thin curated.

@dosumis
dosumis / FlyBase_linkout_gen.py
Created March 25, 2020 17:58
Scripts for generating FB->VFB linkouts
from vfb_connect.neo.neo4j_tools import Neo4jConnect, dict_cursor
nc = Neo4jConnect('http://kb.virtualflybrain.org', 'neo4j', 'neo4j')
query = """MATCH (f:Feature)<-[]-(ep:Class)-[dbx:hasDbXref]->(s:Site)
WHERE (s.short_form = 'FlyLight') OR (s.short_form = 'FlyLightSplit')
WITH f, ep MATCH (ep)<-[:INSTANCEOF]-(i:Individual)
<-[]-(channel:Individual)-[irw:in_register_with]->(t:Individual)
WITH distinct f.short_form AS `#FlyBase ID`,
collect(i.short_form)[0] AS DBURL, ep.label AS epl, t.label as template
@dosumis
dosumis / MEl_phenotype_x_pigmentation_proc
Last active March 10, 2020 12:54
MP_proc_x_ME_phenotype_breakdown
'abnormal Harderian gland pigmentation'
'abnormal agouti pigmentation'
'abnormal choroid melanin granule morphology'
'abnormal choroid melanocyte morphology'
'abnormal choroid pigmentation'
'abnormal ciliary body pigmentation'
'abnormal coat/hair pigmentation'
'abnormal dermal melanocyte morphology'
'abnormal dermal pigmentation'
'abnormal digit pigmentation'
{
"cells": [
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
@dosumis
dosumis / JSON_schema_test_required.py
Last active December 17, 2018 16:09
A quick demo of how to use JPATH to test whether JSON schema required fields are all valid property keys
from jsonpath_rw import parse
import json
vfbsf = open("./json_schema/vfb_termInfo.json", "r")
vfbs = json.loads(vfbsf.read())
R = parse('*..required')
P = parse('*..properties')
Rs = [match for match in R.find(vfbs)]
Ps = [match for match in P.find(vfbs)]