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

Can't read in protein antibody capture data #940

Open
flying-sheep opened this issue Jan 23, 2025 · 2 comments · May be fixed by #944
Open

Can't read in protein antibody capture data #940

flying-sheep opened this issue Jan 23, 2025 · 2 comments · May be fixed by #944
Labels
bug 🐛 Something isn't working I/O 💿

Comments

@flying-sheep
Copy link
Member

Description

See scverse/scanpy#3113

I'm trying to read in visium data with antibody capture data but for some reason the antibody capture data is not registering. Is there something I'm doing wrong? I couldn't find documentation on how to do this. Although I do see the antibody capture data in the web_summary.html

However read_10x_mtx method works directly on the folder, is there a way to add gex_only functionality to the read_visium function?

Minimal reproducible example

adata = sq.read.visium(path, count_file='filtered_feature_bc_matrix.h5', load_images=True)

Traceback

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[7], line 13
     11 key = get_second_to_last_split(path)
     12 print(key)
---> 13 adata = sq.read.visium(path, count_file='filtered_feature_bc_matrix.h5', load_images=True)
     15 # Create unique cell identifiers
     16 adata.obs_names = f'sample_{key}_' + adata.obs_names

File /bgfs/alee/LO_LAB/Personal/Alexander_Chang/alc376/envs/popari_env/lib/python3.12/site-packages/squidpy/read/_read.py:67, in visium(path, counts_file, library_id, load_images, source_image_path, **kwargs)
     34 """
     35 Read *10x Genomics* Visium formatted dataset.
     36 
   (...)
     64     - :attr:`anndata.AnnData.uns` ``['spatial']['{library_id}']['metadata']`` - various metadata.
     65 """  # noqa: E501
     66 path = Path(path)
---> 67 adata, library_id = _read_counts(path, count_file=counts_file, library_id=library_id, **kwargs)
     69 if not load_images:
     70     return adata

TypeError: squidpy.read._utils._read_counts() got multiple values for keyword argument 'count_file'

Version

cc @alexanderchang1

@alexanderchang1
Copy link

Hi,

Does this depreciation mean squidpy will be a drop in replacement for scanpy functions like sc.pl.spatial(prop_adata, color = "Cancer Cells")? We have vignettes for an ongoing project that will need modification. Is there a post to read about the depreciation changes?

Secondly, are you able to pull the same changes I put on the PR for Scanpy, or should I fork Squidpy and try editing it here? I'm not familiar with pull requests and have read the contributing documentation, but I am still struggling to get it to pass the checks. It's a relatively straightforward change of 6 lines to add existing gex_only read_10x_h5 functionality to the read_visium function.

See here: scverse/scanpy@0b89362

@flying-sheep
Copy link
Member Author

flying-sheep commented Jan 24, 2025

Hi! Again, sorry for not replying to you, only to then close your PR and move your issue.

I’m pretty sure sc.pl.spatial was the base for the initial version of sq.pl.spatial_scatter, but since then, the squidpy version has seen a lot of development, so I wouldn’t be surprised if there were some slight differences (apart from the added functionality). You can see an example notebook for this function here: https://squidpy.readthedocs.io/en/stable/notebooks/examples/plotting/plot_scatter.html

are you able to pull the same changes I put on the PR for Scanpy, or should I fork Squidpy and try editing it here?

Maybe no change is necessary:

  • try specifying counts_file (note the “s”) and try again!
  • if you also specify gex_only=False, it should be passed through!

@flying-sheep flying-sheep linked a pull request Jan 24, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working I/O 💿
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants