dynamo-release icon indicating copy to clipboard operation
dynamo-release copied to clipboard

save h5ad error [TypeError: Can't implicitly convert non-string objects to strings]

Open Jingle0814 opened this issue 1 year ago • 10 comments

  • [ ] I am sure this issue is not simply a general python programming problem (if so, please google the answers).
  • [ ] I have searched github issues and confirm this issue has not reported previously.
  • [ ] I have confirmed this bug is not related to dynamo version and it exists on the latest version of dynamo.

--- Hi,

If this is a question and not a bug report or enhancement request, please post to our Github Discussions channel at https://github.com/aristoteleo/dynamo-release/discussions

Describe the bug A clear and concise description of what the bug is. Thank you to your team for developing dynamo, I encountered an error while running dynamo. I want to save the processed result of dynamo but could not. first, I encountered "TypeError: Can't implicitly convert non-string objects to strings

Above error raised while writing key 'beta' of <class 'h5py._hl.group.Group'> to /" And then I change the .var['beta'] to string type: adata_hsc_raw.var['beta'] = adata_hsc_raw.var['beta'].astype(str) . But it reports the same error with 'gamma'. How do I solve this problem? Thanks a lot!

image To Reproduce The code that produced the bug:

Minimal data may be provided to reproduce the bug Traceback Post the error message from the Tracebook output:

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

session_info.show(): Install session-info via pip install session-info and post the output after running session_info.show()

import dynamo
import session_info
session_info.show()

Additional context Add any other context about the problem here.

Jingle0814 avatar Nov 29 '23 02:11 Jingle0814

Hi, thanks for reporting this issue. Could you tell me which version of Dynamo you are using? I feel like this may be related to a recent pull request. It is not available in the released version yet.

Sichao25 avatar Nov 29 '23 23:11 Sichao25

@Sichao25 Hi, the version I used is 1.1.0.

Jingle0814 avatar Nov 30 '23 01:11 Jingle0814

I think you can get rid of the issue by downloading from github pip install git+https://github.com/aristoteleo/dynamo-release.

Sichao25 avatar Nov 30 '23 15:11 Sichao25

@Sichao25 hi, the 1.3.2 version also error,how do I solve this problem? Thanks a lot! image

Jingle0814 avatar Dec 04 '23 01:12 Jingle0814

Sorry for not making this clear. You may need to a later version like pip install git+https://github.com/aristoteleo/dynamo-release@master. Besides, we add a new saving function called dyn.export_h5ad(). (The write_h5ad may also work, depending on what analysis you have performed).

We will have a new version coming soon. That will make everything easier.

Sichao25 avatar Dec 04 '23 03:12 Sichao25

@Sichao25 hi thanks to your reply. I try the code: python -m pip install git+https://github.com/aristoteleo/dynamo-release@master and it success, image

but when I try to load dynamo,it turns : image

Jingle0814 avatar Dec 04 '23 05:12 Jingle0814

This is a compatibility issue with Ipython. It forces the command line to enter the Ipython mode after importing the Dynamo. You can use it like a notebook. To solve this problem, you may uninstall Ipython, or avoid using the command line.

Sichao25 avatar Dec 04 '23 15:12 Sichao25

@Sichao25 Thank you very much for your prompt reply! By installing the latest version of dynamo and using notebook to analysis, I can save the h5ad files normally with dyn.export_h5ad() function. Thanks again!

Jingle0814 avatar Dec 05 '23 11:12 Jingle0814

No problem. I will keep this issue open until we have the new version released.

Sichao25 avatar Dec 05 '23 16:12 Sichao25

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 14 days

github-actions[bot] avatar Mar 05 '24 00:03 github-actions[bot]

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 14 days

github-actions[bot] avatar Jun 07 '24 00:06 github-actions[bot]