I'm filing this as a draft because I have not yet really tested it, but I wanted to get something up while it was fresh in my mind.
The goal here is to improve the compatibility with scanpy as described in #773, so I have done 4 main things:
Use lower case for X_pca and X_umap to match scanpy.
Convert the PCA and UMAP matrices to numpy matrices.
add a highly_variable column to the var table
Add PCA metadata to uns
The last step involves exporting the variance explained data and then importing that separately, with the assumption that the PCA was centered and highly variable genes were used. I could (and probably should) make those assumptions into arguments for the script just to be safe and maybe a bit future-proof.
There are probably also a few places where I am making other assumptions that I should check more explicitly. As I said, a draft...
I also renamed the script to be a bit more generally named, but annoyingly there were apparently enough changes that GitHub is not displaying it as a rename but as a deletion and recreation. Probably because it was run through a code formatter automatically.
Closes #773
I'm filing this as a draft because I have not yet really tested it, but I wanted to get something up while it was fresh in my mind.
The goal here is to improve the compatibility with scanpy as described in #773, so I have done 4 main things:
X_pca
andX_umap
to match scanpy.highly_variable
column to thevar
tableuns
The last step involves exporting the variance explained data and then importing that separately, with the assumption that the PCA was centered and highly variable genes were used. I could (and probably should) make those assumptions into arguments for the script just to be safe and maybe a bit future-proof.
There are probably also a few places where I am making other assumptions that I should check more explicitly. As I said, a draft...
I also renamed the script to be a bit more generally named, but annoyingly there were apparently enough changes that GitHub is not displaying it as a rename but as a deletion and recreation. Probably because it was run through a code formatter automatically.