Define fail modes for `.T`/`.transpose()`
Transposing operations need to work or fail with a good message.
backed=Trueand.rawshould be supported by some view-like method- If the AnnData object has alternative
.modes (upcoming feature),.Tshould throw a warning or error that the modes are lost,.transposeshould gain alose_modes=Falseparameter that avoids the error by explicitly opting into losing the modes
@ivirshup mentioned that he doesn’t like transpose for those bugs: https://github.com/theislab/anndata/issues/237#issuecomment-551409000
Also: https://github.com/theislab/anndata/issues/225
- Raw is supposed to share obs with the parent object. Transpose with raw should probably fail if the raw
var_namesdoesn't match the parent. However, what's the point ofrawif it has to shares bothobs_namesandvar_names?
If the AnnData object has alternative .modes (upcoming feature), .T should throw a warning or error that the modes are lost
Are there fewer arrays in the output here? Which ones are removed, which are kept?
And a general question, is transpose a valuable operation to have for the entire object? What's the use case?
adata.raw is still useful if it has the same dimensions as adata.X as it is used for statistical testing by default. Therefore you can use it to start log-normalized data, when adata.X has (e.g., batch-) corrected and maybe scaled data. I guess with sc.pp.highly_variable now annotating genes rather than filtering them adata.raw is often the same dimensions as adata.X now. I reckon it could therefore be slowly deprecated...