Skip to content

Instantly share code, notes, and snippets.

@dosumis
dosumis / Male_fru_clones_label2sfID.tsv
Created February 19, 2015 12:21
ID mapping for male fruitless clones
label shortFormID
aDT-b_M VFB_00017893
aDT-a_M VFB_00017892
aDT-c_M VFB_00017895
aDT-d_M VFB_00017896
aDT-e_M VFB_00017897
aDT-f_M VFB_00017898
aDT-g_M VFB_00017899
aDT-h_M VFB_00017900
aIP-a_M VFB_00017901
# The ontology URI
ontology_uri http://purl.obolibrary.org/obo/fbbt/fbbt-simple.owl
# The full name of the ontology
title Drosophila Anatomy Ontology
# The short name for this ontology
namespace fbbt
# The location to download this ontology (can also be local file path e.g. file:/tmp/uberon.owl
# The ontology URI
ontology_uri http://purl.obolibrary.org/obo/fbbt/fbbt-relaxed.owl
# The full name of the ontology
title Drosophila Anatomy Ontology
# The short name for this ontology
namespace fbbt
# The location to download this ontology (can also be local file path e.g. file:/tmp/uberon.owl
@dosumis
dosumis / simple_json_query.py
Last active August 29, 2015 14:19
Simple script taking spec of query as JSON and returning standard JSON report of each term found. Uses Brain
from uk.ac.ebi.brain.core import Brain
import json
from owltools.graph import OWLGraphWrapper
import re
import sys
def write_json(json_var, path):
"""Writes json_var to file (path) with a nicely serialised layout."""
json_file = open(path, "w")
#!/usr/bin/env jython -J-Xmx2000m
from uk.ac.ebi.brain.core import Brain
import json
from owltools.graph import OWLGraphWrapper
import re
import sys
## This script defines a class for running Brain queries using input specified as JSON
## It may be useful for designing an http server for running Brian queries via JSON post requests
VFBid FBtp
VFB_00022854 FBtp0057734
VFB_00023261 FBtp0063757
VFB_00021683 FBtp0060786
VFB_00023178 FBtp0063948
VFB_00022080 FBtp0060963
VFB_00023179 FBtp0062430
VFB_00020539 FBtp0061159
VFB_00020538 FBtp0058317
VFB_00020533 FBtp0059101
import json
j = open("Jenett2012.json", "r")
jj = json.loads(j.read())
out = open("VFB2FBbt.tsv", "w+")
out.write("VFBid\tFBtp\n")
for k, v in jj.items():
for t in v['Types']:
if t['isAnonymous'] and t['relId'] == 'RO_0002292':
out.write(k + "\t" + t['objectId'] + "\n")
import json
j = open("flycircuit_plus.json", "r")
jj = json.loads(j.read())
for k, v in jj.items():
for t in v['Types']:
if not t['isAnonymous']
out.write(k + "\t" + t['objectId'] + "\n") # k = VFB individual ID, t['objectId'] = FBbt ID of type.
@dosumis
dosumis / vfb_expression_graphgist.txt
Last active February 8, 2016 15:35
Draft VFB neo4J expression schema
== Documentation of the VFB expression pattern schema ==
Aims:
* Represent expression curation in FlyBase in queryable graph form.
* Integrate expression curation from FlyBase with annoated images maintained in the VFB KB.
=== Schema
[source,cypher]
pattern_name: evidence_used_in_assertion
classes:
'assertion_method': ECO_0000217
relations:
'used_in': ECO_9000000
vars: