Fraternalilab / sciCSR

Single-Cell Inference of Class Switch Recombination
GNU General Public License v3.0
18 stars 3 forks source link

AttributeError: 'NoneType' object has no attribute 'shape' when running fitTPT #7

Closed OMIC-coding closed 9 months ago

OMIC-coding commented 10 months ago

tpt_P_csr <- fitTPT(anndata_file = '/data/project/liziyu/HIV/results/B-cells/B.scicsr_assay-RNA.h5ad',CellrankObj = P.csr, group.cells.by = 'isotype', source_state = 'M', target_state = 'G3')

:1: FutureWarning: The default of observed=False is deprecated and will be changed to True in a future version of pandas. Pass observed=False to retain current behavior or observed=True to adopt the future default and silence this warning. fit TPT with source state: 'M' and target state: 'G3'. Error in py_call_impl(callable, call_args$unnamed, call_args$named) : AttributeError: 'NoneType' object has no attribute 'shape' Run `reticulate::py_last_error()` for details.
josef0731 commented 10 months ago

Hi,

Could you please check the anndata object has the 'isotype' column which you are using the group cells, and whether 'M' & 'G3' both exist in the AnnData.obs slot? Seems it thinks it can't find the column / cells with these states?

Joseph

OMIC-coding commented 10 months ago

Both M and G3 exist. However,there isn‘t D in my object.

发自我的iPhone

------------------ Original ------------------ From: Joseph Ng @.> Date: Thu,Jan 18,2024 6:37 PM To: Fraternalilab/sciCSR @.> Cc: Will @.>, Author @.> Subject: Re: [Fraternalilab/sciCSR] AttributeError: 'NoneType' object has noattribute 'shape' when running fitTPT (Issue #7)

Hi,

Could you please check the anndata object has the 'isotype' column which you are using the group cells, and whether 'M' & 'G3' both exist in the AnnData.obs slot? Seems it thinks it can't find the column / cells with these states?

Joseph

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

josef0731 commented 9 months ago

Hi,

Apologies for the late response - were busy with some other projects. Without the data it would be difficult to diagnose the problem - I would guess most likely it is because with the grouping of cells imposed the program was left with no cells for certain groups. I would also like to add, if the idea here is to analyse dynamics of CSR between M and G3, there is little point in running the fitTPT function - the idea of the function is to ask, in a multi-state system, what the data say about the different possible paths that get you from the 'start' state to the 'end' state. Since in the IGH genomic locus between M and G3 there are no other isotypes in the middle (I assume you are working on human data), there is no other ways to go from M to G3 other than a direct jump! So TPT - if it had work - would simply tell you a 100% switch from M to G3 - not very useful I would say ...

I am closing this issue for now but if there are any other things I can help then please open a new issue.

Best wishes, Joseph