Skip to content

NAs from compare_genes_within_state_graph() causes issues in DvEG analysis #17

@rfriedman22

Description

@rfriedman22

The result of compare_genes_within_state_graph() can return NAs in the genes_within_cell_group column. This creates two issues. The first is that when I try to print the result, it prints a massive wall of data rather than the tidy tibble it is supposed to be. The second is that I get the following error when I run calculate_dvegs():

> dvegs <- calculate_dvegs(perturb_degs, degs, sig_p_val_thresh = 0.05)
Error in `list_unchop()`:
! Can't combine `x[[1]]` <grouped_df> and `x[[9]]` <character>.
Run `rlang::last_trace()` to see where the error occurred.
> rlang::last_trace()
<error/vctrs_error_ptype2>
Error in `list_unchop()`:
! Can't combine `x[[1]]` <grouped_df> and `x[[9]]` <character>.
---
Backtrace:
    ▆
 1. ├─platt::calculate_dvegs(perturb_degs, degs, sig_p_val_thresh = 0.05)
 2. │ └─perturb_degs %>% tidyr::unnest(genes_within_cell_group)
 3. ├─tidyr::unnest(., genes_within_cell_group)
 4. └─tidyr:::unnest.data.frame(., genes_within_cell_group)
 5.   └─tidyr::unchop(...)
 6.     └─tidyr:::df_unchop(...)
 7.       └─vctrs::list_unchop(col, ptype = col_ptype)
Run rlang::last_trace(drop = FALSE) to see 9 hidden frames.

If I filter out the NA columns from the perturb DEGs, it works fine:

dvegs <- calculate_dvegs(perturb_degs %>% filter(!is.na(genes_within_cell_group)), degs, sig_p_val_thresh = 0.05)

Either compare_genes_within_state_graph() should fill in the NAs better/filter them out so the user's console isn't flooded with text, or calculate_dvegs() should have a filtering step at the very beginning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions