Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
OMIC-coding opened this issue Jan 13, 2024 · 3 comments

Comments

@OMIC-coding
Copy link

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
Copy link
Collaborator

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
Copy link
Author

OMIC-coding commented Jan 22, 2024 via email

@josef0731
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants