You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I had some trouble using scanpy.tl.ingest to map some observations from reference data to query data. The PCA of the reference data was computed using rsc.pp.pca (rapids_singlecell instead of scanpy). It seems that the problem was the absence of the "params" entry in adata.uns['pca'] which gets normally created by scanpy when running scanpy.pp.pca()
Steps/Code to reproduce bug
import scanpy as sc
import rapids_singlecell as rsc
# Load example dataset
adata = sc.datasets.pbmc68k_reduced()
# Perform PCA with scanpy
sc.pp.pca(
adata,
n_comps = 30,
zero_center = True,
use_highly_variable = False
)
# Save scanpy entries
scanpy_keys = adata.uns['pca'].keys()
# Perform PCA with rapids_singlecell
rsc.utils.anndata_to_GPU(adata)
rsc.pp.pca(
adata,
n_comps = 30,
zero_center = True,
use_highly_variable = False
)
# Save rapids_singlecell entries
rapids_keys = adata.uns['pca'].keys()
print(f"scanpy: {scanpy_keys}")
print(f"rapids: {rapids_keys}")
Expected behavior
Entries should be the same after running sc.pp.pca and rsc.pp.pca
Environment details (please complete the following information):
I am unable to provide hardware information about the machine I run the code on at the moment.
Describe the bug
I had some trouble using
scanpy.tl.ingest
to map some observations from reference data to query data. The PCA of the reference data was computed usingrsc.pp.pca
(rapids_singlecell instead of scanpy). It seems that the problem was the absence of the "params" entry inadata.uns['pca']
which gets normally created by scanpy when runningscanpy.pp.pca()
Steps/Code to reproduce bug
Expected behavior
Entries should be the same after running
sc.pp.pca
andrsc.pp.pca
Environment details (please complete the following information):
I am unable to provide hardware information about the machine I run the code on at the moment.
pip list
:Additional context
I believe this could be solved by changing lines 136-139 in _pca.py from
to something like:
The text was updated successfully, but these errors were encountered: