vfbquery 0.3.2__py3-none-any.whl → 0.3.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- test/term_info_queries_test.py +28 -11
- vfbquery/__init__.py +3 -0
- vfbquery/solr_fetcher.py +13 -2
- vfbquery/vfb_queries.py +39 -15
- {vfbquery-0.3.2.dist-info → vfbquery-0.3.3.dist-info}/METADATA +60 -67
- vfbquery-0.3.3.dist-info/RECORD +14 -0
- {vfbquery-0.3.2.dist-info → vfbquery-0.3.3.dist-info}/WHEEL +1 -1
- vfbquery-0.3.2.dist-info/RECORD +0 -14
- {vfbquery-0.3.2.dist-info → vfbquery-0.3.3.dist-info}/LICENSE +0 -0
- {vfbquery-0.3.2.dist-info → vfbquery-0.3.3.dist-info}/top_level.txt +0 -0
test/term_info_queries_test.py
CHANGED
|
@@ -12,7 +12,7 @@ class TermInfoQueriesTest(unittest.TestCase):
|
|
|
12
12
|
|
|
13
13
|
def test_term_info_deserialization(self):
|
|
14
14
|
terminfo_json = """
|
|
15
|
-
{"term": {"core": {"iri": "http://purl.obolibrary.org/obo/FBbt_00048514", "symbol": "BM-Taste", "types": ["Entity", "Adult", "Anatomy", "Cell", "Class", "Mechanosensory_system", "Nervous_system", "Neuron", "Sensory_neuron"], "short_form": "FBbt_00048514", "unique_facets": ["Adult", "Mechanosensory_system", "Nervous_system", "Sensory_neuron"], "label": "labial taste bristle mechanosensory neuron"}, "description": ["Any mechanosensory neuron (FBbt:00005919) that has sensory dendrite in some labellar taste bristle (FBbt:00004162)."], "comment": []}, "query": "Get JSON for Neuron Class", "version": "3d2a474", "parents": [{"symbol": "", "iri": "http://purl.obolibrary.org/obo/FBbt_00048508", "types": ["Entity", "Anatomy", "Cell", "Class", "Mechanosensory_system", "Nervous_system", "Neuron", "Sensory_neuron"], "short_form": "FBbt_00048508", "unique_facets": ["Mechanosensory_system", "Nervous_system", "Sensory_neuron"], "label": "mechanosensory neuron of chaeta"}, {"symbol": "", "iri": "http://purl.obolibrary.org/obo/FBbt_00051420", "types": ["Entity", "Adult", "Anatomy", "Cell", "Class", "Mechanosensory_system", "Nervous_system", "Neuron", "Sensory_neuron"], "short_form": "FBbt_00051420", "unique_facets": ["Adult", "Mechanosensory_system", "Nervous_system", "Sensory_neuron"], "label": "adult mechanosensory neuron"}, {"symbol": "", "iri": "http://purl.obolibrary.org/obo/FBbt_00048029", "types": ["Entity", "Adult", "Anatomy", "Cell", "Class", "Nervous_system", "Neuron", "Sensory_neuron"], "short_form": "FBbt_00048029", "unique_facets": ["Adult", "Nervous_system", "Sensory_neuron"], "label": "labellar taste bristle sensory neuron"}], "relationships": [{"relation": {"iri": "http://purl.obolibrary.org/obo/BFO_0000050", "label": "is part of", "type": "part_of"}, "object": {"symbol": "", "iri": "http://purl.obolibrary.org/obo/FBbt_00005892", "types": ["Entity", "Adult", "Anatomy", "Class", "Nervous_system"], "short_form": "FBbt_00005892", "unique_facets": ["Adult", "Nervous_system"], "label": "adult peripheral nervous system"}}], "xrefs": [], "anatomy_channel_image": [], "pub_syn": [{"synonym": {"scope": "has_exact_synonym", "label": "labellar taste bristle mechanosensitive neuron", "type": ""}, "pub": {"core": {"symbol": "", "iri": "http://flybase.org/reports/Unattributed", "types": ["Entity", "Individual", "pub"], "short_form": "Unattributed", "unique_facets": ["pub"], "label": ""}, "FlyBase": "", "PubMed": "", "DOI": ""}}, {"synonym": {"scope": "has_exact_synonym", "label": "labellar taste bristle
|
|
15
|
+
{"term": {"core": {"iri": "http://purl.obolibrary.org/obo/FBbt_00048514", "symbol": "BM-Taste", "types": ["Entity", "Adult", "Anatomy", "Cell", "Class", "Mechanosensory_system", "Nervous_system", "Neuron", "Sensory_neuron"], "short_form": "FBbt_00048514", "unique_facets": ["Adult", "Mechanosensory_system", "Nervous_system", "Sensory_neuron"], "label": "labial taste bristle mechanosensory neuron"}, "description": ["Any mechanosensory neuron (FBbt:00005919) that has sensory dendrite in some labellar taste bristle (FBbt:00004162)."], "comment": []}, "query": "Get JSON for Neuron Class", "version": "3d2a474", "parents": [{"symbol": "", "iri": "http://purl.obolibrary.org/obo/FBbt_00048508", "types": ["Entity", "Anatomy", "Cell", "Class", "Mechanosensory_system", "Nervous_system", "Neuron", "Sensory_neuron"], "short_form": "FBbt_00048508", "unique_facets": ["Mechanosensory_system", "Nervous_system", "Sensory_neuron"], "label": "mechanosensory neuron of chaeta"}, {"symbol": "", "iri": "http://purl.obolibrary.org/obo/FBbt_00051420", "types": ["Entity", "Adult", "Anatomy", "Cell", "Class", "Mechanosensory_system", "Nervous_system", "Neuron", "Sensory_neuron"], "short_form": "FBbt_00051420", "unique_facets": ["Adult", "Mechanosensory_system", "Nervous_system", "Sensory_neuron"], "label": "adult mechanosensory neuron"}, {"symbol": "", "iri": "http://purl.obolibrary.org/obo/FBbt_00048029", "types": ["Entity", "Adult", "Anatomy", "Cell", "Class", "Nervous_system", "Neuron", "Sensory_neuron"], "short_form": "FBbt_00048029", "unique_facets": ["Adult", "Nervous_system", "Sensory_neuron"], "label": "labellar taste bristle sensory neuron"}], "relationships": [{"relation": {"iri": "http://purl.obolibrary.org/obo/BFO_0000050", "label": "is part of", "type": "part_of"}, "object": {"symbol": "", "iri": "http://purl.obolibrary.org/obo/FBbt_00005892", "types": ["Entity", "Adult", "Anatomy", "Class", "Nervous_system"], "short_form": "FBbt_00005892", "unique_facets": ["Adult", "Nervous_system"], "label": "adult peripheral nervous system"}}], "xrefs": [], "anatomy_channel_image": [], "pub_syn": [{"synonym": {"scope": "has_exact_synonym", "label": "labellar taste bristle mechanosensitive neuron", "type": ""}, "pub": {"core": {"symbol": "", "iri": "http://flybase.org/reports/Unattributed", "types": ["Entity", "Individual", "pub"], "short_form": "Unattributed", "unique_facets": ["pub"], "label": ""}, "FlyBase": "", "PubMed": "", "DOI": ""}}, {"synonym": {"scope": "has_exact_synonym", "label": "labellar taste bristle mechanosensitive neuron", "type": ""}, "pub": {"core": {"symbol": "", "iri": "http://flybase.org/reports/Unattributed", "types": ["Entity", "Individual", "pub"], "short_form": "Unattributed", "unique_facets": ["pub"], "label": ""}, "FlyBase": "", "PubMed": "", "DOI": ""}}, {"synonym": {"scope": "has_exact_synonym", "label": "labial taste bristle mechanosensitive neuron", "type": ""}, "pub": {"core": {"symbol": "", "iri": "http://flybase.org/reports/Unattributed", "types": ["Entity", "Individual", "pub"], "short_form": "Unattributed", "unique_facets": ["pub"], "label": ""}, "FlyBase": "", "PubMed": "", "DOI": ""}}], "def_pubs": [{"core": {"symbol": "", "iri": "http://flybase.org/reports/FBrf0242472", "types": ["Entity", "Individual", "pub"], "short_form": "FBrf0242472", "unique_facets": ["pub"], "label": "Zhou et al., 2019, Sci. Adv. 5(5): eaaw5141"}, "FlyBase": "", "PubMed": "31131327", "DOI": "10.1126/sciadv.aaw5141"}], "targeting_splits": []}
|
|
16
16
|
"""
|
|
17
17
|
|
|
18
18
|
terminfo = deserialize_term_info(terminfo_json)
|
|
@@ -38,15 +38,21 @@ class TermInfoQueriesTest(unittest.TestCase):
|
|
|
38
38
|
self.assertEqual("", terminfo.pub_syn[0].pub.PubMed)
|
|
39
39
|
|
|
40
40
|
def test_term_info_deserialization_from_dict(self):
|
|
41
|
+
import pkg_resources
|
|
42
|
+
print("vfb_connect version:", pkg_resources.get_distribution("vfb_connect").version)
|
|
41
43
|
vfbTerm = self.vc.get_TermInfo(['FBbt_00048514'], return_dataframe=False, summary=False)[0]
|
|
42
44
|
start_time = time.time()
|
|
43
45
|
terminfo = deserialize_term_info_from_dict(vfbTerm)
|
|
44
46
|
print("--- %s seconds ---" % (time.time() - start_time))
|
|
45
|
-
print(vfbTerm)
|
|
46
|
-
print(terminfo)
|
|
47
|
+
print("vfbTerm:", vfbTerm)
|
|
48
|
+
print("terminfo:", terminfo)
|
|
49
|
+
# Add debug for unique_facets
|
|
50
|
+
if hasattr(terminfo.term.core, 'unique_facets'):
|
|
51
|
+
print("unique_facets:", terminfo.term.core.unique_facets)
|
|
52
|
+
else:
|
|
53
|
+
print("unique_facets attribute NOT present!")
|
|
47
54
|
|
|
48
55
|
self.assertEqual("Get JSON for Neuron Class", terminfo.query)
|
|
49
|
-
|
|
50
56
|
self.assertEqual("http://purl.obolibrary.org/obo/FBbt_00048514", terminfo.term.core.iri)
|
|
51
57
|
self.assertEqual("BM-Taste", terminfo.term.core.symbol)
|
|
52
58
|
# TODO: XXX unique facets are not in vfb_connect release
|
|
@@ -59,12 +65,23 @@ class TermInfoQueriesTest(unittest.TestCase):
|
|
|
59
65
|
self.assertEqual(0, len(terminfo.xrefs))
|
|
60
66
|
|
|
61
67
|
self.assertEqual(6, len(terminfo.pub_syn))
|
|
62
|
-
|
|
63
|
-
#
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
+
|
|
69
|
+
# Check that we have the expected synonym labels (order-independent)
|
|
70
|
+
synonym_labels = [entry.synonym.label for entry in terminfo.pub_syn]
|
|
71
|
+
expected_labels = ["labellar taste bristle mechanosensitive neuron", "labellar hMSN", "labial taste bristle mechanosensory neuron"]
|
|
72
|
+
|
|
73
|
+
# Check that at least one of the expected labels exists
|
|
74
|
+
found_labels = [label for label in expected_labels if label in synonym_labels]
|
|
75
|
+
self.assertTrue(len(found_labels) > 0, f"None of the expected synonym labels found. Found: {synonym_labels}")
|
|
76
|
+
|
|
77
|
+
# Check that entries with "Unattributed" pub exist (most entries should have this)
|
|
78
|
+
unattributed_entries = [entry for entry in terminfo.pub_syn if entry.pub.core.short_form == "Unattributed"]
|
|
79
|
+
self.assertTrue(len(unattributed_entries) > 0, "No entries with 'Unattributed' pub found")
|
|
80
|
+
|
|
81
|
+
# Check for the PubMed ID in the correct synonym entry (labellar hMSN)
|
|
82
|
+
labellar_hmsn_entry = next((entry for entry in terminfo.pub_syn if entry.synonym.label == "labellar hMSN"), None)
|
|
83
|
+
self.assertIsNotNone(labellar_hmsn_entry, "labellar hMSN entry not found")
|
|
84
|
+
self.assertEqual("33657409", labellar_hmsn_entry.pub.PubMed)
|
|
68
85
|
|
|
69
86
|
def test_term_info_serialization_individual_anatomy(self):
|
|
70
87
|
term_info_dict = self.vc.get_TermInfo(['VFB_00010001'], return_dataframe=False, summary=False)[0]
|
|
@@ -329,7 +346,7 @@ class TermInfoQueriesTest(unittest.TestCase):
|
|
|
329
346
|
'(http://splitgal4.janelia.org/cgi-bin/view_splitgal4_imagery.cgi?line=SS50574) '},
|
|
330
347
|
serialized["xrefs"][0])
|
|
331
348
|
|
|
332
|
-
self.
|
|
349
|
+
self.assertTrue("examples" in serialized)
|
|
333
350
|
self.assertFalse("thumbnail" in serialized)
|
|
334
351
|
self.assertFalse("references" in serialized)
|
|
335
352
|
self.assertFalse("targetingSplits" in serialized)
|
vfbquery/__init__.py
CHANGED
vfbquery/solr_fetcher.py
CHANGED
|
@@ -3,7 +3,6 @@ import json
|
|
|
3
3
|
import logging
|
|
4
4
|
import pandas as pd
|
|
5
5
|
from typing import List, Dict, Any, Optional, Union
|
|
6
|
-
from vfb_connect import vfb
|
|
7
6
|
|
|
8
7
|
class SolrTermInfoFetcher:
|
|
9
8
|
"""Fetches term information directly from the Solr server instead of using VfbConnect"""
|
|
@@ -12,7 +11,19 @@ class SolrTermInfoFetcher:
|
|
|
12
11
|
"""Initialize with the Solr server URL"""
|
|
13
12
|
self.solr_url = solr_url
|
|
14
13
|
self.logger = logging.getLogger(__name__)
|
|
15
|
-
self.
|
|
14
|
+
self._vfb = None # Lazy load vfb_connect
|
|
15
|
+
|
|
16
|
+
@property
|
|
17
|
+
def vfb(self):
|
|
18
|
+
"""Lazy load vfb_connect to avoid import issues during testing"""
|
|
19
|
+
if self._vfb is None:
|
|
20
|
+
try:
|
|
21
|
+
from vfb_connect import vfb
|
|
22
|
+
self._vfb = vfb
|
|
23
|
+
except ImportError as e:
|
|
24
|
+
self.logger.error(f"Could not import vfb_connect: {e}")
|
|
25
|
+
raise ImportError("vfb_connect is required but could not be imported")
|
|
26
|
+
return self._vfb
|
|
16
27
|
|
|
17
28
|
def get_TermInfo(self, short_forms: List[str],
|
|
18
29
|
return_dataframe: bool = False,
|
vfbquery/vfb_queries.py
CHANGED
|
@@ -2,14 +2,22 @@ import pysolr
|
|
|
2
2
|
from .term_info_queries import deserialize_term_info
|
|
3
3
|
# Replace VfbConnect import with our new SolrTermInfoFetcher
|
|
4
4
|
from .solr_fetcher import SolrTermInfoFetcher
|
|
5
|
-
# Keep dict_cursor if it's used elsewhere
|
|
6
|
-
from vfb_connect.cross_server_tools import dict_cursor
|
|
5
|
+
# Keep dict_cursor if it's used elsewhere - lazy import to avoid GUI issues
|
|
7
6
|
from marshmallow import Schema, fields, post_load
|
|
8
7
|
from typing import List, Tuple, Dict, Any, Union
|
|
9
8
|
import pandas as pd
|
|
10
9
|
from marshmallow import ValidationError
|
|
11
10
|
import json
|
|
12
11
|
|
|
12
|
+
# Lazy import for dict_cursor to avoid GUI library issues
|
|
13
|
+
def get_dict_cursor():
|
|
14
|
+
"""Lazy import dict_cursor to avoid import issues during testing"""
|
|
15
|
+
try:
|
|
16
|
+
from vfb_connect.cross_server_tools import dict_cursor
|
|
17
|
+
return dict_cursor
|
|
18
|
+
except ImportError as e:
|
|
19
|
+
raise ImportError(f"vfb_connect is required but could not be imported: {e}")
|
|
20
|
+
|
|
13
21
|
# Connect to the VFB SOLR server
|
|
14
22
|
vfb_solr = pysolr.Solr('http://solr.virtualflybrain.org/solr/vfb_json/', always_commit=False, timeout=990)
|
|
15
23
|
|
|
@@ -525,13 +533,29 @@ def term_info_parse_object(results, short_form):
|
|
|
525
533
|
images = {}
|
|
526
534
|
image = vfbTerm.template_channel
|
|
527
535
|
record = {}
|
|
528
|
-
|
|
529
|
-
|
|
536
|
+
|
|
537
|
+
# Validate that the channel ID matches the template ID (numeric part should be the same)
|
|
538
|
+
template_id = vfbTerm.term.core.short_form
|
|
539
|
+
channel_id = vfbTerm.template_channel.channel.short_form
|
|
540
|
+
|
|
541
|
+
# Extract numeric parts for validation
|
|
542
|
+
if template_id and channel_id:
|
|
543
|
+
template_numeric = template_id.replace("VFB_", "") if template_id.startswith("VFB_") else ""
|
|
544
|
+
channel_numeric = channel_id.replace("VFBc_", "") if channel_id.startswith("VFBc_") else ""
|
|
545
|
+
|
|
546
|
+
if template_numeric != channel_numeric:
|
|
547
|
+
print(f"Warning: Template ID {template_id} does not match channel ID {channel_id}")
|
|
548
|
+
label = vfbTerm.template_channel.channel.label
|
|
549
|
+
record["id"] = channel_id
|
|
550
|
+
else:
|
|
551
|
+
label = vfbTerm.term.core.label
|
|
552
|
+
record["id"] = template_id
|
|
553
|
+
|
|
530
554
|
if vfbTerm.template_channel.channel.symbol != "" and len(vfbTerm.template_channel.channel.symbol) > 0:
|
|
531
555
|
label = vfbTerm.template_channel.channel.symbol
|
|
532
556
|
record["label"] = label
|
|
533
|
-
if not
|
|
534
|
-
images[
|
|
557
|
+
if not template_id in images.keys():
|
|
558
|
+
images[template_id]=[]
|
|
535
559
|
record["thumbnail"] = image.image_thumbnail.replace("http://","https://").replace("thumbnailT.png","thumbnail.png")
|
|
536
560
|
record["thumbnail_transparent"] = image.image_thumbnail.replace("http://","https://").replace("thumbnail.png","thumbnailT.png")
|
|
537
561
|
for key in vars(image).keys():
|
|
@@ -549,7 +573,7 @@ def term_info_parse_object(results, short_form):
|
|
|
549
573
|
record['voxel'] = image.get_voxel()
|
|
550
574
|
if 'orientation' in image_vars.keys():
|
|
551
575
|
record['orientation'] = image.orientation
|
|
552
|
-
images[
|
|
576
|
+
images[template_id].append(record)
|
|
553
577
|
|
|
554
578
|
# Add the thumbnails to the term info
|
|
555
579
|
termInfo["Images"] = images
|
|
@@ -822,7 +846,7 @@ def get_instances(short_form: str, return_dataframe=True, limit: int = -1):
|
|
|
822
846
|
RETURN COUNT(r) AS total_count
|
|
823
847
|
"""
|
|
824
848
|
count_results = vc.nc.commit_list([count_query])
|
|
825
|
-
count_df = pd.DataFrame.from_records(
|
|
849
|
+
count_df = pd.DataFrame.from_records(get_dict_cursor()(count_results))
|
|
826
850
|
total_count = count_df['total_count'][0] if not count_df.empty else 0
|
|
827
851
|
|
|
828
852
|
# Define the main Cypher query
|
|
@@ -852,7 +876,7 @@ def get_instances(short_form: str, return_dataframe=True, limit: int = -1):
|
|
|
852
876
|
results = vc.nc.commit_list([query])
|
|
853
877
|
|
|
854
878
|
# Convert the results to a DataFrame
|
|
855
|
-
df = pd.DataFrame.from_records(
|
|
879
|
+
df = pd.DataFrame.from_records(get_dict_cursor()(results))
|
|
856
880
|
|
|
857
881
|
columns_to_encode = ['label', 'parent', 'source', 'source_id', 'template', 'dataset', 'license', 'thumbnail']
|
|
858
882
|
df = encode_markdown_links(df, columns_to_encode)
|
|
@@ -910,7 +934,7 @@ def get_templates(limit: int = -1, return_dataframe: bool = False):
|
|
|
910
934
|
RETURN COUNT(DISTINCT t) AS total_count"""
|
|
911
935
|
|
|
912
936
|
count_results = vc.nc.commit_list([count_query])
|
|
913
|
-
count_df = pd.DataFrame.from_records(
|
|
937
|
+
count_df = pd.DataFrame.from_records(get_dict_cursor()(count_results))
|
|
914
938
|
total_count = count_df['total_count'][0] if not count_df.empty else 0
|
|
915
939
|
|
|
916
940
|
# Define the main Cypher query
|
|
@@ -935,7 +959,7 @@ def get_templates(limit: int = -1, return_dataframe: bool = False):
|
|
|
935
959
|
results = vc.nc.commit_list([query])
|
|
936
960
|
|
|
937
961
|
# Convert the results to a DataFrame
|
|
938
|
-
df = pd.DataFrame.from_records(
|
|
962
|
+
df = pd.DataFrame.from_records(get_dict_cursor()(results))
|
|
939
963
|
|
|
940
964
|
columns_to_encode = ['name', 'dataset', 'license', 'thumbnail']
|
|
941
965
|
df = encode_markdown_links(df, columns_to_encode)
|
|
@@ -1037,7 +1061,7 @@ def get_similar_neurons(neuron, similarity_score='NBLAST_score', return_datafram
|
|
|
1037
1061
|
RETURN COUNT(DISTINCT n2) AS total_count"""
|
|
1038
1062
|
|
|
1039
1063
|
count_results = vc.nc.commit_list([count_query])
|
|
1040
|
-
count_df = pd.DataFrame.from_records(
|
|
1064
|
+
count_df = pd.DataFrame.from_records(get_dict_cursor()(count_results))
|
|
1041
1065
|
total_count = count_df['total_count'][0] if not count_df.empty else 0
|
|
1042
1066
|
|
|
1043
1067
|
main_query = f"""MATCH (c1:Class)<-[:INSTANCEOF]-(n1)-[r:has_similar_morphology_to]-(n2)-[:INSTANCEOF]->(c2:Class)
|
|
@@ -1063,7 +1087,7 @@ def get_similar_neurons(neuron, similarity_score='NBLAST_score', return_datafram
|
|
|
1063
1087
|
results = vc.nc.commit_list([main_query])
|
|
1064
1088
|
|
|
1065
1089
|
# Convert the results to a DataFrame
|
|
1066
|
-
df = pd.DataFrame.from_records(
|
|
1090
|
+
df = pd.DataFrame.from_records(get_dict_cursor()(results))
|
|
1067
1091
|
|
|
1068
1092
|
columns_to_encode = ['name', 'source', 'source_id', 'thumbnail']
|
|
1069
1093
|
df = encode_markdown_links(df, columns_to_encode)
|
|
@@ -1127,7 +1151,7 @@ def get_individual_neuron_inputs(neuron_short_form: str, return_dataframe=True,
|
|
|
1127
1151
|
RETURN COUNT(DISTINCT c) AS total_count"""
|
|
1128
1152
|
|
|
1129
1153
|
count_results = vc.nc.commit_list([count_query])
|
|
1130
|
-
count_df = pd.DataFrame.from_records(
|
|
1154
|
+
count_df = pd.DataFrame.from_records(get_dict_cursor()(count_results))
|
|
1131
1155
|
total_count = count_df['total_count'][0] if not count_df.empty else 0
|
|
1132
1156
|
|
|
1133
1157
|
# Define the part of the query for normal mode
|
|
@@ -1166,7 +1190,7 @@ def get_individual_neuron_inputs(neuron_short_form: str, return_dataframe=True,
|
|
|
1166
1190
|
results = vc.nc.commit_list([query])
|
|
1167
1191
|
|
|
1168
1192
|
# Convert the results to a DataFrame
|
|
1169
|
-
df = pd.DataFrame.from_records(
|
|
1193
|
+
df = pd.DataFrame.from_records(get_dict_cursor()(results))
|
|
1170
1194
|
|
|
1171
1195
|
columns_to_encode = ['Neurotransmitter', 'Type', 'Name', 'Template_Space', 'Imaging_Technique', 'thumbnail']
|
|
1172
1196
|
df = encode_markdown_links(df, columns_to_encode)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: vfbquery
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
4
4
|
Summary: Wrapper for querying VirtualFlyBrain knowledge graph.
|
|
5
5
|
Home-page: https://github.com/VirtualFlyBrain/VFBquery
|
|
6
6
|
Author: VirtualFlyBrain
|
|
@@ -144,31 +144,8 @@ vfb.get_term_info('FBbt_00003748')
|
|
|
144
144
|
}
|
|
145
145
|
],
|
|
146
146
|
"IsIndividual": False,
|
|
147
|
-
"Images": {},
|
|
148
147
|
"IsClass": True,
|
|
149
148
|
"Examples": {
|
|
150
|
-
"VFB_00030786": [
|
|
151
|
-
{
|
|
152
|
-
"id": "VFB_00030810",
|
|
153
|
-
"label": "medulla on adult brain template Ito2014",
|
|
154
|
-
"thumbnail": "https://www.virtualflybrain.org/data/VFB/i/0003/0810/VFB_00030786/thumbnail.png",
|
|
155
|
-
"thumbnail_transparent": "https://www.virtualflybrain.org/data/VFB/i/0003/0810/VFB_00030786/thumbnailT.png",
|
|
156
|
-
"nrrd": "https://www.virtualflybrain.org/data/VFB/i/0003/0810/volume.nrrd",
|
|
157
|
-
"wlz": "https://www.virtualflybrain.org/data/VFB/i/0003/0810/volume.wlz",
|
|
158
|
-
"obj": "https://www.virtualflybrain.org/data/VFB/i/0003/0810/volume_man.obj"
|
|
159
|
-
}
|
|
160
|
-
],
|
|
161
|
-
"VFB_00101567": [
|
|
162
|
-
{
|
|
163
|
-
"id": "VFB_00102107",
|
|
164
|
-
"label": "ME on JRC2018Unisex adult brain",
|
|
165
|
-
"thumbnail": "https://www.virtualflybrain.org/data/VFB/i/0010/2107/VFB_00101567/thumbnail.png",
|
|
166
|
-
"thumbnail_transparent": "https://www.virtualflybrain.org/data/VFB/i/0010/2107/VFB_00101567/thumbnailT.png",
|
|
167
|
-
"nrrd": "https://www.virtualflybrain.org/data/VFB/i/0010/2107/VFB_00101567/volume.nrrd",
|
|
168
|
-
"wlz": "https://www.virtualflybrain.org/data/VFB/i/0010/2107/VFB_00101567/volume.wlz",
|
|
169
|
-
"obj": "https://www.virtualflybrain.org/data/VFB/i/0010/2107/VFB_00101567/volume_man.obj"
|
|
170
|
-
}
|
|
171
|
-
],
|
|
172
149
|
"VFB_00017894": [
|
|
173
150
|
{
|
|
174
151
|
"id": "VFB_00030624",
|
|
@@ -190,12 +167,31 @@ vfb.get_term_info('FBbt_00003748')
|
|
|
190
167
|
"wlz": "https://www.virtualflybrain.org/data/VFB/i/0010/1385/VFB_00101384/volume.wlz",
|
|
191
168
|
"obj": "https://www.virtualflybrain.org/data/VFB/i/0010/1385/VFB_00101384/volume_man.obj"
|
|
192
169
|
}
|
|
170
|
+
],
|
|
171
|
+
"VFB_00101567": [
|
|
172
|
+
{
|
|
173
|
+
"id": "VFB_00102107",
|
|
174
|
+
"label": "ME on JRC2018Unisex adult brain",
|
|
175
|
+
"thumbnail": "https://www.virtualflybrain.org/data/VFB/i/0010/2107/VFB_00101567/thumbnail.png",
|
|
176
|
+
"thumbnail_transparent": "https://www.virtualflybrain.org/data/VFB/i/0010/2107/VFB_00101567/thumbnailT.png",
|
|
177
|
+
"nrrd": "https://www.virtualflybrain.org/data/VFB/i/0010/2107/VFB_00101567/volume.nrrd",
|
|
178
|
+
"wlz": "https://www.virtualflybrain.org/data/VFB/i/0010/2107/VFB_00101567/volume.wlz",
|
|
179
|
+
"obj": "https://www.virtualflybrain.org/data/VFB/i/0010/2107/VFB_00101567/volume_man.obj"
|
|
180
|
+
}
|
|
181
|
+
],
|
|
182
|
+
"VFB_00030786": [
|
|
183
|
+
{
|
|
184
|
+
"id": "VFB_00030810",
|
|
185
|
+
"label": "medulla on adult brain template Ito2014",
|
|
186
|
+
"thumbnail": "https://www.virtualflybrain.org/data/VFB/i/0003/0810/VFB_00030786/thumbnail.png",
|
|
187
|
+
"thumbnail_transparent": "https://www.virtualflybrain.org/data/VFB/i/0003/0810/VFB_00030786/thumbnailT.png",
|
|
188
|
+
"nrrd": "https://www.virtualflybrain.org/data/VFB/i/0003/0810/VFB_00030786/volume.nrrd",
|
|
189
|
+
"wlz": "https://www.virtualflybrain.org/data/VFB/i/0003/0810/VFB_00030786/volume.wlz",
|
|
190
|
+
"obj": "https://www.virtualflybrain.org/data/VFB/i/0003/0810/VFB_00030786/volume_man.obj"
|
|
191
|
+
}
|
|
193
192
|
]
|
|
194
193
|
},
|
|
195
194
|
"IsTemplate": False,
|
|
196
|
-
"Domains": {},
|
|
197
|
-
"Licenses": {},
|
|
198
|
-
"Publications": [],
|
|
199
195
|
"Synonyms": [
|
|
200
196
|
{
|
|
201
197
|
"label": "ME",
|
|
@@ -203,12 +199,6 @@ vfb.get_term_info('FBbt_00003748')
|
|
|
203
199
|
"type": "",
|
|
204
200
|
"publication": "[Ito et al., 2014](FBrf0224194)"
|
|
205
201
|
},
|
|
206
|
-
{
|
|
207
|
-
"label": "m",
|
|
208
|
-
"scope": "has_related_synonym",
|
|
209
|
-
"type": "",
|
|
210
|
-
"publication": ""
|
|
211
|
-
},
|
|
212
202
|
{
|
|
213
203
|
"label": "Med",
|
|
214
204
|
"scope": "has_exact_synonym",
|
|
@@ -220,6 +210,12 @@ vfb.get_term_info('FBbt_00003748')
|
|
|
220
210
|
"scope": "has_exact_synonym",
|
|
221
211
|
"type": "",
|
|
222
212
|
"publication": "[Venkatesh and Shyamala, 2010](FBrf0212889)"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"label": "m",
|
|
216
|
+
"scope": "has_related_synonym",
|
|
217
|
+
"type": "",
|
|
218
|
+
"publication": ""
|
|
223
219
|
}
|
|
224
220
|
]
|
|
225
221
|
}
|
|
@@ -259,7 +255,8 @@ vfb.get_term_info('VFB_00000001')
|
|
|
259
255
|
"Tags": [
|
|
260
256
|
"Adult",
|
|
261
257
|
"Expression_pattern_fragment",
|
|
262
|
-
"Neuron"
|
|
258
|
+
"Neuron",
|
|
259
|
+
"lineage_CM3"
|
|
263
260
|
],
|
|
264
261
|
"Queries": [
|
|
265
262
|
{
|
|
@@ -325,74 +322,72 @@ vfb.get_term_info('VFB_00000001')
|
|
|
325
322
|
"id": "VFB_00000333",
|
|
326
323
|
"score": "0.61",
|
|
327
324
|
"name": "[fru-M-000204](VFB_00000333)",
|
|
328
|
-
"tags": "Expression_pattern_fragment|Neuron|Adult",
|
|
329
|
-
"thumbnail": "[](VFB_00101567,VFB_00000333)"
|
|
330
327
|
},
|
|
331
328
|
{
|
|
332
329
|
"id": "VFB_00000333",
|
|
333
330
|
"score": "0.61",
|
|
334
331
|
"name": "[fru-M-000204](VFB_00000333)",
|
|
335
|
-
"tags": "Expression_pattern_fragment|Neuron|Adult",
|
|
336
|
-
"thumbnail": "[](VFB_00017894,VFB_00000333)"
|
|
337
334
|
},
|
|
338
335
|
{
|
|
339
336
|
"id": "VFB_00002439",
|
|
340
337
|
"score": "0.6",
|
|
341
338
|
"name": "[fru-M-900020](VFB_00002439)",
|
|
342
|
-
"tags": "Expression_pattern_fragment|Neuron|Adult",
|
|
343
|
-
"thumbnail": "[](VFB_00101567,VFB_00002439)"
|
|
344
341
|
},
|
|
345
342
|
{
|
|
346
343
|
"id": "VFB_00002439",
|
|
347
344
|
"score": "0.6",
|
|
348
345
|
"name": "[fru-M-900020](VFB_00002439)",
|
|
349
|
-
"tags": "Expression_pattern_fragment|Neuron|Adult",
|
|
350
|
-
"thumbnail": "[](VFB_00017894,VFB_00002439)"
|
|
351
348
|
},
|
|
352
349
|
{
|
|
353
350
|
"id": "VFB_00001880",
|
|
354
351
|
"score": "0.59",
|
|
355
352
|
"name": "[fru-M-100041](VFB_00001880)",
|
|
356
|
-
"tags": "Expression_pattern_fragment|Neuron|Adult",
|
|
357
|
-
"thumbnail": "[](VFB_00101567,VFB_00001880)"
|
|
358
355
|
}
|
|
359
356
|
]
|
|
360
357
|
},
|
|
361
358
|
"output_format": "table",
|
|
362
|
-
"count":
|
|
359
|
+
"count": 44
|
|
363
360
|
}
|
|
364
361
|
],
|
|
365
362
|
"IsIndividual": True,
|
|
366
363
|
"Images": {
|
|
367
|
-
"
|
|
364
|
+
"VFB_00101567": [
|
|
368
365
|
{
|
|
369
366
|
"id": "VFB_00000001",
|
|
370
367
|
"label": "fru-M-200266",
|
|
371
|
-
"thumbnail": "https://virtualflybrain.org/
|
|
372
|
-
"thumbnail_transparent": "https://virtualflybrain.org/
|
|
373
|
-
"nrrd": "https://www.virtualflybrain.org/data/VFB/i/0000/0001/
|
|
374
|
-
"wlz": "https://virtualflybrain.org/
|
|
375
|
-
"obj": "https://virtualflybrain.org/
|
|
376
|
-
"swc": "https://www.virtualflybrain.org/data/VFB/i/0000/0001/
|
|
368
|
+
"thumbnail": "https://www.virtualflybrain.org/data/VFB/i/0000/0001/VFB_00101567/thumbnail.png",
|
|
369
|
+
"thumbnail_transparent": "https://www.virtualflybrain.org/data/VFB/i/0000/0001/VFB_00101567/thumbnailT.png",
|
|
370
|
+
"nrrd": "https://www.virtualflybrain.org/data/VFB/i/0000/0001/VFB_00101567/volume.nrrd",
|
|
371
|
+
"wlz": "https://www.virtualflybrain.org/data/VFB/i/0000/0001/VFB_00101567/volume.wlz",
|
|
372
|
+
"obj": "https://www.virtualflybrain.org/data/VFB/i/0000/0001/VFB_00101567/volume.obj",
|
|
373
|
+
"swc": "https://www.virtualflybrain.org/data/VFB/i/0000/0001/VFB_00101567/volume.swc"
|
|
377
374
|
}
|
|
378
375
|
],
|
|
379
|
-
"
|
|
376
|
+
"VFB_00017894": [
|
|
380
377
|
{
|
|
381
378
|
"id": "VFB_00000001",
|
|
382
379
|
"label": "fru-M-200266",
|
|
383
|
-
"thumbnail": "https://virtualflybrain.org/
|
|
384
|
-
"thumbnail_transparent": "https://virtualflybrain.org/
|
|
385
|
-
"nrrd": "https://www.virtualflybrain.org/data/VFB/i/0000/0001/
|
|
386
|
-
"wlz": "https://virtualflybrain.org/
|
|
387
|
-
"obj": "https://virtualflybrain.org/
|
|
388
|
-
"swc": "https://www.virtualflybrain.org/data/VFB/i/0000/0001/
|
|
380
|
+
"thumbnail": "https://www.virtualflybrain.org/data/VFB/i/0000/0001/VFB_00017894/thumbnail.png",
|
|
381
|
+
"thumbnail_transparent": "https://www.virtualflybrain.org/data/VFB/i/0000/0001/VFB_00017894/thumbnailT.png",
|
|
382
|
+
"nrrd": "https://www.virtualflybrain.org/data/VFB/i/0000/0001/VFB_00017894/volume.nrrd",
|
|
383
|
+
"wlz": "https://www.virtualflybrain.org/data/VFB/i/0000/0001/VFB_00017894/volume.wlz",
|
|
384
|
+
"obj": "https://www.virtualflybrain.org/data/VFB/i/0000/0001/VFB_00017894/volume.obj",
|
|
385
|
+
"swc": "https://www.virtualflybrain.org/data/VFB/i/0000/0001/VFB_00017894/volume.swc"
|
|
389
386
|
}
|
|
390
387
|
]
|
|
391
388
|
},
|
|
392
389
|
"IsClass": False,
|
|
393
|
-
"Examples": {},
|
|
394
390
|
"IsTemplate": False,
|
|
395
|
-
"Domains": {},
|
|
396
391
|
"Licenses": {
|
|
397
392
|
"0": {
|
|
398
393
|
"iri": "http://virtualflybrain.org/reports/VFBlicense_FlyCircuit_License",
|
|
@@ -402,9 +397,7 @@ vfb.get_term_info('VFB_00000001')
|
|
|
402
397
|
"source": "FlyCircuit 1.0 - single neurons (Chiang2010)",
|
|
403
398
|
"source_iri": "http://virtualflybrain.org/reports/Chiang2010"
|
|
404
399
|
}
|
|
405
|
-
}
|
|
406
|
-
"Publications": [],
|
|
407
|
-
"Synonyms": []
|
|
400
|
+
}
|
|
408
401
|
}
|
|
409
402
|
```
|
|
410
403
|
|
|
@@ -441,10 +434,10 @@ vfb.get_term_info('VFB_00101567')
|
|
|
441
434
|
"Queries": [],
|
|
442
435
|
"IsIndividual": True,
|
|
443
436
|
"Images": {
|
|
444
|
-
"
|
|
437
|
+
"VFB_00101567": [
|
|
445
438
|
{
|
|
446
|
-
"id": "
|
|
447
|
-
"label": "
|
|
439
|
+
"id": "VFB_00101567",
|
|
440
|
+
"label": "JRC2018Unisex",
|
|
448
441
|
"thumbnail": "https://www.virtualflybrain.org/data/VFB/i/0010/1567/VFB_00101567/thumbnail.png",
|
|
449
442
|
"thumbnail_transparent": "https://www.virtualflybrain.org/data/VFB/i/0010/1567/VFB_00101567/thumbnailT.png",
|
|
450
443
|
"nrrd": "https://www.virtualflybrain.org/data/VFB/i/0010/1567/VFB_00101567/volume.nrrd",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
test/readme_parser.py,sha256=puvcq4_oEltjx_faw1kQJ8mmIWiQU-40oLJjtJBQCsQ,4170
|
|
3
|
+
test/term_info_queries_test.py,sha256=9FxV3ZmRdi9TRjAS-1N0YRpCKAu4EthdQYOe_NluUuc,34527
|
|
4
|
+
test/test_examples_diff.py,sha256=ep_BzA-7az2OUPxUIsS3ReFV8LwuzGv8yIL0HirOGsc,15699
|
|
5
|
+
vfbquery/__init__.py,sha256=fvjBDvRlhtKkMa69WAVHY0bteLh4qlLH4FAhiZBOLRE,76
|
|
6
|
+
vfbquery/solr_fetcher.py,sha256=U8mHaBJrwjncl1eU_gnNj5CGhEb-s9dCpcUTXTifQOY,3984
|
|
7
|
+
vfbquery/term_info_queries.py,sha256=79Bm2RJzAZyVPQE5HWhsvybeBYrz2AbFgbM0ympIxao,41399
|
|
8
|
+
vfbquery/test_utils.py,sha256=HKFsQ2wqZYxR_wS9V6RIM3SguIi9kX5kyYDAXgpfp1A,1623
|
|
9
|
+
vfbquery/vfb_queries.py,sha256=04CulLonZ_O7vgoiMvN3zBP5y2Ww9AXRdmO-ljD_r6Y,63914
|
|
10
|
+
vfbquery-0.3.3.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
11
|
+
vfbquery-0.3.3.dist-info/METADATA,sha256=mmUICAjBFXeF8poNW_I3wkbyssbeNE5RzmXXRaKhk7Q,62999
|
|
12
|
+
vfbquery-0.3.3.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
13
|
+
vfbquery-0.3.3.dist-info/top_level.txt,sha256=UgaRTTOy4JBdKbkr_gkeknT4eaibm3ztF520G4NTQZs,14
|
|
14
|
+
vfbquery-0.3.3.dist-info/RECORD,,
|
vfbquery-0.3.2.dist-info/RECORD
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
test/readme_parser.py,sha256=puvcq4_oEltjx_faw1kQJ8mmIWiQU-40oLJjtJBQCsQ,4170
|
|
3
|
-
test/term_info_queries_test.py,sha256=Rd7KeS6dVLjIB74s3poj5jr7h5s_DIViVpuEWnhzBB4,33423
|
|
4
|
-
test/test_examples_diff.py,sha256=ep_BzA-7az2OUPxUIsS3ReFV8LwuzGv8yIL0HirOGsc,15699
|
|
5
|
-
vfbquery/__init__.py,sha256=KPkQWJsiUtew3IrygX17djJJfCxJtqw3cy3rB-e3cL4,28
|
|
6
|
-
vfbquery/solr_fetcher.py,sha256=_e0W87_tLwGeXSmok0FfBnpjIiM2lqTelKNkpdzxL1k,3529
|
|
7
|
-
vfbquery/term_info_queries.py,sha256=79Bm2RJzAZyVPQE5HWhsvybeBYrz2AbFgbM0ympIxao,41399
|
|
8
|
-
vfbquery/test_utils.py,sha256=HKFsQ2wqZYxR_wS9V6RIM3SguIi9kX5kyYDAXgpfp1A,1623
|
|
9
|
-
vfbquery/vfb_queries.py,sha256=VE5-RBzgVMdadcWTjSmF5oQxefQ3fEDNwaQevG69Img,62760
|
|
10
|
-
vfbquery-0.3.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
11
|
-
vfbquery-0.3.2.dist-info/METADATA,sha256=xllJx3ZOH91sagWa-_2O6_DI86wAjs0TQt8xsuEoUXA,62863
|
|
12
|
-
vfbquery-0.3.2.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
|
|
13
|
-
vfbquery-0.3.2.dist-info/top_level.txt,sha256=UgaRTTOy4JBdKbkr_gkeknT4eaibm3ztF520G4NTQZs,14
|
|
14
|
-
vfbquery-0.3.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|