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 |
show_layer_provenance |
Print preprocessing provenance for one or all layers |
Source code in src/scpviz/pAnnData/base.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | |
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. |
Source code in src/scpviz/pAnnData/base.py
show_layer_provenance
Pretty-print the provenance chain for one or all layers.
Uses adata.uns['current_X_layer'] (maintained by set_X()) to highlight
the active .X matrix when printing the full registry. Chains walk through
input_layer pointers and show non-registry roots (e.g. X_raw) as
(raw input).
Source code in src/scpviz/pAnnData/base.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | |