tanaylab / metacells

Metacells - Single-cell RNA Sequencing Analysis
MIT License
87 stars 8 forks source link

analyze_clean_genes small bug? #20

Closed hurleyLi closed 2 years ago

hurleyLi commented 2 years ago

calling mc.pl.analyze_clean_genes(test) without specifying excluded_gene_names and excluded_gene_patterns cause error for the downstream mc.pl.pick_clean_genes(test)

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-142-7d7041885951> in <module>
----> 1 mc.pl.pick_clean_genes(test)

/opt/conda/lib/python3.8/site-packages/metacells/pipeline/clean.py in pick_clean_genes(adata, masks, to)
    142        :py:func:`metacells.tools.mask.combine_masks`.
    143     """
--> 144     tl.combine_masks(adata, masks, to=to)
    145 
    146 

/opt/conda/lib/python3.8/site-packages/metacells/utilities/logging.py in wrapper(*args, **kwargs)
    371                             )
    372 
--> 373                 return function(*args, **kwargs)
    374 
    375             finally:

/opt/conda/lib/python3.8/site-packages/metacells/tools/mask.py in combine_masks(adata, masks, invert, to)
     85         else:
     86             if must_exist:
---> 87                 raise KeyError(f"unknown mask data: {mask_name}")
     88             continue
     89 

KeyError: 'unknown mask data: excluded_gene'
orenbenkiki commented 2 years ago

Thanks - this will be fixed in the next release.

You can specify an empty excluded genes list to work around this.

I assume this is because you already removed all mitochondrial genes etc. from the data in advance, or something like that?

hurleyLi commented 2 years ago

I was actually trying to see what happens if I don't remove MT genes, etc, and happen to see that error. Thanks