Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix rapids_scanpy_funcs.highly_variable_genes #111

Open
hw-ju opened this issue Feb 11, 2023 · 0 comments
Open

fix rapids_scanpy_funcs.highly_variable_genes #111

hw-ju opened this issue Feb 11, 2023 · 0 comments

Comments

@hw-ju
Copy link

hw-ju commented Feb 11, 2023

In /notebooks/hlca_lung_gpu_analysis.ipynb, when run cell 19

%%time
hvg = rapids_scanpy_funcs.highly_variable_genes(sparse_gpu_array, genes, n_top_genes=5000)

it raises error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<timed exec> in <module>

/workspace/notebooks/rapids_scanpy_funcs.py in highly_variable_genes(sparse_gpu_array, genes, n_top_genes)
    801     mean = sparse_gpu_array.sum(axis=0).flatten() / n_cells
    802     mean_sq = sparse_gpu_array.multiply(sparse_gpu_array).sum(axis=0).flatten() / n_cells
--> 803     variable_genes = _cellranger_hvg(mean, mean_sq, genes, n_cells, n_top_genes)
    804 
    805     return variable_genes

/workspace/notebooks/rapids_scanpy_funcs.py in _cellranger_hvg(mean, mean_sq, genes, n_cells, n_top_genes)
    750     df = pd.DataFrame()
    751     # Note - can be replaced with cudf once 'cut' is added in 21.08
--> 752     df['genes'] = genes.to_numpy()
    753     df['means'] = mean.tolist()
    754     df['dispersions'] = dispersion.tolist()

AttributeError: 'Series' object has no attribute 'to_numpy'

Could you fix the rapids_scanpy_funcs.highly_variable_genes?

@hw-ju hw-ju changed the title fix rapids fix rapids_scanpy_funcs.highly_variable_genes Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant