cellink.DonorData#
- class cellink.DonorData(*, G, C, donor_id='donor_id', var_dims_to_sync=None, uns={})#
Store and manage donor-related data with single-cell readouts.
This class allows donor-level, especially genetic, analysis with single-cell datasets. It holds AnnData objects for donor-level/genetic (G) and single-cell (C) data
- G(AnnData)#
- Type:
Donor-level AnnData
- C(AnnData)#
- Type:
Cell-level AnnData
- donor_id(str)#
- Type:
Key for donor information in C.obs
- Returns:
DonorData object
Attributes table#
Methods table#
|
Aggregate single-cell data to donor-level. |
|
|
String representation of DonorData showing side-by-side dd.G and dd.C views. |
|
|
|
|
Write the DonorData object to the specified file paths for both gene expression data (G) and cell-type data (C). |
|
Write the DonorData object to the specified file path. |
|
Write the DonorData object to the specified file paths for both gene expression data (G) and cell-type data (C). |
Attributes#
- DonorData.C#
- DonorData.G#
- DonorData.shape#
Methods#
- DonorData.aggregate(*, key_added=None, layer=None, obs=None, obsm=None, filter_key=None, filter_value=None, add_to_obs=False, func='mean', sync_var=False, verbose=False)#
Aggregate single-cell data to donor-level.
- Return type:
If neither layer, obsm, or obs is provided, adata.X is aggregated. Args:
- key_added:
The key in gdata to store the aggregated data.
- layer:
The layer in adata to aggregate. Defaults to None.
- obs:
The key in adata.obs to aggregate. Defaults to None.
- obsm:
The key in adata.obsm to aggregate. Defaults to None.
- filter_key:
The key in adata.obs to filter by. Defaults to None.
- filter_value:
The value in adata.obs[filter_key] to filter by. Defaults to None.
- add_to_obs:
Whether to add the aggregated data to adata.obs. Defaults to False.
- func:
The aggregation function to use. Defaults to “mean”.
- sync_var:
Whether to set the variable dimensions of the aggregated data to sync with the variable dimensions of the single-cell data. Defaults to False.
- verbose:
Whether to print verbose output. Defaults to False.
- DonorData.prep_repr()#
String representation of DonorData showing side-by-side dd.G and dd.C views.
- Return type:
- DonorData.sel(*, G_obs=slice(None, None, None), G_var=slice(None, None, None), C_obs=slice(None, None, None), C_var=slice(None, None, None))#
- DonorData.write_dd(path, dd, fmt=None)#
Write the DonorData object to the specified file paths for both gene expression data (G) and cell-type data (C).
Example
write_dd(‘path/to/donor_data.dd.h5’)
- DonorData.write_h5_dd(path)#
Write the DonorData object to the specified file path.
Example
write_dd(‘path/to/donor_data.dd.h5’)