morinlab / GAMBLR

Set of standardized functions to operate with genomic data
https://morinlab.github.io/GAMBLR/
MIT License
3 stars 2 forks source link

`get_gambl_metadata` is broken for normals #190

Closed lkhilton closed 7 months ago

lkhilton commented 1 year ago

When I try to run get_gambl_metadata(tissue_status_filter = "normal") I get the following error:

Error in `mutate_cols()`:          
! Problem with `mutate()` column `consensus_coo_dhitsig`.
ℹ `consensus_coo_dhitsig = case_when(...)`.
✖ must be a logical vector, not a character vector.
Caused by error in `glubort()`:
! must be a logical vector, not a character vector.
Run `rlang::last_trace()` to see where the error occurred.

I think this can be traced back to commit c752dfb, which commented out the part that simply returns the basic metadata columns when normal is the requested tissue_status. Could someone look into this?

This is with the current master eecaa88.

lkhilton commented 1 year ago

Could @mattssca take a look at the change that broke this functionality? Still broken as of latest master 52fb6802ea00f6744291e4f4d1cbd50cf4620981.

mattssca commented 1 year ago

I went over the old PR that added this and was looking for the reason. Seems this was commented out to allow the vignettes to be knitted, pretty sparse information. I think I am going to un-comment this on my branch, reknit the vignettes and see if the problem is still relevant and what another potential fix might be, that allows tissue_status_filter = "normal" to work the intended way with get_gambl_metadata.

lkhilton commented 1 year ago

Yay, thank you!

lkhilton commented 1 year ago

@mattssca there is still a bug with this function, unfortunately. If you specify both tumour and normal (e.g. tissue_status_filter = c("tumour", "normal")), it returns this error:

get_gambl_metadata(tissue_status_filter = c("tumour","normal"))
Error in if (tissue_status_filter == "normal") { :                                                                                                                                                                                
  the condition has length > 1

This is because this test requires that tissue_status_filter is a vector of length 1. I think you need to include a test of the vector length first, e.g.

if (length(tissue_status_filter) == 1 & tissue_status_filter == "normal")