scverse / scanpy

Single-cell analysis in Python. Scales to >1M cells.
https://scanpy.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.86k stars 595 forks source link

Can't read in protein antibody capture data #3113

Open alexanderchang1 opened 2 months ago

alexanderchang1 commented 2 months ago

Please make sure these conditions are met

What happened?

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 code sample

print(key)
        adata = sc.read_visium(path, count_file='filtered_feature_bc_matrix.h5', load_images=True, )
        print(adata)

        # Separate RNA and protein data
        rna_data = adata[:, adata.var['feature_types'] == 'Gene Expression']
        protein_data = adata[:, adata.var['feature_types'] == 'Antibody Capture']

        # Verify the separated data
        print("RNA data shape:", rna_data.shape)
        print("Protein data shape:", protein_data.shape)

Error output

MWS22-14789

AnnData object with n_obs × n_vars = 2256 × 18085
    obs: 'in_tissue', 'array_row', 'array_col'
    var: 'gene_ids', 'feature_types', 'genome', 'isotype_control', 'normalized', 'pattern', 'read', 'secondary_name', 'sequence'
    uns: 'spatial'
    obsm: 'spatial'
RNA data shape: (2256, 18085)
Protein data shape: (2256, 0)

Versions

``` 1.10.1 ```
alexanderchang1 commented 1 month ago

Hi, I just wanted to follow up on this.

flying-sheep commented 1 month ago

Hi, I don’t have much experience with that data. Does squidpy work better? https://squidpy.readthedocs.io/en/stable/api/squidpy.read.visium.html

scanpy doesn’t have much support for spatial analysis, squidpy is built for it.