API
Core functions
- class convexgating.tools.CONVEX_GATING(adata, cluster_numbers, cluster_string, save_path='/home/docs/checkouts/readthedocs.org/user_builds/convexgating/checkouts/latest/docs', add_noise=True, update_anndata=True, focus='f1')[source]
Derives gating strategies for selected clusters.
- Parameters:
adata (object) – AnnData object, with label information in adata.obs.
cluster_numbers (list) – List containing the cluster numbers or names to derive gating strategies for.
cluster_string (str) – Column name in adata.obs with label or cluster information corresponding to cluster_numbers.
save_path (str, optional) – Path to folder where gating output will be saved. Creates folder if it doesn’t exist. Default is the current working directory.
add_noise (bool, optional) – Indicates whether a small amount of random noise is added for internal stability. Default is True.
update_anndata (bool, optional) – Indicates whether gating output is saved in adata.uns in addition to the output folder. Default is True.
focus (str, optional) – Specifies whether CG focuses on high “f1” (default) or “recall”.
- Returns:
adata – AnnData object containing gating information if update_anndata is True.
- Return type:
object
Notes
Gating output is saved in the location specified by the save_path parameter.
- class convexgating.tools.gating_strategy(adata, cluster_numbers, cluster_string, save_path='/home/docs/checkouts/readthedocs.org/user_builds/convexgating/checkouts/latest/docs', add_noise=True, focus='f1')[source]
Learning gating strategy for specific cell clusters.
- Parameters:
adata (AnnData object) – complete input Data for gating.
cluster_numbers (list of strings or ints or doubles) –
- list of cluster numbers/identifieres in adata.obs[cluster_string] to find gating strategy for
-> e.g [‘4’,’5’] to find gating strategies for cell population ‘4’ and ‘5’
cluster_string (string) – column name in adata.obs where cluster labels are found, e.g ‘louvain’
add_noise (True or False) – if True add small amount of nice to count data for more stable internal procedures
focus ("f1" or "recall") – default focus “f1”, optional “recall”