caravagnalab / CNAqc

CNAqc - Copy Number Alteration (CNA) Quality Check package
GNU General Public License v3.0
17 stars 8 forks source link

Bug in the analyze_peaks function (not recognizing `matching_epsilon = NULL`) #30

Closed vvvirgy closed 7 months ago

vvvirgy commented 9 months ago

I am trying to run the example data analysis reported in the documentation. After having created the CNAqc object with all the samples downloaded as indicated, I run the function analyze_peaks, as follows (CNAqc_samples is just a list of CNAqc objects):

CNAqc_samples_peaks = lapply(CNAqc_samples, function(x) {
  CNAqc::analyze_peaks(x, 
                       purity_error = 0.05, 
                       matching_strategy = 'closest')
})

My R console enters in debug mode, reporting issue at the row 129 of the analyze_peaks function:

  if (!is.null(matching_epsilon)) {
    stop("matching_epsilon is deprecated - using purity_error = ",
         purity_error)
    matching_epsilon = purity_error
  }

Although matching_epsilon = NULL by default.

I can make the code move on and execute the analysis anyway until the next breakpoint (which occurs when the function will be run on the next sample), but I don't understand why matching_epsilon is recognised as not NULL even if it should be by default. I have also tried to explicity define it as NULL when calling the function, but the issue occurred anyway.

caravagn commented 8 months ago

You need a reprex example for me to reproduce it, otherwise it's hard. Ofc, if you fix it yourself happy to check your fix.

caravagn commented 7 months ago

Is this still a thing?

vvvirgy commented 7 months ago

It seems that is not a problem anymore, probably it was fixed by other adjustments in the latest weeks