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

Error using sparse matrix #50

Open
mumichae opened this issue Nov 8, 2022 · 1 comment
Open

Error using sparse matrix #50

mumichae opened this issue Nov 8, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@mumichae
Copy link
Collaborator

mumichae commented Nov 8, 2022

Now I notice I am getting this error:

Traceback (most recent call last):
  File "scripts/metrics/metrics.py", line 263, in <module>
    trajectory_=trajectory_
  File "/home/cruiz2/miniconda3/envs/scib-pipeline-R4.0/lib/python3.7/site-packages/scib/metrics/metrics.py", line 362, in metrics
    organism=organism,
  File "/home/cruiz2/miniconda3/envs/scib-pipeline-R4.0/lib/python3.7/site-packages/scib/metrics/cell_cycle.py", line 83, in cell_cycle
    verbose=verbose,
  File "/home/cruiz2/miniconda3/envs/scib-pipeline-R4.0/lib/python3.7/site-packages/scib/metrics/cell_cycle.py", line 175, in get_pcr_before_after
    raw_sub.X, covariate, pca_var=None, n_comps=n_comps, verbose=verbose
  File "/home/cruiz2/miniconda3/envs/scib-pipeline-R4.0/lib/python3.7/site-packages/scib/metrics/pcr.py", line 167, in pc_regression
    copy=True,
  File "/home/cruiz2/miniconda3/envs/scib-pipeline-R4.0/lib/python3.7/site-packages/scanpy/preprocessing/_pca.py", line 196, in pca
    'svd_solver: {svd_solver} can not be used with sparse input.\n'
ValueError: svd_solver: {svd_solver} can not be used with sparse input.
Use "arpack" (the default) or "lobpcg" instead.

ERROR conda.cli.main_run:execute(49): `conda run python scripts/metrics/metrics.py -u data/gbmap_subset.h5ad -i /gpfs/work2/0/einf2548/cruiz/gbm/scib-pipeline/data/gb_test/integration/scaled/hvg/combat.h5ad -o /gpfs/work2/0/einf2548/cruiz/gbm/scib-pipeline/data/gb_test/metrics/scaled/hvg/combat_full.csv -m combat -b batch -l celltype --type full --hvgs 2000 --organism human --assay expression -v` failed. (See above for error)
[Tue Nov  8 15:09:00 2022]
Error in rule metrics_single:
    jobid: 72
    output: /gpfs/work2/0/einf2548/cruiz/gbm/scib-pipeline/data/gb_test/metrics/scaled/hvg/combat_full.csv
    shell:

        conda run -n scib-pipeline-R4.0 python scripts/metrics/metrics.py -u data/gbmap_subset.h5ad -i /gpfs/work2/0/einf2548/cruiz/gbm/scib-pipeline/data/gb_test/integration/scaled/hvg/combat.h5ad          -o /gpfs/work2/0/einf2548/cruiz/gbm/scib-pipeline/data/gb_test/metrics/scaled/hvg/combat_full.csv -m combat          -b batch -l celltype --type full          --hvgs 2000 --organism human --assay expression -v

        (one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)

I noticed the test file contains an array in adata.X instead of a spare matrix. I guess I need also to store my matrix as array to avoid this error? (adata.X = adata.X.toarray())

Originally posted by @ccruizm in #49 (comment)

@mumichae
Copy link
Collaborator Author

mumichae commented Nov 8, 2022

Yes, it seems some of the metrics were only developed on dense matrices. I'd need to update that in scib

@mumichae mumichae added the bug Something isn't working label Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant