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

No cells passed qc throws a metrics error #18

Open
LinearParadox opened this issue Jan 30, 2025 · 1 comment
Open

No cells passed qc throws a metrics error #18

LinearParadox opened this issue Jan 30, 2025 · 1 comment

Comments

@LinearParadox
Copy link

It seems somehow metrics is being set to none when no cells pass qc:

n_counts: [834.5277709960938, 410984.1875], 2327/4060 passed
n_genes: [121.3244400024414, 11635.00390625], 2162/4060 passed
percent_mito: [0.0, 17.76230812072754], 2041/4060 passed
WARNING: Failed to find lower bound, using min value instead.
percent_ribo: [0.0, 0.009087023325264454], 1720/4060 passed
WARNING: Failed to find lower bound, using min value instead.
percent_hb: [0.0, 0.08680114150047302], 3889/4060 passed
0/4060 pass
No cells passed. Performing simple filtering on counts, genes and mito%
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[18], line 12
      6 sctk.calculate_qc(adata)
      7 metrics = sctk.default_metric_params_df.loc[["n_counts",
      8     "n_genes",
      9     "percent_mito",
     10     "percent_ribo",
     11     "percent_hb"], :]
---> 12 sctk.cellwise_qc(adata)

File [~/miniconda3/envs/scautoqc/lib/python3.9/site-packages/sctk/_pipeline.py:509](https://44.243.199.3:8888/lab/tree/~/miniconda3/envs/scautoqc/lib/python3.9/site-packages/sctk/_pipeline.py#line=508), in cellwise_qc(adata, metrics, cell_qc_key, uns_qc_key, **kwargs)
    504 if adata.obs[cell_qc_key].sum() == 0:
    505     print(
    506         "No cells passed. Performing simple filtering on counts, genes and mito%"
    507     )
    508     adata.obs[cell_qc_key] = (
--> 509         (adata.obs.n_counts >= metrics["n_counts"][0])
    510         & (adata.obs.n_genes >= metrics["n_genes"][0])
    511         & (adata.obs.percent_mito < metrics["percent_mito"][1])
    512     )

TypeError: 'NoneType' object is not subscriptable
@LinearParadox
Copy link
Author

As an update, this seems to be tied to the estimation behind rb% threshold being oddly low. I tried toying with the max values as well as setting it to one sided (maximum only), but this doesn't seem to have any effect, the estimate it gets is still very low. (<1%) for max ribo, which leads to no cells passing qc.

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