Skip to content

count_dbs_contexts() error  #86

@ThomasGro

Description

@ThomasGro

I observe an error when dealing with DBS.
It seems the get_dbs_context() is not working as expected on the first GRL entry, as the test and context genomic ranges look identical.

test=MutationalPatterns::read_vcfs_as_granges(vcf_file, sample_name, ref_genome, type = "dbs")
context=MutationalPatterns::get_dbs_context(test)
counts=MutationalPatterns::count_dbs_contexts(context)
Error in purrr::map() at MutationalPatterns/R/count_dbs_contexts.R:41:5:
ℹ In index: 1.
ℹ With name: sample1.
Caused by error:
! There are some REF or ALT bases, that do not belong to any of the categories.
Did you forget to use 'get_dbs_context()'?
Run rlang::last_trace() to see where the error occurred.

rlang::last_trace(drop = F)
<error/purrr_error_indexed>
Error in purrr::map() at MutationalPatterns/R/count_dbs_contexts.R:41:5:
ℹ In index: 1.
ℹ With name: sample1.
Caused by error:
! There are some REF or ALT bases, that do not belong to any of the categories.
Did you forget to use 'get_dbs_context()'?


Backtrace:

  1. ├─MutationalPatterns::count_dbs_contexts(context)
  2. │ └─purrr::map(vcf_list, .count_dbs_contexts_gr, categories) at MutationalPatterns/R/count_dbs_contexts.R:41:5
  3. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
  4. │ ├─purrr:::with_indexed_errors(...)
  5. │ │ └─base::withCallingHandlers(...)
  6. │ ├─purrr:::call_with_cleanup(...)
  7. │ └─MutationalPatterns (local) .f(.x[[i]], ...)
  8. │ └─base::stop(...) at MutationalPatterns/R/count_dbs_contexts.R:90:5
  9. └─base::.handleSimpleError(...)
  10. └─purrr (local) h(simpleError(msg, call))
  11. └─cli::cli_abort(...)
    
  12.   └─rlang::abort(...)
    

I attaches the R data files in a ZIP archive for test, context, and counts for you to reproduce my error.
I hope that helps.

Thank you for your support.

dbs_error_example.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions