### drug2cell.util.prepare_plot_args, drug2cell.util.plot_gsea Source: https://drug2cell.readthedocs.io/en/latest/_sources/index.rst.txt Utility functions for preparing plotting arguments and generating plots for GSEA results. ```APIDOC ## Module: drug2cell.util.prepare_plot_args, drug2cell.util.plot_gsea ### Description Utility functions for plotting, including preparing arguments and plotting GSEA results. ### Members - prepare_plot_args - plot_gsea ``` -------------------------------- ### drug2cell.util.prepare_plot_args() Source: https://drug2cell.readthedocs.io/en/latest Prepares arguments for scanpy plotting functions to visualize scored gene groups. It returns a dictionary suitable for use with scanpy's plotting functions. ```APIDOC ## drug2cell.util.prepare_plot_args(_adata_, _targets =None_, _categories =None_) ### Description Prepare the `var_names`, `var_group_positions` and `var_group_labels` arguments for scanpy plotting functions to display scored gene groups and group them nicely. Returns `plot_args`, a dictionary of the values that can be used with scanpy plotting as `**plot_args`. ### Parameters #### Input: - **adata** (AnnData) - Point the function to the `.uns['drug2cell']` slot computed by the `score()` function earlier. It’s required to remove gene groups that were not represented in the data. - **targets** (dict of lists of str, optional, default: None) - The gene groups to evaluate. Can be targets of known drugs, GO terms, pathway memberships, anything you can assign genes to. If `None`, will load the ChEMBL-derived drug target sets distributed with the package. Must be the `nested=True` version of the input as described in the score function. - **categories** (str or list of str, optional, default: None) - If `targets=None` or `nested=True`, this argument can be used to subset the gene groups to one or more categories (keys of the original dictionary). In case of the ChEMBL drug targets, these are ATC level 1/level 2 category codes. ``` -------------------------------- ### drug2cell.util.plot_gsea() Source: https://drug2cell.readthedocs.io/en/latest Displays the output of d2c.gsea() using blitzgsea's top_table() plot. It visualizes enrichment results, targets, and scores. ```APIDOC ## drug2cell.util.plot_gsea(_enrichment_, _targets_, _scores_, _n =10_, _interactive_plot =True_, _**kwargs_) ### Description Display the output of `d2c.gsea()` with blitzgsea’s `top_table()` plot. The first `d2c.gsea()` output variable is `enrichment`, and passing the second `d2c.gsea()` output variable with a `**` in front of it provides `targets` and `scores`. ### Parameters #### Input - **enrichment** (dict of pd.DataFrame) - Cluster names as keys, blitzgsea’s `gsea()` output as values - **targets** (dict of list of str) - The gene group memberships that were used to compute GSEA - **scores** (dict of pd.DataFrame) - Cluster names as keys, the input to blitzgsea - **n** (int, optional, default: 10) - How many top scores to show for each group - **interactive_plot** (bool, optional, default: True) - If `True`, will display the plots within a Jupyter Notebook. If `False`, will collect the figures into a list and return it at the end. - **kwargs** - Any additional arguments to pass to `blitzgsea.plot.top_table()`. ``` -------------------------------- ### drug2cell.data.chembl, drug2cell.data.consensuspathdb Source: https://drug2cell.readthedocs.io/en/latest/_sources/index.rst.txt These modules are responsible for loading gene group data from various sources, including ChEMBL and ConsensusPathDB. ```APIDOC ## Module: drug2cell.data.chembl, drug2cell.data.consensuspathdb ### Description Loads gene group data from ChEMBL and ConsensusPathDB. ### Members - chembl - consensuspathdb ``` -------------------------------- ### drug2cell.data.chembl() Source: https://drug2cell.readthedocs.io/en/latest Loads the default ChEMBL drug target dictionary. This dictionary maps ATC categories to corresponding drugs. ```APIDOC ## drug2cell.data.chembl() ### Description Loads the default ChEMBL drug target dictionary distributed with the package. ### Returns A dictionary with ATC categories as keys, and each category containing a dictionary of corresponding drugs as values. ``` -------------------------------- ### drug2cell.data.consensuspathdb() Source: https://drug2cell.readthedocs.io/en/latest Loads the ConsensusPathDB pathway gene memberships. This function returns a dictionary mapping pathway names to their gene memberships. ```APIDOC ## drug2cell.data.consensuspathdb() ### Description Loads the ConsensusPathDB pathway gene memberships distributed with the package. ### Returns A dictionary with pathway names as keys and their gene memberships as values. ``` -------------------------------- ### drug2cell.gsea, drug2cell.hypergeometric, drug2cell.score Source: https://drug2cell.readthedocs.io/en/latest/_sources/index.rst.txt These modules provide functionalities related to Gene Set Enrichment Analysis (GSEA), hypergeometric distribution calculations, and scoring mechanisms within the Drug2cell library. ```APIDOC ## Module: drug2cell.gsea, drug2cell.hypergeometric, drug2cell.score ### Description Provides functionalities for GSEA, hypergeometric calculations, and scoring. ### Members - gsea - hypergeometric - score ``` -------------------------------- ### Perform Gene Set Enrichment Analysis (GSEA) Source: https://drug2cell.readthedocs.io/en/latest Use this function to perform GSEA on marker gene scores. It returns a dictionary of test results and optionally plotting arguments. Ensure your AnnData object has marker genes computed. ```python drug2cell.gsea(_adata_ , _targets =None_, _nested =False_, _categories =None_, _absolute =False_, _plot_args =True_, _sep =','_, _** kwargs_) ``` -------------------------------- ### drug2cell.gsea() Source: https://drug2cell.readthedocs.io/en/latest Performs gene set enrichment analysis on marker gene scores. It utilizes the blitzgsea library and can return results along with plotting arguments for visualization. ```APIDOC ## drug2cell.gsea() ### Description Performs gene set enrichment analysis on the marker gene scores computed for the original object. Uses blitzgsea. ### Method `gsea(_adata_ , _targets =None_, _nested =False_, _categories =None_, _absolute =False_, _plot_args =True_, _sep =','_, _** kwargs_) ### Parameters #### Path Parameters * **adata** (AnnData) - Required - With marker genes computed via `sc.tl.rank_genes_groups()` in the original expression space. * **targets** (dict of lists of str, optional) - The gene groups to evaluate. Can be targets of known drugs, GO terms, pathway memberships, anything you can assign genes to. If `None`, will use `d2c.score()` output if present, and if not present load the ChEMBL-derived drug target sets distributed with the package. Accepts two forms: A dictionary with the names of the groups as keys, and the entries being the corresponding gene lists. A dictionary of dictionaries defined like above, with names of gene group categories as keys. If passing one of those, please specify `nested=True`. * **nested** (bool, optional) - Whether `targets` is a dictionary of dictionaries with group categories as keys. * **categories** (str or list of str, optional) - If `targets=None` or `nested=True`, this argument can be used to subset the gene groups to one or more categories (keys of the original dictionary). In case of the ChEMBL drug targets, these are ATC level 1/level 2 category codes. * **absolute** (bool, optional) - If `True`, pass the absolute values of scores to GSEA. Improves statistical power. * **plot_args** (bool, optional) - Whether to return the second piece of output that holds pre-compiled information for `d2c.plot_gsea()`. * **sep** (str, optional) - The delimiter that was used with `d2c.score()` for gene group storage. * **kwargs** - Any additional arguments to pass to `blitzgsea.gsea()`. ### Response * a dictionary with clusters for which the original object markers were computed as the keys, and data frames of test results sorted on q-value as the items * a helper variable with plotting arguments for `d2c.plot_gsea()`, if `plot_args=True`. `['scores']` has the GSEA input, and `['targets']` is the gene group dictionary that was used. ``` -------------------------------- ### drug2cell.chembl.filter_activities Source: https://drug2cell.readthedocs.io/en/latest/_sources/index.rst.txt Filters activities from the ChEMBL database. ```APIDOC ## Module: drug2cell.chembl.filter_activities ### Description Filters activities from the ChEMBL database. ### Members - filter_activities ``` -------------------------------- ### drug2cell.hypergeometric() Source: https://drug2cell.readthedocs.io/en/latest Performs a hypergeometric test to assess the overrepresentation of gene group members among marker genes. Returns test results sorted by q-value. ```APIDOC ## drug2cell.hypergeometric() ### Description Perform a hypergeometric test to assess the overrepresentation of gene group members among marker genes computed for the original object. ### Method `hypergeometric(_adata_ , _targets =None_, _nested =False_, _categories =None_, _pvals_adj_thresh =0.05_, _direction ='both'_, _corr_method ='benjamini-hochberg'_, _sep =','_) ### Parameters #### Path Parameters * **adata** (AnnData) - Required - With marker genes computed via `sc.tl.rank_genes_groups()` in the original expression space. * **targets** (dict of lists of str, optional) - The gene groups to evaluate. Can be targets of known drugs, GO terms, pathway memberships, anything you can assign genes to. If `None`, will use `d2c.score()` output if present, and if not present load the ChEMBL-derived drug target sets distributed with the package. Accepts two forms: A dictionary with the names of the groups as keys, and the entries being the corresponding gene lists. A dictionary of dictionaries defined like above, with names of gene group categories as keys. If passing one of those, please specify `nested=True`. * **nested** (bool, optional) - Whether `targets` is a dictionary of dictionaries with group categories as keys. * **categories** (str or list of str, optional) - If `targets=None` or `nested=True`, this argument can be used to subset the gene groups to one or more categories (keys of the original dictionary). In case of the ChEMBL drug targets, these are ATC level 1/level 2 category codes. * **pvals_adj_thresh** (float, optional) - Threshold for adjusted p-values. * **direction** (str, optional) - Direction of the test ('both', 'over', 'under'). * **corr_method** (str, optional) - Method for correcting p-values (e.g., 'benjamini-hochberg'). * **sep** (str, optional) - The delimiter that was used with `d2c.score()` for gene group storage. ### Response A dictionary with clusters for which the original object markers were computed as the keys, and data frames of test results sorted on q-value as the items. ``` -------------------------------- ### Perform Hypergeometric Test Source: https://drug2cell.readthedocs.io/en/latest This function assesses the overrepresentation of gene group members among marker genes using a hypergeometric test. It returns a dictionary of test results sorted by q-value. The test is performed on marker genes computed for the original object. ```python drug2cell.hypergeometric(_adata_ , _targets =None_, _nested =False_, _categories =None_, _pvals_adj_thresh =0.05_, _direction ='both'_, _corr_method ='benjamini-hochberg'_, _sep =','_) ``` -------------------------------- ### drug2cell.score (for marker genes) Source: https://drug2cell.readthedocs.io/en/latest Obtain per-cell scoring of gene groups of interest using pre-computed marker genes. This function is specifically designed to work with AnnData objects that have marker genes identified via `sc.tl.rank_genes_groups()`. ```APIDOC ## drug2cell.score (for marker genes) ### Description Obtain per-cell scoring of gene groups of interest using pre-computed marker genes. This function is specifically designed to work with AnnData objects that have marker genes identified via `sc.tl.rank_genes_groups()`. ### Parameters #### Path Parameters None #### Query Parameters - **adata** (AnnData) - Required - AnnData object with marker genes computed via `sc.tl.rank_genes_groups()` in the original expression space. - **targets** (dict of lists of str, optional) - The gene groups to evaluate. Can be targets of known drugs, GO terms, pathway memberships, anything you can assign genes to. If `None`, will use `d2c.score()` output if present, and if not present load the ChEMBL-derived drug target sets distributed with the package. Accepts two forms: A dictionary with the names of the groups as keys, and the entries being the corresponding gene lists. A dictionary of dictionaries defined like above, with names of gene group categories as keys. If passing one of those, please specify `nested=True`. - **nested** (bool, optional) - Whether `targets` is a dictionary of dictionaries with group categories as keys. - **categories** (str or list of str, optional) - If `targets=None` or `nested=True`, this argument can be used to subset the gene groups to one or more categories (keys of the original dictionary). In case of the ChEMBL drug targets, these are ATC level 1/level 2 category codes. - **pvals_adj_thresh** (float, optional) - The `pvals_adj` cutoff to use on the `sc.tl.rank_genes_groups()` output to identify markers. - **direction** (str, optional) - Whether to seek out up/down-regulated genes for the groups, based on the values from `scores`. Can be `"up"`, `"down"`, or `"both"` (for no selection). - **corr_method** (str, optional) - Which FDR correction to apply to the p-values of the hypergeometric test. Can be `"benjamini-hochberg"` or `"bonferroni"`. - **sep** (str, optional) - The delimiter that was used with `d2c.score()` for gene group storage. ### Request Example None ### Response #### Success Response (200) Adds `.uns['drug2cell']` to the input AnnData, a new AnnData object with the same observation space but with the scored gene groups as the features. The gene group members used to compute the scores will be listed in `.var['genes']` of the new object. #### Response Example None ``` -------------------------------- ### drug2cell.score Source: https://drug2cell.readthedocs.io/en/latest Obtain per-cell scoring of gene groups of interest. This function can utilize provided target gene sets or load built-in ChEMBL drug targets. It adds a new AnnData object to `.uns['drug2cell']` containing the scored gene groups. ```APIDOC ## drug2cell.score ### Description Obtain per-cell scoring of gene groups of interest. Distributed with a set of ChEMBL drug targets that can be used immediately. Please ensure that the gene nomenclature in your target sets is compatible with your `.var_names` (or `.raw.var_names`). The ChEMBL drug targets use HGNC (human gene names in line with standard cell ranger mapping output). Adds `.uns['drug2cell']` to the input AnnData, a new AnnData object with the same observation space but with the scored gene groups as the features. The gene group members used to compute the scores will be listed in `.var['genes']` of the new object. ### Parameters #### Path Parameters None #### Query Parameters - **adata** (AnnData) - Required - AnnData object with marker genes computed via `sc.tl.rank_genes_groups()` in the original expression space. - **targets** (dict of lists of str, optional) - The gene groups to evaluate. Can be targets of known drugs, GO terms, pathway memberships, anything you can assign genes to. If `None`, will use `d2c.score()` output if present, and if not present load the ChEMBL-derived drug target sets distributed with the package. Accepts two forms: A dictionary with the names of the groups as keys, and the entries being the corresponding gene lists. A dictionary of dictionaries defined like above, with names of gene group categories as keys. If passing one of those, please specify `nested=True`. - **nested** (bool, optional) - Whether `targets` is a dictionary of dictionaries with group categories as keys. - **categories** (str or list of str, optional) - If `targets=None` or `nested=True`, this argument can be used to subset the gene groups to one or more categories (keys of the original dictionary). In case of the ChEMBL drug targets, these are ATC level 1/level 2 category codes. - **method** (str, optional) - The method to use to score the gene groups. The default is `"mean"`, which computes the mean over all the genes. The other option is `"seurat"`, which generates an appropriate background profile for each target set and subtracts it from the mean. This is inspired by `sc.tl.rank_genes()` logic, which in turn was inspired by Seurat’s gene group scoring algorithm. - **layer** (str, optional) - Which `.layers` of the input AnnData to use for the expression values. If `None`, will default to `.X`. - **use_raw** (bool, optional) - Whether to use `.raw.X` for the expression values. - **n_bins** (int, optional) - Only used with `method="seurat"`. The number of expression bins to partition the feature space into. - **ctrl_size** (int, optional) - Only used with `method="seurat"`. The number of genes to randomly sample from each expression bin. - **sep** (str, optional) - What delimiter to use when storing the corresponding gene groups for each feature in `.uns['drug2cell'].var['genes']` ### Request Example None ### Response #### Success Response (200) Adds `.uns['drug2cell']` to the input AnnData, a new AnnData object with the same observation space but with the scored gene groups as the features. The gene group members used to compute the scores will be listed in `.var['genes']` of the new object. #### Response Example None ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.