-
Notifications
You must be signed in to change notification settings - Fork 5
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
Plotly - Some plots throw error when making a new dataframe column #878
Comments
context where i saw it: for dataset "HIV infection and anti-retroviral treatment (ART) in cerebral organoids containing microglia." in this projection link i am getting "Encountered error: Cannot set a DataFrame with multiple columns to the single column y_rounded": |
Ok figured it out sort of. The projection pattern weight "PC1" could reference either the weight itself (stored in AnnData.var) or the "PC1" column in AnnData.obs from that troublesome dataset (and PC2 would also). I believe something in AnnData may be checking both adata.var and adata.obs for value names, as I have seen this behavior with scanpy functions also. In this case, it is causing the "PC1" column to disappear from intermediate output, and a second "raw_value" (expression) column is added which throws the error upon manipulation as a single column. If you click "PC3" weight in the example above, the plot is successfully generated. So now I need to find where in the code this mix-up is happening and fix that. |
https://anndata.readthedocs.io/en/latest/generated/anndata.AnnData.to_df.html#anndata.AnnData.to_df When converting from AnnData to DataFrame, the adata.var_names (index) values were being used, and for projections, I set these equal to the weights. So I just needed to rename the chosen weight value before converting to dataframe rather than after |
good sleuthing! |
Encountered error: Cannot set a DataFrame with multiple columns to the single column y_rounded
Follow-up to #873.
The "y_rounded" column was made to use in hover text situations where we want to show only two sigfigs of precision when hovering over a plot.
The text was updated successfully, but these errors were encountered: