# cell2location

**URL:** https://discourse.scverse.org/c/ecosystem/cell2location/42.md

[Latest](https://discourse.scverse.org/latest.md) · [Categories](https://discourse.scverse.org/categories.md) · [Tags](https://discourse.scverse.org/tags.md)

---

## [About the cell2location category](https://discourse.scverse.org/t/about-the-cell2location-category/348)

<div class="topic-metadata">

**Author:** [@adamgayoso](https://discourse.scverse.org/u/adamgayoso)\
**Replies:** 0

</div>

For questions about cell2location.

---

## [Need to compare cell2location (probabilistic approach for deconvolution) to celltrek (spatial mapping approach)](https://discourse.scverse.org/t/need-to-compare-cell2location-probabilistic-approach-for-deconvolution-to-celltrek-spatial-mapping-approach/3940)

<div class="topic-metadata">

**Author:** [@smk5g5](https://discourse.scverse.org/u/smk5g5)\
**Replies:** 0\
**Last updated:** [March 4, 2026, 4:13pm UTC](https://discourse.scverse.org/t/need-to-compare-cell2location-probabilistic-approach-for-deconvolution-to-celltrek-spatial-mapping-approach/3940 "2026-03-04T16:13:51Z")

</div>

I had done most of my spatial transcriptomic celltype mapping reverse enginerring celltrek to get celltypes that map to a visium spot. After the paper submission reviewer wants us to compare our predictions with that of …

---

## [ImportError: cannot import name 'run\_regression' from 'cell2location'](https://discourse.scverse.org/t/importerror-cannot-import-name-run-regression-from-cell2location/1583)

<div class="topic-metadata">

**Author:** [@LimC](https://discourse.scverse.org/u/LimC)\
**Replies:** 3\
**Last updated:** [October 15, 2025, 10:23pm UTC](https://discourse.scverse.org/t/importerror-cannot-import-name-run-regression-from-cell2location/1583 "2025-10-15T22:23:39Z")

</div>

I installed cell2location in a conda env with a python version == Python 3.10.8. There is no error running import cell2location. However, when I ran from cell2location import run\_regression, I got this error: ImportError…

---

## [Understanding NMF output "mean\_nUMI\_factorsfact"](https://discourse.scverse.org/t/understanding-nmf-output-mean-numi-factorsfact/3698)

<div class="topic-metadata">

**Author:** [@kimsjune](https://discourse.scverse.org/u/kimsjune)\
**Replies:** 0\
**Last updated:** [June 24, 2025, 5:42pm UTC](https://discourse.scverse.org/t/understanding-nmf-output-mean-numi-factorsfact/3698 "2025-06-24T17:42:04Z")

</div>

After running res\_dict, adata\_vis = run\_colocation(), new columns called “mean\_nUMI\_factorsfact\_n” (where n = 1, 2, … R) are added to the adata\_vis object. I’m hoping to get a clear understanding of these values. I can g…

---

## [Num samples in export posterior for Visium HD](https://discourse.scverse.org/t/num-samples-in-export-posterior-for-visium-hd/3278)

<div class="topic-metadata">

**Author:** [@jairaj-mathur](https://discourse.scverse.org/u/jairaj-mathur)\
**Replies:** 0\
**Last updated:** [October 3, 2024, 11:48pm UTC](https://discourse.scverse.org/t/num-samples-in-export-posterior-for-visium-hd/3278 "2024-10-03T23:48:59Z")

</div>

Hi all I am chunking Visium HD data to train model in parts, I had a question regarding export\_posterior. Should I increase the number of samples? Will that affect accuracy of my results? Same for the adata\_sc training,…

---

## [Comparing cell type abundance acroos samples calculated in differnt runs](https://discourse.scverse.org/t/comparing-cell-type-abundance-acroos-samples-calculated-in-differnt-runs/1949)

<div class="topic-metadata">

**Author:** [@moutazhelal](https://discourse.scverse.org/u/moutazhelal)\
**Replies:** 0\
**Last updated:** [December 7, 2023, 5:10pm UTC](https://discourse.scverse.org/t/comparing-cell-type-abundance-acroos-samples-calculated-in-differnt-runs/1949 "2023-12-07T17:10:59Z")

</div>

Thank you very much for participating in my topic Problem I have a question regaarding cell type abunabce in spots. Is it accurate to compare cell types abundance of the same cell type in two different spatial samples …

---

## [Selecting Optimal Training Epochs for Cell2location](https://discourse.scverse.org/t/selecting-optimal-training-epochs-for-cell2location/1322)

<div class="topic-metadata">

**Author:** [@kuang-da](https://discourse.scverse.org/u/kuang-da)\
**Replies:** 0\
**Last updated:** [April 16, 2023, 8:27pm UTC](https://discourse.scverse.org/t/selecting-optimal-training-epochs-for-cell2location/1322 "2023-04-16T20:27:34Z")

</div>

Hello everyone, I would like to express my gratitude for the development of the Cell2location tool, which has proven to be invaluable for spatial deconvolution. I have a question related to training the model and would …

---

## [Further explanation of q05\_cell\_abundance\_w\_sf values](https://discourse.scverse.org/t/further-explanation-of-q05-cell-abundance-w-sf-values/1231)

<div class="topic-metadata">

**Author:** [@epalo](https://discourse.scverse.org/u/epalo)\
**Replies:** 1\
**Last updated:** [March 17, 2023, 3:03am UTC](https://discourse.scverse.org/t/further-explanation-of-q05-cell-abundance-w-sf-values/1231 "2023-03-17T03:03:11Z")

</div>

Hello! Thanks for developing such a wonderful tool. This may be a very stupid question but I wanted some clarifications on q05\_cell\_abundance\_w\_sf, it is not clear to me what the meaning of this q05\_cell\_abundance\_w\_sf …

---

## [Question about adjacent normal liver](https://discourse.scverse.org/t/question-about-adjacent-normal-liver/1032)

<div class="topic-metadata">

**Author:** [@vibrant1984](https://discourse.scverse.org/u/vibrant1984)\
**Replies:** 1\
**Last updated:** [February 27, 2023, 10:13pm UTC](https://discourse.scverse.org/t/question-about-adjacent-normal-liver/1032 "2023-02-27T22:13:47Z")

</div>

We are analyzing metastatic samples that are metastasized to liver using 10x visium. Obviously , there will be adjacent normal liver liver tissue. While we are giving scRNA data from tumors , how will Cell2location annot…

---

## [Questions about Cell2location mathematics model](https://discourse.scverse.org/t/questions-about-cell2location-mathematics-model/933)

<div class="topic-metadata">

**Author:** [@ShuaiWen](https://discourse.scverse.org/u/ShuaiWen)\
**Replies:** 2\
**Last updated:** [February 27, 2023, 10:12pm UTC](https://discourse.scverse.org/t/questions-about-cell2location-mathematics-model/933 "2023-02-27T22:12:06Z")

</div>

Hello I am a graduate student majored in mathematics from Harbin Institute of Technology of China. My research is focused on Bioinformation. I have recently read paper “Cell2location maps fine-grained cell types in sp…

---

## [Questions about Cell2location](https://discourse.scverse.org/t/questions-about-cell2location/931)

<div class="topic-metadata">

**Author:** [@ShuaiWen](https://discourse.scverse.org/u/ShuaiWen)\
**Replies:** 0\
**Last updated:** [November 17, 2022, 12:01am UTC](https://discourse.scverse.org/t/questions-about-cell2location/931 "2022-11-17T00:01:22Z")

</div>

Hello everyone! I am a graduate student majored in mathematics from Harbin Institute of Technology of China. My research is focused on Bioinformation. I have recently read paper “Cell2location maps fine-grained cel…
