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_ssm_by_sample updates needed #125

Closed rdmorin closed 1 year ago

rdmorin commented 1 year ago

All functions that internally call get_gambl_metadata() should have been updated to require the user specify the seq_type of the sample when not providing the metadata. This is required because the function cannot call get_gambl_metadata() with the right seq_type otherwise. Currently, if a user runs get_ssm_by_sample and specifies a sample_id from any "capture" data set then the function fails unless they also provide the metadata. The fixes for this are twofold:

1) make seq_type a required argument UNLESS the user specifies the argument these_samples_metadata 2) this_sample_id should not be a required argument because, as we do for many functions, this id can be pulled from these_samples_metadata. Hence, the function should require the user specify one of these_samples_metadata or this_sample_id and use whichever one appropriately

Here's an example where the function is currently failing:

slms3_var_calls <- get_ssm_by_sample(
     this_sample_id = "PA001", 
     augmented = FALSE,
     min_read_support = 3
)
Error in if (pair_status == "unmatched") { : argument is of length zero
rdmorin commented 1 year ago

I think I've addressed this issue in the PR I just opened. Let's wait to close this until that's in Master and confirmed to be resolved.