-
Notifications
You must be signed in to change notification settings - Fork 30
/
test_golr_query.py
33 lines (27 loc) · 983 Bytes
/
test_golr_query.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from ontobio.golr.golr_query import GolrAssociationQuery, GolrSearchQuery
HUMAN_SHH = 'NCBIGene:6469'
HOLOPROSENCEPHALY = 'HP:0001360'
TWIST_ZFIN = 'ZFIN:ZDB-GENE-050417-357'
DVPF = 'GO:0009953'
def test_pheno_assocs():
q = GolrAssociationQuery(subject=TWIST_ZFIN,
object_category='phenotype')
print("Q={}".format(q))
print("Q.subject={}".format(q.subject))
print("Q.evidec={}".format(q.evidence))
params = q.solr_params()
print("PARAMS={}".format(params))
results = q.exec()
print("RES={}".format(results))
assert len(results) > 0
def test_go_assocs():
q = GolrAssociationQuery(subject=TWIST_ZFIN,
object_category='function')
print("Q={}".format(q))
print("Q.subject={}".format(q.subject))
print("Q.evidec={}".format(q.evidence))
params = q.solr_params()
print("PARAMS={}".format(params))
results = q.exec()
print("RES={}".format(results))
assert len(results) > 0