@@ -835,7 +835,7 @@ def get_expressed_genes_by_cell_and_gene_type(self, cell_type, gene_type, no_sub
835835 % (cell_type_short_form , gene_label , equal_condition , gene_label ))
836836 if verbose :
837837 print (query )
838-
838+
839839 r = self .nc .commit_list ([query ])
840840 dc = dict_cursor (r )
841841 if return_dataframe :
@@ -1460,11 +1460,14 @@ def get_nt_receptors_in_downstream_neurons(self, upstream_type, downstream_type=
14601460 :return: A DataFrame with neurotransmitter receptors in downstream neurons of the specified neuron type.
14611461 :rtype: pandas.DataFrame or list of dicts
14621462 """
1463- upstream_type = self .lookup_id (upstream_type )
1464- downstream_type = self .lookup_id (downstream_type )
1463+ upstream_type = self .lookup_id (upstream_type . replace ( 'FBbt:' , 'FBbt_' ) )
1464+ downstream_type = self .lookup_id (downstream_type . replace ( 'FBbt:' , 'FBbt_' ) )
14651465
14661466 # get all types of all connected neurons that are instances of downstream_type
1467- downstream = self .get_connected_neurons_by_type (upstream_type = upstream_type , downstream_type = downstream_type , weight = weight )
1467+ downstream = self .get_connected_neurons_by_type (upstream_type = upstream_type , downstream_type = downstream_type , weight = weight , group_by_class = False , verbose = verbose , exclude_dbs = [])
1468+ if downstream .empty :
1469+ print ("No connections found between %s and %s neurons." % (upstream_type , downstream_type ))
1470+ return pd .DataFrame () if return_dataframe else []
14681471 downstream ['downstream_class' ] = downstream ['downstream_class' ].apply (
14691472 lambda x : x .split ('|' ) if isinstance (x , str ) else x )
14701473 downstream_classes = downstream .explode ('downstream_class' )['downstream_class' ].drop_duplicates ().to_list ()
0 commit comments