dandelion.tools.vj_usage_pca
- dandelion.tools.vj_usage_pca(adata, groupby, min_size=20, mode='abT', transfer_mapping=None, n_comps=30, groups=None, allowed_chain_status=['Single pair', 'Extra pair', 'Extra pair-exception', 'Orphan VDJ-exception'], verbose=False, **kwargs)[source]
Extract productive V/J gene usage from single cell data and compute PCA.
- Parameters:
adata (AnnData) – AnnData object holding the cell level metadata with Dandelion VDJ info transferred.
groupby (str) – Column name in adata.obs to groupby as observations for PCA.
min_size (int, optional) – Minimum cell size numbers to keep for computing the final matrix. Defaults to 20.
mode (Literal[“B”, “abT”, “gdT”], optional) – Mode for extract the V/J genes.
transfer_mapping (None, optional) – If provided, the columns will be mapped to the output AnnData from the original AnnData.
n_comps (int, optional) – Number of principal components to compute. Defaults to 30.
groups (list[str] | None, optional) – If provided, only the following groups/categories will be used for computing the PCA.
allowed_chain_status (list[str] | None, optional) – If provided, only the ones in this list are kept from the chain_status column. Defaults to [“Single pair”, “Extra pair”, “Extra pair-exception”, “Orphan VDJ-exception”].
verbose (bool, optional) – Whether to display progress
**kwargs – Additional keyword arguments passed to scanpy.pp.pca.
- Returns:
AnnData object with obs as groups and V/J genes as features.
- Return type:
AnnData