vfb_connect package¶
Subpackages¶
Submodules¶
vfb_connect.cross_server_tools module¶
-
class
vfb_connect.cross_server_tools.VfbConnect(neo_endpoint='http://pdb.virtualflybrain.org', neo_credentials=('neo4j', 'vfb'), owlery_endpoint='http://owl.virtualflybrain.org/kbs/vfb/', lookup_prefixes=('FBbt', 'VFBexp', 'VFBext'))¶ Bases:
objectAPI wrapper class. By default this wraps connections to the more basal API endpoints (OWL, Neo4j).
Top level methods combined semantic queries that range across VFB content with neo4j queries, returning detailed metadata about anatomical classes and individuals that fulfill these queries.
Methods allowing direct queries cypher queries of the production Neo4j are available under nc
Methods for querying Neo4j with arbitrary lists of identifiers to return rich metadata or mappings to external IDs are available under neo_query_wrapper.
Direct access OWL queries, returning identifiers only, are available via methods under oc
Example semantic queries (OWL class expressions). Note quoting scheme (outer “ + single quotes for entities).
“‘GABAergic neuron’” “‘GABAeric neuron’ that ‘overlaps’ some ‘antennal lobe’”
-
get_connected_neurons_by_type(upstream_type, downstream_type, weight, query_by_label=True, return_dataframe=True)¶ Get all synaptic connections between individual neurons of upstream_type and dowstream_type where each synapse count >= weight. Warning: Does not support Class Expressions.
-
get_images_by_type(class_expression, template, image_folder, image_type='swc', query_by_label=True, direct=False, stomp=False)¶ Retrieve images of instances of class_expression registered to template and save to disk, along with manifest and references, to image_folder. Default image type = swc. Also supported: obj, nrrd, rds, wlz. Returns manifest dataframe. If stomp is true, overwrites existing template_folder.
-
get_instances(class_expression, query_by_label=True, direct=False, summary=False)¶ Generate JSON report of all instances of class_expression. Instances are specific examples of a type/class of structure, e.g. a specific instance of the neuron DA1 adPN from the FAFB_catmaid
database. Instances are typically associated with registered 3D image data and may include connectomics data.
-
get_instances_by_dataset(dataset, summary=False)¶ Returns metadata for a dataset
-
get_neurons_downstream_of(neuron, weight, classification=None, query_by_label=True, return_dataframe=True)¶ Get all neurons downstream of individual neuron (short_form if query_by_label=False, otherwise label) with connection strength > threshold. Optionally restrict target neurons to those specified by `classification = ‘class expression’ e.g. “‘Kenyon cell’” or “‘neuron’ that overlaps ‘lateral horn’”.
-
get_neurons_upstream_of(neuron, weight, classification=None, query_by_label=True, return_dataframe=True)¶ Get all neurons downstream of individual neuron (short_form if query_by_label=False, otherwise label) with connection strength > threshold. Optionally restrict target neurons to those specified by `classification = ‘class expression’ e.g. “‘Kenyon cell’” or “‘neuron’ that overlaps ‘lateral horn’”.
-
get_similar_neurons(neuron, similarity_score='NBLAST_score', cutoff=None, source=None, return_dataframe=True)¶ Get all neurons
-
get_subclasses(class_expression, query_by_label=True, direct=False, summary=False)¶ Generate JSON report of all subclasses of class_expression.
-
get_superclasses(class_expression, query_by_label=True, direct=False, summary=False)¶ Generate JSON report of all superclasses of class_expression.
-
get_terms_by_region(region, cells_only=False, verbose=False, query_by_label=True, summary=True)¶ - Generate JSON reports for all terms relevant to
annotating some specific region,
optionally limited by to cells
-
get_vfb_link(short_forms: iter, template)¶ Takes a list of VFB IDs (short_forms) and the name (label) of a template. Returns a link to VFB loading all available images of neurons on that template.
-
lookup_id(key, return_short_form=True)¶
-
-
vfb_connect.cross_server_tools.dequote(string)¶
-
vfb_connect.cross_server_tools.gen_short_form(iri)¶ Generate short_form (string) from an iri string iri: An iri string