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

KeyError: 'branch_masks not found in ad.obsm' #138

Closed
simonekats opened this issue Apr 22, 2024 · 5 comments
Closed

KeyError: 'branch_masks not found in ad.obsm' #138

simonekats opened this issue Apr 22, 2024 · 5 comments

Comments

@simonekats
Copy link

I have computed the PR_results but for some reason it s not adding the branch_probs or branch_masks to the adata. When I check pr_res.branch_probs it shows results but not sure why it is not being added to the adata object. Any advice?

@katosh
Copy link
Collaborator

katosh commented Apr 22, 2024

Hi @simonekats, thank you for reporting! Could you provide

  • the version of palantir you are uising,
  • a code example of the calls you expect to manipulate the anndata,
  • and the output of print(ad) before and after the call.

This might allow us to debug this further.

@simonekats
Copy link
Author

Hi!

  • palantir-1.3.3
  • pr_res = palantir.core.run_palantir(
    adata, start_cell, num_waypoints=500, terminal_states = terminal_states
    )
  • The output remain the same except it adds the pseudotime and entropy to the adata.obs

@katosh
Copy link
Collaborator

katosh commented Apr 23, 2024

That looks great! Please provide the outputs of print(ad) for me to be able to help you though.

@simonekats
Copy link
Author

AnnData object with n_obs × n_vars = 457 × 1198
obs: 'experiment_id', 'sample_id', 'count_path', 'Project_ID', 'Experiment_ID', 'Sample_ID', 'Media', 'Condition', 'Maturation', 'n_genes', 'n_genes_by_counts', 'total_counts', 'total_counts_mt', 'pct_counts_mt', 'leiden', 'palantir_pseudotime', 'palantir_entropy', 'macrostates_fwd', 'clusters_gradients', 'term_states_fwd', 'term_states_fwd_probs'
var: 'highly_variable', 'means', 'dispersions', 'dispersions_norm', 'mean', 'std', 'gene_trends_clusters', 'mean expression'
uns: 'Condition_colors', 'Experiment_ID_colors', 'Maturation_colors', 'Project_ID_colors', 'hvg', 'leiden', 'leiden_colors', 'log1p', 'neighbors', 'pca', 'tsne', 'umap', 'DM_EigenValues', 'palantir_waypoints', 'masks_key_columns', 'gene_trend_key_branch_pseudotime', 'branch_names', 'gene_trends_M2_1_pseudotime', 'gene_trends_M2_2_pseudotime', 'gene_trends_M2_pseudotime', 'schur_matrix_fwd', 'eigendecomposition_fwd', 'macrostates_fwd_colors', 'coarse_fwd', 'clusters_gradients_colors', 'term_states_fwd_colors', 'T_fwd_params'
obsm: 'X_pca', 'X_tsne', 'X_umap', 'DM_EigenVectors', 'DM_EigenVectors_multiscaled', 'palantir_fate_probabilities', 'branch_masks', 'masks_key', 'schur_vectors_fwd', 'macrostates_fwd_memberships', 'term_states_fwd_memberships', 'lineages_fwd', 'X_fate_simplex_fwd', 'T_fwd_tsne', 'T_fwd_umap'
varm: 'PCs', 'gene_trend_key_branch', 'gene_trends_M2_1', 'gene_trends_M2_2', 'gene_trends_M2', 'terminal_lineage_drivers'
layers: 'MAGIC_imputed_data'
obsp: 'connectivities', 'distances', 'DM_Kernel', 'DM_Similarity'

@katosh
Copy link
Collaborator

katosh commented Apr 25, 2024

Its right there:
image

@katosh katosh closed this as completed May 9, 2024
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