Code Monkey home page Code Monkey logo

Comments (6)

Zethson avatar Zethson commented on June 12, 2024

Do you have more than one sample for this group?

ValueError: Could not calculate statistics for groups Ionocyte since they only contain one sample.

Generally, please post usage questions in the scverse discourse

from scanpy.

kamanso avatar kamanso commented on June 12, 2024

Do you have more than one sample for this group?

ValueError: Could not calculate statistics for groups Ionocyte since they only contain one sample.

Generally, please post usage questions in the scverse discourse

Yes, this group has 39 categories:

[2992 rows x 17 columns]

adata_sc.obs['Manuscript_Identity']
010I_AAACCTGAGAAGCCCA Macrophage
010I_AAACCTGAGTCGAGTG Macrophage
010I_AAACGGGGTCATACTG Macrophage
010I_AAACGGGGTTGGACCC T
010I_AAAGATGAGAACTGTA B
...
8CO_TGGGCGTTCTTAGCCC cMonocyte
8CO_TGGTTCCGTCTCACCT ATII
8CO_TTGACTTGTCGGCTCA Myofibroblast
8CO_TTGTAGGTCCAGATCA cMonocyte
8CO_TTTATGCGTAGGCTGA VE_Venous
Name: Manuscript_Identity, Length: 78081, dtype: category
Categories (39, object): ['ATI', 'ATII', 'Aberrant_Basaloid', 'B', ..., 'cDC2', 'cMonocyte',
'ncMonocyte', 'pDC']

from scanpy.

eroell avatar eroell commented on June 12, 2024

I am not sure what code you used to generate the above output? In any case

Could not calculate statistics for groups Ionocyte since they only contain one sample.

The issue seems to be related to Ionocytes.

so adata_sc.obs['Manuscript_Identity'].value_counts() or so would be needed to check that indeed more than 1 Ionocyte is present.

from scanpy.

kamanso avatar kamanso commented on June 12, 2024

I am not sure what code you used to generate the above output? In any case

Could not calculate statistics for groups Ionocyte since they only contain one sample.

The issue seems to be related to Ionocytes.

so adata_sc.obs['Manuscript_Identity'].value_counts() or so would be needed to check that indeed more than 1 Ionocyte is present.

I ran the code you sent to me, hers is the result:
'Manuscript_Identity
Macrophage 14051
T_Cytotoxic 10739
T 9941
Macrophage_Alveolar 9938
NK 7997
cMonocyte 5508
B 4506
ncMonocyte 2291
Multiplet 1300
Myofibroblast 1153
Ciliated 1055
Mast 987
cDC2 867
T_Regulatory 809
Lymphatic 677
VE_Capillary_B 571
VE_Peribronchial 556
Fibroblast 527
ILC_A 392
B_Plasma 379
ATII 364
Club 362
Pericyte 309
VE_Arterial 309
pDC 289
ILC_B 288
SMC 284
VE_Capillary_A 276
ATI 268
cDC1 249
VE_Venous 244
Basal 172
DC_Mature 149
Mesothelial 109
Goblet 103
Aberrant_Basaloid 32
DC_Langerhans 20
PNEC 9
Ionocyte 1
Name: count, dtype: int64
'

So I just need to remove "Ionocyte" group, it could be work,right?

from scanpy.

eroell avatar eroell commented on June 12, 2024

Since sc.tl.rank_genes_groups computes e.g. the variance within groups, there has to be more samples per group than 1, yes.
What cells you want remove during your analysis can be a tricky question, (e.g. maybe a strict preprocessing kicks out many cells) - but if you want to use this method on your data you seem to use here, the single Ionocyte has to be removed.

Hope this helps!

Quick hint: as mentioned above, ideally you raise such a question here: scverse discourse
This way, other users who encounter the same problem as you will also find the answer, easier than here :)

from scanpy.

eroell avatar eroell commented on June 12, 2024

I will close the issue for now, as based on the provided information and the discussion so far, it seems that the question has been addressed and hopefully resolved :)

However, please don't hesitate to start user questions on scverse discourse, or software & maintenance releated things here. Or reopen the issue if you think I missed your point!

Thanks for being a part of our community! :)

from scanpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.