-
Notifications
You must be signed in to change notification settings - Fork 12
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
Difficulty: “key_error” in dot plot for CellphoneDB output #73
Comments
hi @ums2026, yes so basically you need to have # read in the metadata file as per original tutorial
metadata = pd.read_csv(meta_file_path, sep = '\t')
# check the first 3 rows
# metadata.head(3)
# set the indices so that they match the adata.obs_names
metadata.set_index("barcode_sample", inplace=True)
# now simply transfer
adata.obs["cell_type"] = metadata["cell_type"] In a real-life scenario, the @luzgaral is aware of the same issue and would be pushing out an updated notebook shortly on cellphonedb's repo |
This is odd - we have worked with the same adata variable and were able to run the analysis on it, but it did not have the column. I tried running it like this, with a new transfer, only this time, I ended up with a new error, that says "ValueError: No significant results found." I'm not sure how to fix that - do you have any suggestions? I am able to get a heatmap, but for some reason, I am getting this issue with a dot plot. Thank you for the help! |
yes that's because cellphonedb expects the 2 files (
Can you show me the full command you used? did you specify genes/gene familites? |
Here is the command:
But I have also tried without specifying any cell types, this way:
I did not specify genes/gene families. Is this a requirement? Thank you! |
hmm would you be able to share your input files and h5ad so that i can do some tests? if it's not too big, you can send them to my email [email protected] or we can find a more secure solution? |
Hello,
I am trying to create a dot plot for a Cellphone DB output, but am consistently receiving a “key_error”: “cell_type”.
My h5ad counts file looks like this one (from the CellphoneDB documentation) when I open it in a notebook:
Given that it looks like it is formatted properly, I am not sure why it says that I am missing something - when I run adata.obs_keys(), I do get an empty list in my data, but if that is the issue, I am not sure how to fix that. All the analyses are running correctly with this file in CellphoneDB. Is there any way to also input the metadata file to the plotting to fix this issue? Or is there some other problem causing the cell_type error?
Here is the exact error:
Thank you in advance!
The text was updated successfully, but these errors were encountered: