Base
Includes foundational methods for the base pAnnData object.
BaseMixin
Core base methods for pAnnData.
This mixin provides essential utility and management functions for cloning,
checking, and managing core attributes of a pAnnData object. These methods
serve as foundational building blocks for other mixins and functions.
Features:
- Checks presence of data (.prot or .pep)
- Safe object copying with state preservation
- Internal metadata management (stats, history, summary)
Methods:
| Name | Description |
|---|---|
_has_data |
Check whether .prot and/or .pep data are present |
copy |
Return a new |
Source code in src/scpviz/pAnnData/base.py
compare_current_to_raw
Compare current pdata object to original raw data, showing how many samples and features were dropped. Compares current obs/var names to the original raw data (stored in .uns).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
on |
str
|
Dataset to compare ('protein' or 'peptide'). |
'protein'
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
Dictionary summarizing dropped samples and features. |
Source code in src/scpviz/pAnnData/base.py
copy
Return a new pAnnData object with the current state of all components.
This method performs a shallow copy of core data (.prot, .pep) and a deep copy of internal attributes (e.g., RS matrix, summary, stats, and cached maps). It avoids full deepcopy for efficiency and retains the current filtered or processed state of the object.
Returns:
| Name | Type | Description |
|---|---|---|
pAnnData |
A new object containing copies of the current data and metadata. |