Skip to content

Commit ecbdd5e

Browse files
committed
fixed dropped output from get_expressed_genes_by_cell_and_gene_type
1 parent 510adf7 commit ecbdd5e

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

src/vfb_connect/cross_server_tools.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ def get_transcriptomic_profile(self, cell_type, gene_type=False, no_subtypes=Fal
770770
else:
771771
return dc
772772

773-
def get_expressed_genes_by_cell_and_gene_type(self, cell_type, gene_type, no_subtypes=False, query_by_label=True, return_dataframe=True):
773+
def get_expressed_genes_by_cell_and_gene_type(self, cell_type, gene_type, no_subtypes=False, query_by_label=True, return_dataframe=True, verbose=False):
774774
"""Get expressed genes (as a list) for scRNAseq clusters of a given cell type.
775775
776776
Returns a DataFrame with one cluster per row, annotated as the specified cell type (or subtypes).
@@ -833,7 +833,16 @@ def get_expressed_genes_by_cell_and_gene_type(self, cell_type, gene_type, no_sub
833833
"ds.total_gene_count[0] AS dataset_total_gene_count, cluster_genes, "
834834
"apoc.coll.sort(apoc.coll.subtract(dataset_genes, cluster_genes)) AS genes_in_dataset_not_cluster"
835835
% (cell_type_short_form, gene_label, equal_condition, gene_label))
836-
print(query)
836+
if verbose:
837+
print(query)
838+
839+
r = self.nc.commit_list([query])
840+
dc = dict_cursor(r)
841+
if return_dataframe:
842+
return pd.DataFrame.from_records(dc)
843+
else:
844+
return dc
845+
837846
def get_cell_types_by_genes(self, genes=None, gene_type=False, cell_type=None, query_by_label=True,
838847
return_dataframe=True, verbose=False):
839848
"""Get cell types that express a given gene, list of genes and/or type of gene based on transcriptomics data.

0 commit comments

Comments
 (0)