pachterlab / kb_python

A wrapper for the kallisto | bustools workflow for single-cell RNA-seq pre-processing
https://www.kallistobus.tools/
BSD 2-Clause "Simplified" License
141 stars 24 forks source link

Raise ChemistryError after installation #188

Closed andrei-stoica26 closed 1 year ago

andrei-stoica26 commented 1 year ago

Hi,

I just installed kb-python and I am getting the following error when running kb:

Traceback (most recent call last): File "/home/andrei/.local/bin/kb", line 5, in from kb_python.main import main File "/home/andrei/.local/lib/python3.8/site-packages/kb_python/main.py", line 11, in from .config import ( File "/home/andrei/.local/lib/python3.8/site-packages/kb_python/config.py", line 102, in Technology('10XV1', '10x version 1', ngs.chemistry.get_chemistry('10xv1')), File "/home/andrei/.local/lib/python3.8/site-packages/ngs_tools/chemistry/init.py", line 90, in get_chemistry raise ChemistryError( ngs_tools.chemistry.Chemistry.ChemistryError: Multiple matching chemistries found: ['10xv1', '10xv3_Ultima', '10xFBonly', '10xATAC', '10xFB', '10xMultiome']

Any ideas about how to fix this? Thank you for your help.

Yenaled commented 1 year ago

@Lioscro in ngs-tools, there were some previous commits in devel (when adding spatial chemistries) that occurred after the tagged v1.8.1 release that's causing errors to be thrown for v1.8.2 of ngs-tools.

Specifically in ngs_tools/chemistry/__init__.py, there were some checks introduced for cleaning up chemistry names and extracting chemistry versions that's causing issues.

We have: if cleaned_name in base_name and cleaned_version == version, however, if we get cleaned_name=10x (with cleaned_version=1), that will match multiple technologies' base_names (10xATAC, 10xFB, etc. [all of which are also defaulted to version=1]).

I think we should simply be checking if cleaned_name == base_name and cleaned_version == version instead (i.e. == instead of in).

Lioscro commented 1 year ago

Thanks for reporting this! I've yanked the release from Pypi. I'll make a patch with the fix.

andrei-stoica26 commented 1 year ago

Thank you for your help, it works well now with the new ngs-tools patch.