gao-lab / Cell_BLAST

A BLAST-like toolkit for large-scale scRNA-seq data querying and annotation.
http://cblast.gao-lab.org
MIT License
82 stars 13 forks source link

Cross-Species Celltype Annotation #27

Open CHANG-Shaole opened 6 months ago

CHANG-Shaole commented 6 months ago

Hi, Cell BLAST team!

Recently, I wanted to use your method to perform the Cross-species cell type annotation tasks. However, I cannot see any cross-species cell type annotation examples on the Cell BLAST tutorial page.

So, I want to know if there are any exps I can do quickly to start the cross-species cell type annotation task by using your great method.

Jeff1995 commented 6 months ago

Hi @CHANG-Shaole. Thanks for your interest in Cell BLAST!

To perform cross-species cell type annotation with Cell BLAST, you would need to align the gene names across species using ortholog relations first. For close species like human and mouse, I'd recommend keeping just the one-to-one orthologs, and rename genes of one species into the other before feeding the data to the model.

For evolutionally more distant species where the number of one-to-one orthologs is limited, the integration can be more challenging. In that case I'd recommend trying other methods like CAME or SAMap, which were designed to better address this challenge.

Let me know if there were further issues.

CHANG-Shaole commented 6 months ago

Thank you for your in-time reply! I will give it a try.

CHANG-Shaole commented 6 months ago

Sorry for bothering you again. It seems that the links of exp data-Baron_human.h5ad and Lawlor.h5ad are invalid. I would much appreciate it if you could give me another link for the data download.

Jeff1995 commented 6 months ago

I tried downloading them, and they seem to be working just fine. Could you try a different browser, or use command line tools like wget or curl?

CHANG-Shaole commented 6 months ago

Thank you for the reply! Recently I tried to follow your demo. But whenever I run such a block:

blast = cb.blast.BLAST(models, baron_human)

it came with an error:

TypingError: Failed in nopython mode pipeline (step: nopython frontend)
No implementation of function Function(<function wasserstein_distance at 0x0000014F81236C10>) found for signature:

 >>> wasserstein_distance(array(float64, 1d, C), array(float64, 1d, C))

There are 2 candidate implementations:
   - Of which 2 did not match due to:
   Overload of function 'wasserstein_distance': File: Cell_BLAST\blast.py: Line 48.
     With argument(s): '(array(float64, 1d, C), array(float64, 1d, C))':
    No match.

During: resolving callee type: Function(<function wasserstein_distance at 0x0000014F81236C10>)
During: typing of call at [d:\Anaconda3\envs\cb\lib\site-packages\Cell_BLAST\blast.py](file:///D:/Anaconda3/envs/cb/lib/site-packages/Cell_BLAST/blast.py) (229)

File "d:\Anaconda3\envs\cb\lib\site-packages\Cell_BLAST\blast.py", line 229:
def npd_v1(
    <source elided>
    return 0.5 * (
        scipy.stats.wasserstein_distance(
        ^

Could you tell me what the error is and how to solve it?

I am sure everything follows your demo, and I tried it on both Windows and Linux OS.