create_pseudobulk
hnoca.stats.pseudobulk.create_pseudobulk(adata, sample_key='batch', group_key=None, layer=None, mode='sum', min_cells=10, min_counts=1000, **kwargs)
Create pseudobulk data from anndata object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
adata |
AnnData
|
AnnData object |
required |
sample_key |
str
|
Column name in adata.obs that contains the sample ID |
'batch'
|
group_key |
Optional[str]
|
Column name in adata.obs that contains the group ID |
None
|
layer |
Optional[str]
|
Layer to use for pseudobulk data. If None, use |
None
|
mode |
str
|
Method to aggregate data. Default is 'sum'. |
'sum'
|
min_cells |
int
|
Filter to remove samples by a minimum number of cells in a sample-group pair. |
10
|
min_counts |
int
|
Filter to remove samples by a minimum number of summed counts in a sample-group pair. |
1000
|
**kwargs |
Additional arguments to pass to |
{}
|
Returns:
Type | Description |
---|---|
AnnData
|
AnnData object with pseudobulk data |